DPDK patches and discussions
 help / color / mirror / Atom feed
* [dpdk-dev] [PATCH v2] testpmd: added rte_eth_dev_fw_version_get in testpmd
@ 2020-03-18 15:22 Muhammad Ahmad
  2020-03-18 15:33 ` Ferruh Yigit
  2020-03-19  7:44 ` [dpdk-dev] [PATCH v3] " Muhammad Ahmad
  0 siblings, 2 replies; 6+ messages in thread
From: Muhammad Ahmad @ 2020-03-18 15:22 UTC (permalink / raw)
  To: wenzhuo.lu, jingjing.wu, bernard.iremonger, ferruh.yigit
  Cc: Muhammad Ahmad, dev

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 | 13 +++++++++++++
 1 file changed, 13 insertions(+)

diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index 8cf84ccd3..d0a59f6e7 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,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);
-- 
2.17.1


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v2] testpmd: added rte_eth_dev_fw_version_get in testpmd
  2020-03-18 15:22 [dpdk-dev] [PATCH v2] testpmd: added rte_eth_dev_fw_version_get in testpmd Muhammad Ahmad
@ 2020-03-18 15:33 ` Ferruh Yigit
  2020-03-19  7:44 ` [dpdk-dev] [PATCH v3] " Muhammad Ahmad
  1 sibling, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2020-03-18 15:33 UTC (permalink / raw)
  To: Muhammad Ahmad, wenzhuo.lu, jingjing.wu, bernard.iremonger; +Cc: dev

On 3/18/2020 3:22 PM, Muhammad Ahmad 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 | 13 +++++++++++++
>  1 file changed, 13 insertions(+)
> 
> diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
> index 8cf84ccd3..d0a59f6e7 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,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);


> +	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);
> 


^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v3] testpmd: added rte_eth_dev_fw_version_get in testpmd
  2020-03-18 15:22 [dpdk-dev] [PATCH v2] testpmd: added rte_eth_dev_fw_version_get in testpmd Muhammad Ahmad
  2020-03-18 15:33 ` Ferruh Yigit
@ 2020-03-19  7:44 ` Muhammad Ahmad
  2020-03-20  4:17   ` Kalesh Anakkur Purayil
  2020-03-20  6:46   ` [dpdk-dev] [PATCH v4] app/testpmd: add fw version in port info Muhammad Ahmad
  1 sibling, 2 replies; 6+ messages in thread
From: Muhammad Ahmad @ 2020-03-19  7:44 UTC (permalink / raw)
  To: wenzhuo.lu, jingjing.wu, bernard.iremonger, ferruh.yigit
  Cc: Muhammad Ahmad, dev

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 1482 bytes --]

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v3] testpmd: added rte_eth_dev_fw_version_get in testpmd
  2020-03-19  7:44 ` [dpdk-dev] [PATCH v3] " Muhammad Ahmad
@ 2020-03-20  4:17   ` Kalesh Anakkur Purayil
  2020-03-20  6:46   ` [dpdk-dev] [PATCH v4] app/testpmd: add fw version in port info Muhammad Ahmad
  1 sibling, 0 replies; 6+ messages in thread
From: Kalesh Anakkur Purayil @ 2020-03-20  4:17 UTC (permalink / raw)
  To: Muhammad Ahmad
  Cc: wenzhuo.lu, jingjing.wu, bernard.iremonger, ferruh.yigit, dev

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
>
>

-- 
Regards,
Kalesh A P

^ permalink raw reply	[flat|nested] 6+ messages in thread

* [dpdk-dev] [PATCH v4] app/testpmd: add fw version in port info
  2020-03-19  7:44 ` [dpdk-dev] [PATCH v3] " Muhammad Ahmad
  2020-03-20  4:17   ` Kalesh Anakkur Purayil
@ 2020-03-20  6:46   ` Muhammad Ahmad
  2020-03-20 10:35     ` Ferruh Yigit
  1 sibling, 1 reply; 6+ messages in thread
From: Muhammad Ahmad @ 2020-03-20  6:46 UTC (permalink / raw)
  To: wenzhuo.lu, jingjing.wu, bernard.iremonger, ferruh.yigit
  Cc: kalesh-anakkur.purayil, Muhammad Ahmad, dev

[-- Warning: decoded text below may be mangled, UTF-8 assumed --]
[-- Attachment #1: Type: text/plain; charset=y, Size: 1482 bytes --]

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


^ permalink raw reply	[flat|nested] 6+ messages in thread

* Re: [dpdk-dev] [PATCH v4] app/testpmd: add fw version in port info
  2020-03-20  6:46   ` [dpdk-dev] [PATCH v4] app/testpmd: add fw version in port info Muhammad Ahmad
@ 2020-03-20 10:35     ` Ferruh Yigit
  0 siblings, 0 replies; 6+ messages in thread
From: Ferruh Yigit @ 2020-03-20 10:35 UTC (permalink / raw)
  To: Muhammad Ahmad, wenzhuo.lu, jingjing.wu, bernard.iremonger
  Cc: kalesh-anakkur.purayil, dev

On 3/20/2020 6:46 AM, Muhammad Ahmad 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>

Reviewed-by: Ferruh Yigit <ferruh.yigit@intel.com>

Applied to dpdk-next-net/master, thanks.

^ permalink raw reply	[flat|nested] 6+ messages in thread

end of thread, other threads:[~2020-03-20 10:35 UTC | newest]

Thread overview: 6+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-03-18 15:22 [dpdk-dev] [PATCH v2] testpmd: added rte_eth_dev_fw_version_get in testpmd Muhammad Ahmad
2020-03-18 15:33 ` Ferruh Yigit
2020-03-19  7:44 ` [dpdk-dev] [PATCH v3] " Muhammad Ahmad
2020-03-20  4:17   ` Kalesh Anakkur Purayil
2020-03-20  6:46   ` [dpdk-dev] [PATCH v4] app/testpmd: add fw version in port info Muhammad Ahmad
2020-03-20 10:35     ` Ferruh Yigit

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).