[dpdk-dev] [PATCH v1] testpmd: eeprom display
Ferruh Yigit
ferruh.yigit at intel.com
Fri Sep 21 17:41:10 CEST 2018
On 9/18/2018 9:59 AM, Gaetan Rivet wrote:
> The interactive command
>
> show port eeprom <id>
>
> will dump the content of the EEPROM for the selected port.
> Dumping eeprom of all ports at once is not supported.
>
> Signed-off-by: Gaetan Rivet <gaetan.rivet at 6wind.com>
<...>
> +void
> +port_eeprom_display(portid_t port_id)
> +{
> + struct rte_eth_dev_module_info minfo;
> + struct rte_dev_eeprom_info einfo;
> + char buf[1024];
> + int ret;
> +
> + if (port_id == (portid_t)RTE_PORT_ALL)
> + return;
> +
> + ret = rte_eth_dev_get_module_info(port_id, &minfo);
> + if (ret) {
> + printf("Unable to get module info: %d\n", ret);
> + return;
> + }
> +
> + einfo.offset = 0;
> + einfo.length = minfo.eeprom_len;
> + einfo.data = buf;
> +
> + ret = rte_eth_dev_get_module_eeprom(port_id, &einfo);
> + if (ret) {
> + printf("Unable to get module EEPROM: %d\n", ret);
> + return;
> + }
> +
> + printf("Port %hhu EEPROM:\n", port_id);
Causing build error [1], there are various formatting used for printing port_id
[2], do we need this %hhu accuracy, I am for %u since port_id is an unsigned
value result should be same.
[1]
printf("Port %hhu EEPROM:\n", port_id);
~~~~ ^~~~~~~
%hu
[2]
%d, %u, %PRIu8 [wrong], %PRIu16
More information about the dev
mailing list