X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;ds=sidebyside;f=examples%2Fl2fwd%2Fmain.c;h=88ddfe5897ef6523c8466cc41cbb79726bfd076e;hb=ef853f1fd97937e6a873bcb47aa71c9ece46f140;hp=db070a18be16dd5b95281bd2e7fc39440deff5d7;hpb=f430bbcecf3eed93916f45654f51dd19d6955aa2;p=dpdk.git diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c index db070a18be..88ddfe5897 100644 --- a/examples/l2fwd/main.c +++ b/examples/l2fwd/main.c @@ -281,7 +281,7 @@ l2fwd_main_loop(void) } static int -l2fwd_launch_one_lcore(__attribute__((unused)) void *dummy) +l2fwd_launch_one_lcore(__rte_unused void *dummy) { l2fwd_main_loop(); return 0; @@ -449,6 +449,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); @@ -462,7 +463,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) @@ -657,7 +665,12 @@ main(int argc, char **argv) "Cannot adjust number of descriptors: err=%d, port=%u\n", ret, portid); - rte_eth_macaddr_get(portid,&l2fwd_ports_eth_addr[portid]); + ret = rte_eth_macaddr_get(portid, + &l2fwd_ports_eth_addr[portid]); + if (ret < 0) + rte_exit(EXIT_FAILURE, + "Cannot get MAC address: err=%d, port=%u\n", + ret, portid); /* init one RX queue */ fflush(stdout); @@ -700,6 +713,11 @@ main(int argc, char **argv) "Cannot set error callback for tx buffer on port %u\n", portid); + ret = rte_eth_dev_set_ptypes(portid, RTE_PTYPE_UNKNOWN, NULL, + 0); + if (ret < 0) + printf("Port %u, Failed to disable Ptype parsing\n", + portid); /* Start device */ ret = rte_eth_dev_start(portid); if (ret < 0)