[dpdk-dev] [PATCH 03/51] app/eventdev: check status of getting ethdev info

Andrew Rybchenko arybchenko at solarflare.com
Tue Aug 27 16:25:14 CEST 2019


From: Ivan Ilchenko <Ivan.Ilchenko at 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/test-eventdev
according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko at oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
 app/test-eventdev/test_perf_common.c     | 8 +++++++-
 app/test-eventdev/test_pipeline_common.c | 9 ++++++++-
 2 files changed, 15 insertions(+), 2 deletions(-)

diff --git a/app/test-eventdev/test_perf_common.c b/app/test-eventdev/test_perf_common.c
index aa925a7..e75582b 100644
--- a/app/test-eventdev/test_perf_common.c
+++ b/app/test-eventdev/test_perf_common.c
@@ -660,6 +660,7 @@
 perf_ethdev_setup(struct evt_test *test, struct evt_options *opt)
 {
 	uint16_t i;
+	int ret;
 	struct test_perf *t = evt_test_priv(test);
 	struct rte_eth_conf port_conf = {
 		.rxmode = {
@@ -688,7 +689,12 @@
 		struct rte_eth_dev_info dev_info;
 		struct rte_eth_conf local_port_conf = port_conf;
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			evt_err("Error during getting device (port %u) info: %s\n",
+					i, strerror(-ret));
+			return ret;
+		}
 
 		local_port_conf.rx_adv_conf.rss_conf.rss_hf &=
 			dev_info.flow_type_rss_offloads;
diff --git a/app/test-eventdev/test_pipeline_common.c b/app/test-eventdev/test_pipeline_common.c
index 16c49b8..ef8ae28 100644
--- a/app/test-eventdev/test_pipeline_common.c
+++ b/app/test-eventdev/test_pipeline_common.c
@@ -159,6 +159,7 @@
 pipeline_ethdev_setup(struct evt_test *test, struct evt_options *opt)
 {
 	uint16_t i;
+	int ret;
 	uint8_t nb_queues = 1;
 	struct test_pipeline *t = evt_test_priv(test);
 	struct rte_eth_rxconf rx_conf;
@@ -191,7 +192,13 @@
 		if (!(caps & RTE_EVENT_ETH_TX_ADAPTER_CAP_INTERNAL_PORT))
 			t->internal_port = 0;
 
-		rte_eth_dev_info_get(i, &dev_info);
+		ret = rte_eth_dev_info_get(i, &dev_info);
+		if (ret != 0) {
+			evt_err("Error during getting device (port %u) info: %s\n",
+				i, strerror(-ret));
+			return ret;
+		}
+
 		rx_conf = dev_info.default_rxconf;
 		rx_conf.offloads = port_conf.rxmode.offloads;
 
-- 
1.8.3.1



More information about the dev mailing list