X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fqos_meter%2Fmain.c;h=f2d9c28828ab014310946c8c64565936d476f9ed;hb=c13ca4e81cac591904c893a65ffbbf446af0268a;hp=13c85e9406240942e551ba34bc358d8debb74539;hpb=089e5ed727a15da2729cfee9b63533dd120bd04c;p=dpdk.git diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c index 13c85e9406..f2d9c28828 100644 --- a/examples/qos_meter/main.c +++ b/examples/qos_meter/main.c @@ -166,8 +166,8 @@ app_pkt_handle(struct rte_mbuf *pkt, uint64_t time) } -static __attribute__((noreturn)) int -main_loop(__attribute__((unused)) void *dummy) +static __rte_noreturn int +main_loop(__rte_unused void *dummy) { uint64_t current_time, last_time = rte_rdtsc(); uint32_t lcore_id = rte_lcore_id(); @@ -220,10 +220,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; } @@ -439,9 +436,17 @@ main(int argc, char **argv) if (ret < 0) rte_exit(EXIT_FAILURE, "Port %d start error (%d)\n", port_tx, ret); - rte_eth_promiscuous_enable(port_rx); + ret = rte_eth_promiscuous_enable(port_rx); + if (ret != 0) + rte_exit(EXIT_FAILURE, + "Port %d promiscuous mode enable error (%s)\n", + port_rx, rte_strerror(-ret)); - rte_eth_promiscuous_enable(port_tx); + ret = rte_eth_promiscuous_enable(port_tx); + if (ret != 0) + rte_exit(EXIT_FAILURE, + "Port %d promiscuous mode enable error (%s)\n", + port_rx, rte_strerror(-ret)); /* App configuration */ ret = app_configure_flow_table(); @@ -449,8 +454,8 @@ main(int argc, char **argv) rte_exit(EXIT_FAILURE, "Invalid configure flow table\n"); /* Launch per-lcore init on every lcore */ - rte_eal_mp_remote_launch(main_loop, NULL, CALL_MASTER); - RTE_LCORE_FOREACH_SLAVE(lcore_id) { + rte_eal_mp_remote_launch(main_loop, NULL, CALL_MAIN); + RTE_LCORE_FOREACH_WORKER(lcore_id) { if (rte_eal_wait_lcore(lcore_id) < 0) return -1; }