diff options
author | Igor Romanov <igor.romanov@oktetlabs.ru> | 2019-09-10 09:25:50 +0100 |
---|---|---|
committer | Ferruh Yigit <ferruh.yigit@intel.com> | 2019-10-07 15:00:54 +0200 |
commit | 22e5c73bd181ddae758189295146154542b63360 (patch) | |
tree | c549007462855672702c8b3c6abc9ee3687b4f49 /examples/ipv4_multicast | |
parent | 844949eceb8e58978d6ae41eb2345d280351bbf0 (diff) | |
download | dpdk-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/ipv4_multicast')
-rw-r--r-- | examples/ipv4_multicast/main.c | 10 |
1 files changed, 9 insertions, 1 deletions
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c index 1ee3b61..7389bee 100644 --- a/examples/ipv4_multicast/main.c +++ b/examples/ipv4_multicast/main.c @@ -575,6 +575,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); @@ -584,7 +585,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) |