[dpdk-dev] [PATCH 3/7] app/pdump: check status of getting MAC address

Andrew Rybchenko arybchenko at solarflare.com
Tue Sep 10 10:52:17 CEST 2019


From: Igor Romanov <igor.romanov at oktetlabs.ru>

The return value of rte_eth_macaddr_get()
was changed from void to int. Update the usage of the functions
according to the new return type.

Signed-off-by: Igor Romanov <igor.romanov at oktetlabs.ru>
Signed-off-by: Andrew Rybchenko <arybchenko at solarflare.com>
---
 app/pdump/main.c | 5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/app/pdump/main.c b/app/pdump/main.c
index 9d6be8ed1..903d02f48 100644
--- a/app/pdump/main.c
+++ b/app/pdump/main.c
@@ -606,7 +606,10 @@ configure_vdev(uint16_t port_id)
 	if (ret < 0)
 		rte_exit(EXIT_FAILURE, "dev start failed\n");
 
-	rte_eth_macaddr_get(port_id, &addr);
+	ret = rte_eth_macaddr_get(port_id, &addr);
+	if (ret != 0)
+		rte_exit(EXIT_FAILURE, "macaddr get failed\n");
+
 	printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8
 			" %02"PRIx8" %02"PRIx8" %02"PRIx8"\n",
 			port_id,
-- 
2.17.1



More information about the dev mailing list