[v3] testpmd: added rte_eth_dev_fw_version_get in testpmd

Message ID 20200319074400.14139-1-muhammad.ahmad@emumba.com (mailing list archive)
State Superseded, archived
Delegated to: Ferruh Yigit
Headers
Series [v3] testpmd: added rte_eth_dev_fw_version_get in testpmd |

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/iol-mellanox-Performance success Performance Testing PASS
ci/iol-testing success Testing PASS
ci/travis-robot success Travis build: passed
ci/Intel-compilation success Compilation OK

Commit Message

Muhammad Ahmad March 19, 2020, 7:44 a.m. UTC
  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>

Bugzilla ID: 225

Cc: dev@dpdk.org

Reported-by: Thomas Monjalon <thomas@monjalon.net>
Signed-off-by: Muhammad Ahmad <muhammad.ahmad@emumba.com>
---
 app/test-pmd/config.c | 10 ++++++++++
 1 file changed, 10 insertions(+)
  

Comments

Kalesh A P March 20, 2020, 4:17 a.m. UTC | #1
Hi Muhammad,

Could you update the commit title as:

"app/testpmd: add fw version in port info"

Regards,
Kalesh

On Thu, Mar 19, 2020 at 1:16 PM Muhammad Ahmad <muhammad.ahmad@emumba.com>
wrote:

> 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>
>
> Bugzilla ID: 225
>
> Cc: dev@dpdk.org
>
> Reported-by: Thomas Monjalon <thomas@monjalon.net>
> Signed-off-by: Muhammad Ahmad <muhammad.ahmad@emumba.com>
> ---
>  app/test-pmd/config.c | 10 ++++++++++
>  1 file changed, 10 insertions(+)
>
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 8cf84ccd3..66f3de908 100644
> --- a/app/test-pmd/config.c
> +++ b/app/test-pmd/config.c
> @@ -52,6 +52,8 @@
>
>  #include "testpmd.h"
>
> +#define ETHDEV_FWVERS_LEN 32
> +
>  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[ETHDEV_FWVERS_LEN];
>
>         if (port_id_is_invalid(port_id, ENABLED_WARN)) {
>                 print_valid_ports();
> @@ -544,6 +547,13 @@ 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 (rte_eth_dev_fw_version_get(port_id, fw_version,
> +                                               ETHDEV_FWVERS_LEN) == 0)
> +               printf("\nFirmware-version: %s", fw_version);
> +       else
> +               printf("\nFirmware-version: %s", "not available");
> +
>         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);
> --
> 2.17.1
>
>
  

Patch

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8cf84ccd3..66f3de908 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -52,6 +52,8 @@ 
 
 #include "testpmd.h"
 
+#define ETHDEV_FWVERS_LEN 32
+
 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[ETHDEV_FWVERS_LEN];
 
 	if (port_id_is_invalid(port_id, ENABLED_WARN)) {
 		print_valid_ports();
@@ -544,6 +547,13 @@  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 (rte_eth_dev_fw_version_get(port_id, fw_version,
+						ETHDEV_FWVERS_LEN) == 0)
+		printf("\nFirmware-version: %s", fw_version);
+	else
+		printf("\nFirmware-version: %s", "not available");
+
 	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);