Imported Upstream version 16.11.2
[deb_dpdk.git] / examples / qos_meter / main.c
index b968b00..9ef5590 100644 (file)
@@ -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);