X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fexception_path%2Fmain.c;h=85dbd7ec745255f6b7b8e469091777a372ad6f7e;hb=ef2bf3dee265d6009cf71e476b3f04741df3cc12;hp=d7f3598afbddb3642d5093e7a03b1d23b4668f58;hpb=089e5ed727a15da2729cfee9b63533dd120bd04c;p=dpdk.git diff --git a/examples/exception_path/main.c b/examples/exception_path/main.c index d7f3598afb..85dbd7ec74 100644 --- a/examples/exception_path/main.c +++ b/examples/exception_path/main.c @@ -473,7 +473,10 @@ init_port(uint16_t port) if (ret < 0) FATAL_ERROR("Could not start port%u (%d)", port, ret); - rte_eth_promiscuous_enable(port); + ret = rte_eth_promiscuous_enable(port); + if (ret != 0) + FATAL_ERROR("Could not enable promiscuous mode for port%u (%s)", + port, rte_strerror(-ret)); } /* Check the link status of all ports in up to 9s, and print them finally */ @@ -485,6 +488,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); @@ -494,7 +498,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)