X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fip_fragmentation%2Fmain.c;h=104612339c9442992935262012daf04966b2bad5;hb=19b8d75f648021b2fc1e607311aea1c5e9063ff4;hp=70139ee4d2fe932234e62c4f0bf26a5aaba16185;hpb=f430bbcecf3eed93916f45654f51dd19d6955aa2;p=dpdk.git diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c index 70139ee4d2..104612339c 100644 --- a/examples/ip_fragmentation/main.c +++ b/examples/ip_fragmentation/main.c @@ -592,6 +592,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); @@ -601,7 +602,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) @@ -984,7 +992,14 @@ main(int argc, char **argv) ret, portid); } - rte_eth_macaddr_get(portid, &ports_eth_addr[portid]); + ret = rte_eth_macaddr_get(portid, &ports_eth_addr[portid]); + if (ret < 0) { + printf("\n"); + rte_exit(EXIT_FAILURE, + "rte_eth_macaddr_get: err=%d, port=%d\n", + ret, portid); + } + print_ethaddr(" Address:", &ports_eth_addr[portid]); printf("\n");