summaryrefslogtreecommitdiff
path: root/examples/l3fwd
diff options
context:
space:
mode:
authorIgor Romanov <igor.romanov@oktetlabs.ru>2019-09-10 09:25:50 +0100
committerFerruh Yigit <ferruh.yigit@intel.com>2019-10-07 15:00:54 +0200
commit22e5c73bd181ddae758189295146154542b63360 (patch)
treec549007462855672702c8b3c6abc9ee3687b4f49 /examples/l3fwd
parent844949eceb8e58978d6ae41eb2345d280351bbf0 (diff)
downloaddpdk-22e5c73bd181ddae758189295146154542b63360.zip
dpdk-22e5c73bd181ddae758189295146154542b63360.tar.gz
dpdk-22e5c73bd181ddae758189295146154542b63360.tar.xz
examples: check status of getting link info
The return value of rte_eth_link_get() and rte_eth_link_get_nowait() 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@oktetlabs.ru> Signed-off-by: Andrew Rybchenko <arybchenko@solarflare.com>
Diffstat (limited to 'examples/l3fwd')
-rw-r--r--examples/l3fwd/main.c10
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 9ed495e..7253aca 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -718,6 +718,7 @@ check_all_ports_link_status(uint32_t port_mask)
uint16_t portid;
uint8_t count, all_ports_up, print_flag = 0;
struct rte_eth_link link;
+ int ret;
printf("\nChecking link status");
fflush(stdout);
@@ -731,7 +732,14 @@ check_all_ports_link_status(uint32_t port_mask)
if ((port_mask & (1 << portid)) == 0)
continue;
memset(&link, 0, sizeof(link));
- rte_eth_link_get_nowait(portid, &link);
+ ret = rte_eth_link_get_nowait(portid, &link);
+ if (ret < 0) {
+ all_ports_up = 0;
+ if (print_flag == 1)
+ printf("Port %u link get failed: %s\n",
+ portid, rte_strerror(-ret));
+ continue;
+ }
/* print link status if flag set */
if (print_flag == 1) {
if (link.link_status)