X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fip_reassembly%2Fmain.c;h=550fb53becf3dce0abf99f72d6acf5b1d4fff4b6;hb=ce6b8c31548b4d71a986d9807cd06cf3a616d1ab;hp=e810e9f3f448f4daa4eb20b7d5a2cd97ce51f835;hpb=f430bbcecf3eed93916f45654f51dd19d6955aa2;p=dpdk.git diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c index e810e9f3f4..550fb53bec 100644 --- a/examples/ip_reassembly/main.c +++ b/examples/ip_reassembly/main.c @@ -420,7 +420,7 @@ reassemble(struct rte_mbuf *m, uint16_t portid, uint32_t queue, /* main processing loop */ static int -main_loop(__attribute__((unused)) void *dummy) +main_loop(__rte_unused void *dummy) { struct rte_mbuf *pkts_burst[MAX_PKT_BURST]; unsigned lcore_id; @@ -580,10 +580,7 @@ parse_portmask(const char *portmask) /* parse hexadecimal string */ pm = strtoul(portmask, &end, 16); if ((portmask[0] == '\0') || (end == NULL) || (*end != '\0')) - return -1; - - if (pm == 0) - return -1; + return 0; return pm; } @@ -711,6 +708,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); @@ -720,7 +718,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) @@ -728,7 +733,7 @@ check_all_ports_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")); + ("full-duplex") : ("half-duplex")); else printf("Port %d Link Down\n", portid); continue; @@ -1124,7 +1129,14 @@ main(int argc, char **argv) ret, portid); } - rte_eth_macaddr_get(portid, &ports_eth_addr[portid]); + ret = rte_eth_macaddr_get(portid, &ports_eth_addr[portid]); + if (ret < 0) { + printf("\n"); + rte_exit(EXIT_FAILURE, + "rte_eth_macaddr_get: err=%d, port=%d\n", + ret, portid); + } + print_ethaddr(" Address:", &ports_eth_addr[portid]); printf("\n");