[v3,44/54] examples/packet_ordering: check dev info get result

Message ID 1567755066-31389-45-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/packet_ordering according to its new return type.

Signed-off-by: Ivan Ilchenko <Ivan.Ilchenko@oktetlabs.com>
Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
---
 examples/packet_ordering/main.c | 8 +++++++-
 1 file changed, 7 insertions(+), 1 deletion(-)

Patch

diff --git a/examples/packet_ordering/main.c b/examples/packet_ordering/main.c
index 030e922996..a99961f821 100644
--- a/examples/packet_ordering/main.c
+++ b/examples/packet_ordering/main.c
@@ -283,7 +283,13 @@  configure_eth_port(uint16_t port_id)
 	if (!rte_eth_dev_is_valid_port(port_id))
 		return -1;
 
-	rte_eth_dev_info_get(port_id, &dev_info);
+	ret = rte_eth_dev_info_get(port_id, &dev_info);
+	if (ret != 0) {
+		printf("Error during getting device (port %u) info: %s\n",
+				port_id, strerror(-ret));
+		return ret;
+	}
+
 	if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE)
 		port_conf.txmode.offloads |=
 			DEV_TX_OFFLOAD_MBUF_FAST_FREE;