X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fdistributor%2Fmain.c;h=567c5e98919d0a998882ff7875aa334ecdd1d7e8;hb=ef2bf3dee265d6009cf71e476b3f04741df3cc12;hp=125ee877f3f59cdcc0f9a1c2b091654e1039f657;hpb=f430bbcecf3eed93916f45654f51dd19d6955aa2;p=dpdk.git diff --git a/examples/distributor/main.c b/examples/distributor/main.c index 125ee877f3..567c5e9891 100644 --- a/examples/distributor/main.c +++ b/examples/distributor/main.c @@ -173,12 +173,18 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) return retval; struct rte_eth_link link; - rte_eth_link_get_nowait(port, &link); - while (!link.link_status) { + do { + retval = rte_eth_link_get_nowait(port, &link); + if (retval < 0) { + printf("Failed link get (port %u): %s\n", + port, rte_strerror(-retval)); + return retval; + } else if (link.link_status) + break; + printf("Waiting for Link up on port %"PRIu16"\n", port); sleep(1); - rte_eth_link_get_nowait(port, &link); - } + } while (!link.link_status); if (!link.link_status) { printf("Link down on port %"PRIu16"\n", port); @@ -186,7 +192,13 @@ port_init(uint16_t port, struct rte_mempool *mbuf_pool) } struct rte_ether_addr addr; - rte_eth_macaddr_get(port, &addr); + retval = rte_eth_macaddr_get(port, &addr); + if (retval < 0) { + printf("Failed to get MAC address (port %u): %s\n", + port, rte_strerror(-retval)); + return retval; + } + printf("Port %u MAC: %02"PRIx8" %02"PRIx8" %02"PRIx8 " %02"PRIx8" %02"PRIx8" %02"PRIx8"\n", port,