[08/51] app/procinfo: check status of getting ethdev info
diff mbox series

Message ID 1566915962-5472-9-git-send-email-arybchenko@solarflare.com
State Superseded, archived
Delegated to: Ferruh Yigit
Headers show
Series
  • ethdev: change rte_eth_dev_info_get() return value to int
Related show

Checks

Context Check Description
ci/checkpatch success coding style OK
ci/Intel-compilation success Compilation OK

Commit Message

Andrew Rybchenko Aug. 27, 2019, 2:25 p.m. UTC
From: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>

rte_eth_dev_info_get() return value was changed from void to int, so
this patch modify rte_eth_dev_info_get() usage across app/procinfo
according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 app/proc-info/main.c | 15 +++++++++++++--
 1 file changed, 13 insertions(+), 2 deletions(-)

Patch
diff mbox series

diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index a89b51b..34eb7a7 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -683,7 +683,12 @@  static void collectd_resolve_cnt_type(char *cnt_type, size_t cnt_type_len,
 		if (ret == 0)
 			printf("\t  -- mtu (%d)\n", mtu);
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			printf("Error during getting device (port %u) info: %s\n",
+				i, strerror(-ret));
+			return;
+		}
 
 		printf("  - queue\n");
 		for (j = 0; j < dev_info.nb_rx_queues; j++) {
@@ -836,7 +841,13 @@  static void collectd_resolve_cnt_type(char *cnt_type, size_t cnt_type_len,
 		memset(&cap, 0, sizeof(cap));
 		memset(&error, 0, sizeof(error));
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			printf("Error during getting device (port %u) info: %s\n",
+				i, strerror(-ret));
+			return;
+		}
+
 		printf("  - Generic for port (%u)\n"
 			"\t  -- driver name %s\n"
 			"\t  -- max vf (%u)\n"