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);
}
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,