remove unused ring includes
[dpdk.git] / examples / bond / main.c
index e4457f2..6402c6b 100644 (file)
@@ -33,6 +33,7 @@
 
 #include <stdint.h>
 #include <sys/queue.h>
+#include <sys/socket.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
@@ -51,7 +52,6 @@
 #include <rte_memory.h>
 #include <rte_memcpy.h>
 #include <rte_memzone.h>
-#include <rte_tailq.h>
 #include <rte_eal.h>
 #include <rte_per_lcore.h>
 #include <rte_launch.h>
@@ -67,7 +67,6 @@
 #include <rte_debug.h>
 #include <rte_ether.h>
 #include <rte_ethdev.h>
-#include <rte_ring.h>
 #include <rte_log.h>
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
@@ -97,7 +96,6 @@
 
 #define RTE_LOGTYPE_DCB RTE_LOGTYPE_USER1
 
-#define MBUF_SIZE (2048 + sizeof(struct rte_mbuf) + RTE_PKTMBUF_HEADROOM)
 #define NB_MBUF   (1024*8)
 
 #define MAX_PKT_BURST 32
@@ -591,10 +589,14 @@ static void cmd_stop_parsed(__attribute__((unused)) void *parsed_result,
                return;
        }
        global_flag_stru_p->LcoreMainIsRunning = 0;
-       rte_eal_wait_lcore(global_flag_stru_p->LcoreMainCore);
-       cmdline_printf(cl,
-                       "lcore_main stopped on core:%d\n",
-                       global_flag_stru_p->LcoreMainCore);
+       if (rte_eal_wait_lcore(global_flag_stru_p->LcoreMainCore) < 0)
+               cmdline_printf(cl,
+                               "error: lcore_main can not stop on core:%d\n",
+                               global_flag_stru_p->LcoreMainCore);
+       else
+               cmdline_printf(cl,
+                               "lcore_main stopped on core:%d\n",
+                               global_flag_stru_p->LcoreMainCore);
        rte_spinlock_unlock(&global_flag_stru_p->lock);
 }
 
@@ -629,10 +631,14 @@ static void cmd_quit_parsed(__attribute__((unused)) void *parsed_result,
                return;
        }
        global_flag_stru_p->LcoreMainIsRunning = 0;
-       rte_eal_wait_lcore(global_flag_stru_p->LcoreMainCore);
-       cmdline_printf(cl,
-                       "lcore_main stopped on core:%d\n",
-                       global_flag_stru_p->LcoreMainCore);
+       if (rte_eal_wait_lcore(global_flag_stru_p->LcoreMainCore) < 0)
+               cmdline_printf(cl,
+                               "error: lcore_main can not stop on core:%d\n",
+                               global_flag_stru_p->LcoreMainCore);
+       else
+               cmdline_printf(cl,
+                               "lcore_main stopped on core:%d\n",
+                               global_flag_stru_p->LcoreMainCore);
        rte_spinlock_unlock(&global_flag_stru_p->lock);
        cmdline_quit(cl);
 }
@@ -650,7 +656,6 @@ cmdline_parse_inst_t cmd_quit = {
        },
 };
 
-extern void print_client_stats(void);
 struct cmd_show_result {
        cmdline_fixed_string_t show;
 };
@@ -680,10 +685,6 @@ static void cmd_show_parsed(__attribute__((unused)) void *parsed_result,
                        global_flag_stru_p->port_packets[1],
                        global_flag_stru_p->port_packets[2]);
        rte_spinlock_unlock(&global_flag_stru_p->lock);
-
-#if defined(RTE_LIBRTE_BOND_DEBUG_ALB_L1) || defined(RTE_LIBRTE_BOND_DEBUG_ALB)
-       print_client_stats();
-#endif
 }
 
 cmdline_parse_token_string_t cmd_show_show =
@@ -712,7 +713,7 @@ cmdline_parse_ctx_t main_ctx[] = {
 };
 
 /* prompt function, called from main on MASTER lcore */
-static void *prompt(__attribute__((unused)) void *arg1)
+static void prompt(__attribute__((unused)) void *arg1)
 {
        struct cmdline *cl;
 
@@ -744,12 +745,8 @@ main(int argc, char *argv[])
        else if (nb_ports > MAX_PORTS)
                rte_exit(EXIT_FAILURE, "You can have max 4 ports\n");
 
-       mbuf_pool = rte_mempool_create("MBUF_POOL", NB_MBUF,
-                                      MBUF_SIZE, 32,
-                                      sizeof(struct rte_pktmbuf_pool_private),
-                                      rte_pktmbuf_pool_init, NULL,
-                                      rte_pktmbuf_init, NULL,
-                                      rte_socket_id(), 0);
+       mbuf_pool = rte_pktmbuf_pool_create("MBUF_POOL", NB_MBUF, 32,
+               0, RTE_MBUF_DEFAULT_BUF_SIZE, rte_socket_id());
        if (mbuf_pool == NULL)
                rte_exit(EXIT_FAILURE, "Cannot create mbuf pool\n");