[dpdk-dev] [PATCH v2 23/54] examples/vmdq: check status of getting ethdev info

Andrew Rybchenko arybchenko at solarflare.com
Tue Sep 3 15:56:57 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
examples/vmdq 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>
---
 examples/vmdq/main.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 7281ffd..91f9a99 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -169,7 +169,13 @@
 	 * The max pool number from dev_info will be used to validate the pool
 	 * number specified in cmd line
 	 */
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	max_nb_pools = (uint32_t)dev_info.max_vmdq_pools;
 	/*
 	 * We allow to process part of VMDQ pools specified by num_pools in
@@ -214,7 +220,13 @@
 	rxRings = (uint16_t)dev_info.max_rx_queues;
 	txRings = (uint16_t)dev_info.max_tx_queues;
 
-	rte_eth_dev_info_get(port, &dev_info);
+	retval = rte_eth_dev_info_get(port, &dev_info);
+	if (retval != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port, strerror(-retval));
+		return retval;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1



More information about the dev mailing list