From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 71D56A0559; Tue, 17 Mar 2020 08:57:52 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 4AE131BF30; Tue, 17 Mar 2020 08:57:51 +0100 (CET) Received: from mail-oi1-f194.google.com (mail-oi1-f194.google.com [209.85.167.194]) by dpdk.org (Postfix) with ESMTP id 323A0292D for ; Tue, 17 Mar 2020 08:57:49 +0100 (CET) Received: by mail-oi1-f194.google.com with SMTP id 13so11828463oiy.9 for ; Tue, 17 Mar 2020 00:57:49 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=emumba-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=pYKAfFgT2I96ISYeKy5niWvgGuUfFuOlpeeQc3BnWIo=; b=iJvw4eq0Y3fOvDtLdVLJGHQ/FQ00+JIEVLrx2joUnmDUn6sYoDrtbxWgap8UGbk/To Tu3rsdFJieuLJw+q2qyGJyU5hzsnqBpG8XtR/xfFpycso5d5qbk0/FeU4dJcOA/3St0v E355qBIyswwIRe5RTzSZMzcDQDNY7zk9K8szJNxe8vSBhXDX6xKDdfaKe6NPI3Nfwy6z PpiPGEaNWkSXwGlWSl1Bvj8rE9KH2IyFGs8HWqtkgIFgGIsLMNxnN79lttjALRVHQBxl gw0fKtlmD2mDpVzWvhKZf7/3I/kH0MTH7UOIQMttTT6KmijUvpBjq+Xs3FmEn4Qyo8Q0 jsSQ== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=pYKAfFgT2I96ISYeKy5niWvgGuUfFuOlpeeQc3BnWIo=; b=NbEfcBOxP94pACTFsTs8cSvSzs2mnC4LDcTLy5uEu+TUFBOoEWjD0hf6YPmNt1lERk Axugg9nS2vNDEdIvMyqk9QKKPChX4noKfhOucV4ZqfgCaFHoi3Boj9+qlSTynXU7+Z7X xjvxOyyFG9jXUyI6CR8nhCjiTRFuAM1XllfXSfd74RHi5uZsg+pKSbIDDkqr8heue3vn JX3cBL7bcgxt6N2cQX3IGoUs0paW+mR2QRJnUJsEAFnkY4iIZqi9S7a5xr0cLs2rIU3O PTsux5bEvsQL5gOhDxfi4zsX0GHCPQux4rwT3Loy4/PV8XOco4F3nRKpyV91ZYiJ0Q/G VGJQ== X-Gm-Message-State: ANhLgQ1vh3hQlCvBbayqvj39viIHDFNRPON92H5A92zF/nL6weITL/10 cEx9UVkU6ZQyXWhsDgunU3cbM8DYRPTugVQKUOzCoA== X-Google-Smtp-Source: ADFU+vt3MAW6gr7W9oy+VQ0cW3V0lAtCqRDHoPhVWDQY1v5slueWLg67WchTMHNwgaIjgDyU0OwJn6LQbvTY7Jr/eqo= X-Received: by 2002:aca:cf48:: with SMTP id f69mr2402399oig.122.1584431868380; Tue, 17 Mar 2020 00:57:48 -0700 (PDT) MIME-Version: 1.0 References: <20200316100754.13447-1-muhammad.ahmad@emumba.com> <4520447d-5ab0-c8fb-8251-7e86d86a6a44@intel.com> In-Reply-To: <4520447d-5ab0-c8fb-8251-7e86d86a6a44@intel.com> From: Muhammad Ahmad Date: Tue, 17 Mar 2020 12:57:12 +0500 Message-ID: To: Ferruh Yigit Cc: wenzhuo.lu@intel.com, jingjing.wu@intel.com, bernard.iremonger@intel.com, Muhammad Ahmad , dev@dpdk.org Content-Type: text/plain; charset="UTF-8" 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 X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Hi Ferruh, Thank you for the comments. On Mon, Mar 16, 2020 at 9:39 PM Ferruh Yigit wrote: > > On 3/16/2020 10:07 AM, Muhammad Ahmad wrote: > > From: Muhammad Ahmad > > > > 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 > > Signed-off-by: Muhammad Ahmad > > --- > > 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; > > +} > > >