X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fioat%2Fioatfwd.c;h=53de231795f7cbe6141f168364df28938a706b75;hb=13f5e4562a3fc46af5081ef4df3963f08989120c;hp=b39a098ec0e89c02fa0750003df116b5ac3126b9;hpb=4c2af82e542c51175781aebf8f1a9ccfef823a11;p=dpdk.git diff --git a/examples/ioat/ioatfwd.c b/examples/ioat/ioatfwd.c index b39a098ec0..53de231795 100644 --- a/examples/ioat/ioatfwd.c +++ b/examples/ioat/ioatfwd.c @@ -460,7 +460,7 @@ ioat_tx_port(struct rxtx_port_config *tx_config) MAX_PKT_BURST, NULL); } - if (nb_dq <= 0) + if ((int32_t) nb_dq <= 0) return; if (copy_mode == COPY_MODE_IOAT_NUM) @@ -697,7 +697,7 @@ check_link_status(uint32_t port_mask) { uint16_t portid; struct rte_eth_link link; - int retval = 0; + int ret, link_status = 0; printf("\nChecking link status\n"); RTE_ETH_FOREACH_DEV(portid) { @@ -705,7 +705,12 @@ check_link_status(uint32_t port_mask) continue; memset(&link, 0, sizeof(link)); - rte_eth_link_get(portid, &link); + ret = rte_eth_link_get(portid, &link); + if (ret < 0) { + printf("Port %u link get failed: err=%d\n", + portid, ret); + continue; + } /* Print link status */ if (link.link_status) { @@ -713,12 +718,12 @@ check_link_status(uint32_t port_mask) "Port %d Link Up. Speed %u Mbps - %s\n", portid, link.link_speed, (link.link_duplex == ETH_LINK_FULL_DUPLEX) ? - ("full-duplex") : ("half-duplex\n")); - retval = 1; + ("full-duplex") : ("half-duplex")); + link_status = 1; } else printf("Port %d Link Down\n", portid); } - return retval; + return link_status; } static void