event/dlb2: add v2.5 create LDB queue
[dpdk.git] / examples / flow_filtering / main.c
index cc9e7e7..f1940bc 100644 (file)
@@ -9,7 +9,6 @@
 #include <inttypes.h>
 #include <sys/types.h>
 #include <sys/queue.h>
-#include <netinet/in.h>
 #include <setjmp.h>
 #include <stdarg.h>
 #include <ctype.h>
@@ -52,7 +51,7 @@ print_ether_addr(const char *what, struct rte_ether_addr *eth_addr)
        printf("%s%s", what, buf);
 }
 
-static void
+static int
 main_loop(void)
 {
        struct rte_mbuf *mbufs[32];
@@ -61,6 +60,7 @@ main_loop(void)
        uint16_t nb_rx;
        uint16_t i;
        uint16_t j;
+       int ret;
 
        while (!force_quit) {
                for (i = 0; i < nr_queues; i++) {
@@ -88,8 +88,12 @@ main_loop(void)
 
        /* closing and releasing resources */
        rte_flow_flush(port_id, &error);
-       rte_eth_dev_stop(port_id);
+       ret = rte_eth_dev_stop(port_id);
+       if (ret < 0)
+               printf("Failed to stop port %u: %s",
+                      port_id, rte_strerror(-ret));
        rte_eth_dev_close(port_id);
+       return ret;
 }
 
 #define CHECK_INTERVAL 1000  /* 100ms */
@@ -254,7 +258,10 @@ main(int argc, char **argv)
                rte_exit(EXIT_FAILURE, "error in creating flow");
        }
 
-       main_loop();
+       ret = main_loop();
+
+       /* clean up the EAL */
+       rte_eal_cleanup();
 
-       return 0;
+       return ret;
 }