[dpdk-dev] [PATCH 37/51] examples/link_status_interrupt: check dev info get result

Andrew Rybchenko arybchenko at solarflare.com
Tue Aug 27 16:25:48 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
examples/link_status_interrupt 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>
---
 examples/link_status_interrupt/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index 9cd4dc7..0c3dfc6 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -609,7 +609,13 @@ struct lsi_port_statistics {
 		/* init port */
 		printf("Initializing port %u... ", (unsigned) portid);
 		fflush(stdout);
-		rte_eth_dev_info_get(portid, &dev_info);
+
+		ret = rte_eth_dev_info_get(portid, &dev_info);
+		if (ret != 0)
+			rte_exit(EXIT_FAILURE,
+				"Error during getting device (port %u) info: %s\n",
+				portid, strerror(-ret));
+
 		if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 			local_port_conf.txmode.offloads |=
 				DEV_TX_OFFLOAD_MBUF_FAST_FREE;
-- 
1.8.3.1



More information about the dev mailing list