[dpdk-dev] [PATCH v4 09/54] app/procinfo: check status of getting ethdev info
Andrew Rybchenko
arybchenko at solarflare.com
Thu Sep 12 18:42:20 CEST 2019
From: Ivan Ilchenko <Ivan.Ilchenko at oktetlabs.com>
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 at oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
app/proc-info/main.c | 15 +++++++++++++--
1 file changed, 13 insertions(+), 2 deletions(-)
diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index a89b51bb3..34eb7a7cc 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -683,7 +683,12 @@ show_port(void)
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 @@ show_tm(void)
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"
--
2.17.1
More information about the dev
mailing list