DPDK patches and discussions
 help / color / mirror / Atom feed
From: Muhammad Ahmad <muhammad.ahmad@emumba.com>
To: Ferruh Yigit <ferruh.yigit@intel.com>
Cc: wenzhuo.lu@intel.com, jingjing.wu@intel.com,
	bernard.iremonger@intel.com,
	 Muhammad Ahmad <muhammad.ahamd@emumba.com>,
	dev@dpdk.org
Subject: Re: [dpdk-dev] [PATCH] testpmd: added rte_eth_dev_fw_version_get in testpmd rte_eth_dev_fw_version_get() was not called in test pmd. Added rte_eth_dev_fw_version_get() in testpmd under show port info <port no>
Date: Tue, 17 Mar 2020 12:57:12 +0500	[thread overview]
Message-ID: <CAC9Mqu_aerOkHX+f98zQPpYYifYWTeR-LSXnVjaNSyf4m+J_mA@mail.gmail.com> (raw)
In-Reply-To: <4520447d-5ab0-c8fb-8251-7e86d86a6a44@intel.com>

Hi Ferruh,
Thank you for the comments.

On Mon, Mar 16, 2020 at 9:39 PM Ferruh Yigit <ferruh.yigit@intel.com> wrote:
>
> On 3/16/2020 10:07 AM, Muhammad Ahmad wrote:
> > From: Muhammad Ahmad <muhammad.ahamd@emumba.com>
> >
>
> Hi Muhammed,
>
> Can you please keep the patch title short, ~70 chars, and put the detail in the
> commit log?

Sure will do that.

>
> > Bugzilla ID: 225
> >
> > Cc: dev@dpdk.org
> > Reported-by: Thomas Monjalon <thomas@monjalon.net>
> > Signed-off-by: Muhammad Ahmad <muhammad.ahamd@emumba.com>
> > ---
> >  app/test-pmd/config.c  |  6 ++++++
> >  app/test-pmd/testpmd.h |  3 ++-
> >  app/test-pmd/util.c    | 14 ++++++++++++++
> >  3 files changed, 22 insertions(+), 1 deletion(-)
> >
> > diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> > index 8cf84ccd3..0abec7d47 100644
> > --- a/app/test-pmd/config.c
> > +++ b/app/test-pmd/config.c
> > @@ -52,6 +52,8 @@
> >
> >  #include "testpmd.h"
> >
> > +#define ETHTOOL_FWVERS_LEN 32> +
>
> Why "ETHTOOL" ?

I mistakenly wrote "ETHTOOL" instead of "ETHDEV". I will update it to "ETHDEV"

>
> >  static char *flowtype_to_str(uint16_t flow_type);
> >
> >  static const struct {
> > @@ -523,6 +525,7 @@ port_infos_display(portid_t port_id)
> >       uint16_t mtu;
> >       char name[RTE_ETH_NAME_MAX_LEN];
> >       int ret;
> > +     char   fw_version[ETHTOOL_FWVERS_LEN];
> >
> >       if (port_id_is_invalid(port_id, ENABLED_WARN)) {
> >               print_valid_ports();
> > @@ -544,6 +547,9 @@ port_infos_display(portid_t port_id)
> >       rte_eth_dev_get_name_by_port(port_id, name);
> >       printf("\nDevice name: %s", name);
> >       printf("\nDriver name: %s", dev_info.driver_name);
> > +     if (eth_dev_fw_version_get_err(port_id, fw_version,
> > +                                              ETHTOOL_FWVERS_LEN) == 0)
> > +             printf("\nfirmware-version: %s", fw_version);
>
> What do you think starting with uppercase, like "Firmware-version: ...", to be
> consistent.

Will do that.
>
> >       if (dev_info.device->devargs && dev_info.device->devargs->args)
> >               printf("\nDevargs: %s", dev_info.device->devargs->args);
> >       printf("\nConnect to socket: %u", port->socket_id);
> > diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
> > index 7a7c73f79..6b7842d3d 100644
> > --- a/app/test-pmd/testpmd.h
> > +++ b/app/test-pmd/testpmd.h
> > @@ -850,7 +850,8 @@ void eth_set_allmulticast_mode(uint16_t port, int enable);
> >  int eth_link_get_nowait_print_err(uint16_t port_id, struct rte_eth_link *link);
> >  int eth_macaddr_get_print_err(uint16_t port_id,
> >                       struct rte_ether_addr *mac_addr);
> > -
> > +int eth_dev_fw_version_get_err(uint16_t port_id,
> > +                      char *fw_version, size_t fw_size);
> >  /* Functions to display the set of MAC addresses added to a port*/
> >  void show_macs(portid_t port_id);
> >  void show_mcast_macs(portid_t port_id);
> > diff --git a/app/test-pmd/util.c b/app/test-pmd/util.c
> > index 8488fa1a8..2ac76f18e 100644
> > --- a/app/test-pmd/util.c
> > +++ b/app/test-pmd/util.c
> > @@ -375,3 +375,17 @@ eth_macaddr_get_print_err(uint16_t port_id, struct rte_ether_addr *mac_addr)
> >
> >       return ret;
> >  }
> > +
> > +int
> > +eth_dev_fw_version_get_err(uint16_t port_id, char *fw_version, size_t fw_size)
> > +{
> > +     int ret;
> > +
> > +     ret = rte_eth_dev_fw_version_get(port_id, fw_version, fw_size);
> > +     if (ret < 0)
> > +             printf("firmware version get error: (%s)\n", strerror(-ret));
>
> For the drivers doesn't support getting FW version, these errors are printed in
> the middle of the port info, so instead of this helper function, what do you
> think calling `rte_eth_dev_fw_version_get()` directly from `port_infos_display()`?

If I call the `rte_eth_dev_fw_version_get()` from
`port_infos_display()` It will still print the error at the same
place.
Do you want skip printing the error?
>
> > +     else if (ret > 0)
> > +             printf("Insufficient fw version buffer size, "
> > +                    "the minimum size should be %d\n", ret);
> > +     return ret;
> > +}
> >
>

      reply	other threads:[~2020-03-17  7:57 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2020-03-16 10:07 Muhammad Ahmad
2020-03-16 16:39 ` Ferruh Yigit
2020-03-17  7:57   ` Muhammad Ahmad [this message]

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=CAC9Mqu_aerOkHX+f98zQPpYYifYWTeR-LSXnVjaNSyf4m+J_mA@mail.gmail.com \
    --to=muhammad.ahmad@emumba.com \
    --cc=bernard.iremonger@intel.com \
    --cc=dev@dpdk.org \
    --cc=ferruh.yigit@intel.com \
    --cc=jingjing.wu@intel.com \
    --cc=muhammad.ahamd@emumba.com \
    --cc=wenzhuo.lu@intel.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).