X-Git-Url: https://gerrit.fd.io/r/gitweb?a=blobdiff_plain;f=examples%2Fqos_meter%2Fmain.c;h=9ef55902ce3fd9cf32ae107a6dcc54c0c264bdff;hb=refs%2Fchanges%2F65%2F7065%2F1;hp=b968b0012e75ec4899a22aea037651be171dd348;hpb=5129044dce1f85ce4950f31bcf90f3886466f06a;p=deb_dpdk.git diff --git a/examples/qos_meter/main.c b/examples/qos_meter/main.c index b968b001..9ef55902 100644 --- a/examples/qos_meter/main.c +++ b/examples/qos_meter/main.c @@ -89,7 +89,7 @@ static struct rte_eth_conf port_conf = { .hw_ip_checksum = 1, .hw_vlan_filter = 0, .jumbo_frame = 0, - .hw_strip_crc = 0, + .hw_strip_crc = 1, }, .rx_adv_conf = { .rss_conf = { @@ -133,14 +133,20 @@ struct rte_meter_trtcm_params app_trtcm_params[] = { FLOW_METER app_flows[APP_FLOWS_MAX]; -static void +static int app_configure_flow_table(void) { uint32_t i, j; + int ret; - for (i = 0, j = 0; i < APP_FLOWS_MAX; i ++, j = (j + 1) % RTE_DIM(PARAMS)){ - FUNC_CONFIG(&app_flows[i], &PARAMS[j]); + for (i = 0, j = 0; i < APP_FLOWS_MAX; + i ++, j = (j + 1) % RTE_DIM(PARAMS)) { + ret = FUNC_CONFIG(&app_flows[i], &PARAMS[j]); + if (ret) + return ret; } + + return 0; } static inline void @@ -381,7 +387,9 @@ main(int argc, char **argv) rte_eth_promiscuous_enable(port_tx); /* App configuration */ - app_configure_flow_table(); + ret = app_configure_flow_table(); + if (ret < 0) + 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);