testpmd: added rte_eth_dev_fw_version_get in testpmd
PATCH v2 1/1 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>
Bugzilla ID: 225
--- app/test-pmd/config.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)
app/test-pmd/config.c +13 -0
@@ -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,16 @@ 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); + + ret =rte_eth_dev_fw_version_get (port_id, fw_version,ETHDEV_FWVERS_LEN ); +if (ret <0 ) +printf ("\nFirmware version get error: (%s)" ,strerror (-ret)); +else if (ret >0 ) +printf ("\nInsufficient fw version buffer size, " +"the minimum size should be %d" , ret); +else +printf ("\nFirmware-version: %s" , fw_version); +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);
Signature · 1 line
2.17.1
Quoted 34 lines · Muhammad Ahmad
rte_eth_dev_fw_version_get()was not called in test pmd
Addedrte_eth_dev_fw_version_get()in testpmd under show port info <port no>Bugzilla ID: 225
Reported-by Thomas Monjalon <[email protected]>Signed-off-by Muhammad Ahmad <[email protected]>--- app/test-pmd/config.c | 13 +++++++++++++ 1 file changed, 13 insertions(+)app/test-pmd/config.c +3
-0@@ -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 ();
app/test-pmd/config.c port_infos_display(portid_t port_id) · line 556
Quoted 10 lines
app/test-pmd/config.c +7
-0@@ -544,6 +547,16 @@ 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); + + ret =rte_eth_dev_fw_version_get (port_id, fw_version,ETHDEV_FWVERS_LEN ); +if (ret <0 ) +printf ("\nFirmware version get error: (%s)" ,strerror (-ret)); +else if (ret >0 ) +printf ("\nInsufficient fw version buffer size, " +"the minimum size should be %d" , ret);
Still same thing with these messages, they will print error logs in the middle of the port info, in this context I believe the details of the errors doesn't matter really.
What do you think:
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 availble");Or even ignore the firmaware version completely if not supported:
if (rte_eth_dev_fw_version_get(port_id, fw_version, ETHDEV_FWVERS_LEN) == 0)
printf("\nFirmware-version: %s", fw_version);Quoted 7 lines
app/test-pmd/config.c +3
-0+else +printf ("\nFirmware-version: %s" , fw_version); +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);
PATCH v3 1/1 testpmd: added rte_eth_dev_fw_version_get in testpmd
In reply to Muhammad Ahmadrte_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
--- app/test-pmd/config.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
app/test-pmd/config.c +10 -0
@@ -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);
Signature · 1 line
2.17.1
Hi Muhammad,
Could you update the commit title as:
"app/testpmd: add fw version in port info"
Regards,
Kalesh
Quoted 53 lines · Muhammad Ahmad
rte_eth_dev_fw_version_get()was not called in test pmd.
Addedrte_eth_dev_fw_version_get()in testpmd under
show port info <port no>Bugzilla ID: 225
Reported-by Thomas Monjalon <[email protected]>Signed-off-by Muhammad Ahmad <[email protected]>--- app/test-pmd/config.c | 10 ++++++++++ 1 file changed, 10 insertions(+)app/test-pmd/config.c +10
-1@@ -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
Signature · 2 lines
Regards, Kalesh A P
PATCH v4 1/1 app/testpmd: add fw version in port info
In reply to Muhammad Ahmadrte_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
--- app/test-pmd/config.c | 10 ++++++++++ 1 file changed, 10 insertions(+)
app/test-pmd/config.c +10 -0
@@ -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);
Signature · 1 line
2.17.1
Re: [dpdk-dev] [PATCH v4] app/testpmd: add fw version in port info
Quoted 10 lines · Muhammad Ahmad
rte_eth_dev_fw_version_get()was not called in test pmd. Addedrte_eth_dev_fw_version_get()in testpmd under show port info <port no>Bugzilla ID: 225
Reported-by Thomas Monjalon <[email protected]>Signed-off-by Muhammad Ahmad <[email protected]>
Applied to dpdk-next-net/master, thanks.