X-Git-Url: http://git.droids-corp.org/?a=blobdiff_plain;f=examples%2Fqos_meter%2Fmain.c;h=e8112c83a2b0811f647ba2b1cf07480cb8f5f2d6;hb=refs%2Fheads%2Fmempool_20200116b;hp=ce1f63dc7abcbc676a55bf33ef8d4ffd0d183082;hpb=35b2d13fd6fdcbd191f2a30d74648faeb1186c65;p=dpdk.git diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c index ce1f63dc7a..e8112c83a2 100644 --- a/examples/qos_meter/main.c +++ b/examples/qos_meter/main.c @@ -156,7 +156,7 @@ app_pkt_handle(struct rte_mbuf *pkt, uint64_t time) &PROFILE, time, pkt_len, - (enum rte_meter_color) input_color); + (enum rte_color) input_color); /* Apply policing and set the output color */ action = policer_table[input_color][output_color]; @@ -329,7 +329,13 @@ main(int argc, char **argv) /* NIC init */ conf = port_conf; - rte_eth_dev_info_get(port_rx, &dev_info); + + ret = rte_eth_dev_info_get(port_rx, &dev_info); + if (ret != 0) + rte_exit(EXIT_FAILURE, + "Error during getting device (port %u) info: %s\n", + port_rx, strerror(-ret)); + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE; @@ -369,7 +375,13 @@ main(int argc, char **argv) rte_exit(EXIT_FAILURE, "Port %d TX queue setup error (%d)\n", port_rx, ret); conf = port_conf; - rte_eth_dev_info_get(port_tx, &dev_info); + + ret = rte_eth_dev_info_get(port_tx, &dev_info); + if (ret != 0) + rte_exit(EXIT_FAILURE, + "Error during getting device (port %u) info: %s\n", + port_tx, strerror(-ret)); + if (dev_info.tx_offload_capa & DEV_TX_OFFLOAD_MBUF_FAST_FREE) conf.txmode.offloads |= DEV_TX_OFFLOAD_MBUF_FAST_FREE; @@ -427,9 +439,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); - - rte_eth_promiscuous_enable(port_tx); + 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)); + + 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();