[dpdk-dev] [PATCH v2 42/54] examples/server_node_efd: check dev info get result

Andrew Rybchenko arybchenko at solarflare.com
Tue Sep 3 15:57:16 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/server_node_efd 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/server_node_efd/server/init.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/examples/server_node_efd/server/init.c b/examples/server_node_efd/server/init.c
index af5a18e..773780b 100644
--- a/examples/server_node_efd/server/init.c
+++ b/examples/server_node_efd/server/init.c
@@ -111,7 +111,10 @@
 	printf("Port %u init ... ", port_num);
 	fflush(stdout);
 
-	rte_eth_dev_info_get(port_num, &dev_info);
+	retval = rte_eth_dev_info_get(port_num, &dev_info);
+	if (retval != 0)
+		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