From: Ferruh Yigit <ferruh.yigit@intel.com>
To: Gaetan Rivet <gaetan.rivet@6wind.com>, dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH v1] testpmd: eeprom display
Date: Fri, 21 Sep 2018 16:41:10 +0100 [thread overview]
Message-ID: <582815f0-926e-8977-c8d1-3d4e1c5e2fd4@intel.com> (raw)
In-Reply-To: <01e0e0ffd6a796a73150588823cf3434aafa7c50.1537261084.git.gaetan.rivet@6wind.com>
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@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
next prev parent reply other threads:[~2018-09-21 15:41 UTC|newest]
Thread overview: 7+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-09-18 8:59 Gaetan Rivet
2018-09-18 11:09 ` Gaëtan Rivet
2018-09-21 15:41 ` Ferruh Yigit [this message]
2018-09-21 16:13 ` Gaëtan Rivet
2018-09-21 16:49 ` Ferruh Yigit
2018-10-05 21:58 ` [dpdk-dev] [PATCH v2] testpmd: sfp " Gaetan Rivet
2018-10-08 10:36 ` Iremonger, Bernard
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=582815f0-926e-8977-c8d1-3d4e1c5e2fd4@intel.com \
--to=ferruh.yigit@intel.com \
--cc=dev@dpdk.org \
--cc=gaetan.rivet@6wind.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).