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

diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 9894a3b..e45e87b 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -104,6 +104,7 @@ static int l3fwd_em_on;
 static int numa_on = 1; /**< NUMA is enabled by default. */
 static int parse_ptype; /**< Parse packet type using rx callback, and */
                        /**< disabled by default */
+static const char *mbuf_pool_ops; /**< mbuf pool handler */

 /* Global variables. */

@@ -488,6 +489,8 @@ static const char short_options[] =
 #define CMD_LINE_OPT_ENABLE_JUMBO "enable-jumbo"
 #define CMD_LINE_OPT_HASH_ENTRY_NUM "hash-entry-num"
 #define CMD_LINE_OPT_PARSE_PTYPE "parse-ptype"
+#define CMD_LINE_OPT_MBUF_POOL_OPS "mbuf-pool-ops"
+
 enum {
        /* long options mapped to a short option */

@@ -501,6 +504,7 @@ enum {
        CMD_LINE_OPT_ENABLE_JUMBO_NUM,
        CMD_LINE_OPT_HASH_ENTRY_NUM_NUM,
        CMD_LINE_OPT_PARSE_PTYPE_NUM,
+       CMD_LINE_OPT_MBUF_POOL_OPS_NUM,
 };

 static const struct option lgopts[] = {
@@ -511,6 +515,7 @@ static const struct option lgopts[] = {
        {CMD_LINE_OPT_ENABLE_JUMBO, 0, 0, CMD_LINE_OPT_ENABLE_JUMBO_NUM},
        {CMD_LINE_OPT_HASH_ENTRY_NUM, 1, 0, CMD_LINE_OPT_HASH_ENTRY_NUM_NUM},
        {CMD_LINE_OPT_PARSE_PTYPE, 0, 0, CMD_LINE_OPT_PARSE_PTYPE_NUM},
+       {CMD_LINE_OPT_MBUF_POOL_OPS, 1, 0, CMD_LINE_OPT_MBUF_POOL_OPS_NUM},
        {NULL, 0, 0, 0}
 };

@@ -650,7 +655,12 @@ parse_args(int argc, char **argv)
                case CMD_LINE_OPT_PARSE_PTYPE_NUM:
                        printf("soft parse-ptype is enabled\n");
                        parse_ptype = 1;
+                       break;
+

+               case CMD_LINE_OPT_MBUF_POOL_OPS_NUM:
+                       printf("set mbuf pool ops to <%s>\n", optarg);
+                       mbuf_pool_ops = strdup(optarg);
                        break;

                default:
-- 
2.8.1

Reply via email to