examples: add eal cleanup to examples
[dpdk.git] / examples / pipeline / main.c
index 3573a77..8ea19f9 100644 (file)
@@ -11,6 +11,7 @@
 #include <rte_launch.h>
 #include <rte_eal.h>
 
+#include "cli.h"
 #include "conn.h"
 #include "obj.h"
 #include "thread.h"
@@ -30,7 +31,7 @@ static struct app_params {
                .buf_size = 1024 * 1024,
                .msg_in_len_max = 1024,
                .msg_out_len_max = 1024 * 1024,
-               .msg_handle = NULL,
+               .msg_handle = cli_process,
                .msg_handle_arg = NULL, /* set later. */
        },
        .script_name = NULL,
@@ -165,7 +166,14 @@ main(int argc, char **argv)
        rte_eal_mp_remote_launch(
                thread_main,
                NULL,
-               SKIP_MASTER);
+               SKIP_MAIN);
+
+       /* Script */
+       if (app.script_name)
+               cli_script_process(app.script_name,
+                       app.conn.msg_in_len_max,
+                       app.conn.msg_out_len_max,
+                       obj);
 
        /* Connectivity */
        app.conn.msg_handle_arg = obj;
@@ -182,4 +190,7 @@ main(int argc, char **argv)
 
                conn_poll_for_msg(conn);
        }
+
+       /* clean up the EAL */
+       rte_eal_cleanup();
 }