[v3,20/54] examples/qos_meter: check status of getting ethdev info

Message ID 1567755066-31389-21-git-send-email-arybchenko@solarflare.com
State Superseded
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/Intel-compilation fail Compilation issues
ci/checkpatch success coding style OK

Commit Message

Andrew Rybchenko Sept. 6, 2019, 7:30 a.m.
From: Ivan Ilchenko <Ivan.Ilchenko@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/qos_meter according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/qos_meter/main.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

Patch

diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c
index da7afe8be2..13c85e9406 100644
--- a/examples/qos_meter/main.c
+++ b/examples/qos_meter/main.c
@@ -329,7 +329,13 @@  main(int argc, char **argv)
 
 	/* NIC init */
 	conf = port_conf;
-	rte_eth_dev_info_get(port_rx, &dev_info);
+
+	ret = rte_eth_dev_info_get(port_rx, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			port_rx, strerror(-ret));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;
 
@@ -369,7 +375,13 @@  main(int argc, char **argv)
 	rte_exit(EXIT_FAILURE, "Port %d TX queue setup error (%d)\n", port_rx, ret);
 
 	conf = port_conf;
-	rte_eth_dev_info_get(port_tx, &dev_info);
+
+	ret = rte_eth_dev_info_get(port_tx, &dev_info);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE,
+			"Error during getting device (port %u) info: %s\n",
+			port_tx, strerror(-ret));
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE;