Signed-off-by: Olivier Matz <olivier.matz at 6wind.com>
---
 examples/l2fwd/main.c | 10 ++++++++++
 1 file changed, 10 insertions(+)

diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 028900b..dfa622f 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -138,6 +138,8 @@ struct l2fwd_port_statistics 
port_statistics[RTE_MAX_ETHPORTS];
 /* A tsc-based timer responsible for triggering statistics printout */
 static uint64_t timer_period = 10; /* default period is 10 seconds */

+static const char *mbuf_pool_ops; /**< mbuf pool handler */
+
 /* Print out statistics on packets dropped */
 static void
 print_stats(void)
@@ -382,15 +384,19 @@ static const char short_options[] =
        "T:"  /* timer period */
        ;

+#define CMD_LINE_OPT_MBUF_POOL_OPS "mbuf-pool-ops"
+
 enum {
        /* long options mapped to a short option */

        /* first long only option value must be >= 256, so that we won't
         * conflict with short options */
        CMD_LINE_OPT_MIN_NUM = 256,
+       CMD_LINE_OPT_MBUF_POOL_OPS_NUM,
 };

 static const struct option lgopts[] = {
+       {CMD_LINE_OPT_MBUF_POOL_OPS, 1, 0, CMD_LINE_OPT_MBUF_POOL_OPS_NUM},
        {NULL, 0, 0, 0}
 };

@@ -440,6 +446,10 @@ l2fwd_parse_args(int argc, char **argv)
                        timer_period = timer_secs;
                        break;

+               case CMD_LINE_OPT_MBUF_POOL_OPS_NUM:
+                       mbuf_pool_ops = strdup(optarg);
+                       break;
+
                default:
                        l2fwd_usage(prgname);
                        return -1;
-- 
2.8.1

Reply via email to