get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

GET /api/patches/91661/?format=api
HTTP 200 OK
Allow: GET, PUT, PATCH, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 91661,
    "url": "http://patches.dpdk.org/api/patches/91661/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20210416171941.346166-4-conor.walsh@intel.com/",
    "project": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/projects/1/?format=api",
        "name": "DPDK",
        "link_name": "dpdk",
        "list_id": "dev.dpdk.org",
        "list_email": "dev@dpdk.org",
        "web_url": "http://core.dpdk.org",
        "scm_url": "git://dpdk.org/dpdk",
        "webscm_url": "http://git.dpdk.org/dpdk",
        "list_archive_url": "https://inbox.dpdk.org/dev",
        "list_archive_url_format": "https://inbox.dpdk.org/dev/{}",
        "commit_url_format": ""
    },
    "msgid": "<20210416171941.346166-4-conor.walsh@intel.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210416171941.346166-4-conor.walsh@intel.com",
    "date": "2021-04-16T17:19:39",
    "name": "[v8,3/5] examples/l3fwd: add FIB infrastructure",
    "commit_ref": null,
    "pull_url": null,
    "state": "accepted",
    "archived": true,
    "hash": "8b4e6af4e7b66e72b54db66e518919c32f0b970b",
    "submitter": {
        "id": 1935,
        "url": "http://patches.dpdk.org/api/people/1935/?format=api",
        "name": "Conor Walsh",
        "email": "conor.walsh@intel.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20210416171941.346166-4-conor.walsh@intel.com/mbox/",
    "series": [
        {
            "id": 16450,
            "url": "http://patches.dpdk.org/api/series/16450/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=16450",
            "date": "2021-04-16T17:19:36",
            "name": "examples/l3fwd: add FIB lookup method to l3fwd",
            "version": 8,
            "mbox": "http://patches.dpdk.org/series/16450/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/91661/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/91661/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@inbox.dpdk.org",
        "Delivered-To": "patchwork@inbox.dpdk.org",
        "Received": [
            "from mails.dpdk.org (mails.dpdk.org [217.70.189.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 2C7ABA0C41;\n\tFri, 16 Apr 2021 19:20:09 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 5BAA0161B46;\n\tFri, 16 Apr 2021 19:20:04 +0200 (CEST)",
            "from mga09.intel.com (mga09.intel.com [134.134.136.24])\n by mails.dpdk.org (Postfix) with ESMTP id CDE24161B14\n for <dev@dpdk.org>; Fri, 16 Apr 2021 19:19:56 +0200 (CEST)",
            "from orsmga005.jf.intel.com ([10.7.209.41])\n by orsmga102.jf.intel.com with ESMTP/TLS/ECDHE-RSA-AES256-GCM-SHA384;\n 16 Apr 2021 10:19:56 -0700",
            "from silpixa00400466.ir.intel.com ([10.237.213.210])\n by orsmga005.jf.intel.com with ESMTP; 16 Apr 2021 10:19:53 -0700"
        ],
        "IronPort-SDR": [
            "\n kNNVL3Xi3tzIMH6ykQqCfaPmMuimQMRJK8zddj83sBMvcxR00EVW3uTsHRERk0TBX/JTrncaty\n B2k1ccC7Ihsg==",
            "\n 1JQy9mIOe4Bwc6S0j1DzPg0UECTo+eIxFQLCvl50Zu6JDz72qCG1stGFWTHq9/4B9q9WdXvKFL\n KuxI+UvjqQYA=="
        ],
        "X-IronPort-AV": [
            "E=McAfee;i=\"6200,9189,9956\"; a=\"195184278\"",
            "E=Sophos;i=\"5.82,226,1613462400\"; d=\"scan'208\";a=\"195184278\"",
            "E=Sophos;i=\"5.82,226,1613462400\"; d=\"scan'208\";a=\"601528459\""
        ],
        "X-ExtLoop1": "1",
        "From": "Conor Walsh <conor.walsh@intel.com>",
        "To": "jerinj@marvell.com, stephen@networkplumber.org,\n bernard.iremonger@intel.com, konstantin.ananyev@intel.com,\n vladimir.medvedkin@intel.com, anatoly.burakov@intel.com,\n john.mcnamara@intel.com, david.marchand@redhat.com",
        "Cc": "dev@dpdk.org,\n\tConor Walsh <conor.walsh@intel.com>",
        "Date": "Fri, 16 Apr 2021 17:19:39 +0000",
        "Message-Id": "<20210416171941.346166-4-conor.walsh@intel.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20210416171941.346166-1-conor.walsh@intel.com>",
        "References": "<20210406111106.2020555-1-conor.walsh@intel.com>\n <20210416171941.346166-1-conor.walsh@intel.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Subject": "[dpdk-dev] [PATCH v8 3/5] examples/l3fwd: add FIB infrastructure",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.29",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n <mailto:dev-request@dpdk.org?subject=unsubscribe>",
        "List-Archive": "<http://mails.dpdk.org/archives/dev/>",
        "List-Post": "<mailto:dev@dpdk.org>",
        "List-Help": "<mailto:dev-request@dpdk.org?subject=help>",
        "List-Subscribe": "<https://mails.dpdk.org/listinfo/dev>,\n <mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "The purpose of this commit is to add the necessary function calls\nand supporting infrastructure to allow the Forwarding Information Base\n(FIB) library to be integrated into the l3fwd sample app.\nInstead of adding an individual flag for FIB, a new flag '--lookup' has\nbeen added that allows the user to select their desired lookup method.\nThe flags '-E' and '-L' have been retained for backwards compatibility.\n\nSigned-off-by: Conor Walsh <conor.walsh@intel.com>\nAcked-by: Konstantin Ananyev <konstantin.ananyev@intel.com>\nAcked-by: Vladimir Medvedkin <vladimir.medvedkin@intel.com>\nAcked-by: Anatoly Burakov <anatoly.burakov@intel.com>\n---\n examples/l3fwd/Makefile      |   2 +-\n examples/l3fwd/l3fwd.h       |  27 +++++++-\n examples/l3fwd/l3fwd_event.c |   9 +++\n examples/l3fwd/l3fwd_event.h |   1 +\n examples/l3fwd/l3fwd_fib.c   |  60 ++++++++++++++++++\n examples/l3fwd/main.c        | 119 ++++++++++++++++++++++++++---------\n examples/l3fwd/meson.build   |   4 +-\n 7 files changed, 186 insertions(+), 36 deletions(-)\n create mode 100644 examples/l3fwd/l3fwd_fib.c",
    "diff": "diff --git a/examples/l3fwd/Makefile b/examples/l3fwd/Makefile\nindex ff3930c42b..2381a215f0 100644\n--- a/examples/l3fwd/Makefile\n+++ b/examples/l3fwd/Makefile\n@@ -5,7 +5,7 @@\n APP = l3fwd\n \n # all source are stored in SRCS-y\n-SRCS-y := main.c l3fwd_lpm.c l3fwd_em.c l3fwd_event.c\n+SRCS-y := main.c l3fwd_lpm.c l3fwd_fib.c l3fwd_em.c l3fwd_event.c\n SRCS-y += l3fwd_event_generic.c l3fwd_event_internal_port.c\n \n # Build using pkg-config variables if possible\ndiff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h\nindex 2cf06099e0..a808d60247 100644\n--- a/examples/l3fwd/l3fwd.h\n+++ b/examples/l3fwd/l3fwd.h\n@@ -1,5 +1,5 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2016 Intel Corporation\n+ * Copyright(c) 2010-2021 Intel Corporation\n  */\n \n #ifndef __L3_FWD_H__\n@@ -180,13 +180,16 @@ is_valid_ipv4_pkt(struct rte_ipv4_hdr *pkt, uint32_t link_len)\n int\n init_mem(uint16_t portid, unsigned int nb_mbuf);\n \n-/* Function pointers for LPM or EM functionality. */\n+/* Function pointers for LPM, EM or FIB functionality. */\n void\n setup_lpm(const int socketid);\n \n void\n setup_hash(const int socketid);\n \n+void\n+setup_fib(const int socketid);\n+\n int\n em_check_ptype(int portid);\n \n@@ -207,6 +210,9 @@ em_main_loop(__rte_unused void *dummy);\n int\n lpm_main_loop(__rte_unused void *dummy);\n \n+int\n+fib_main_loop(__rte_unused void *dummy);\n+\n int\n lpm_event_main_loop_tx_d(__rte_unused void *dummy);\n int\n@@ -225,8 +231,17 @@ em_event_main_loop_tx_q(__rte_unused void *dummy);\n int\n em_event_main_loop_tx_q_burst(__rte_unused void *dummy);\n \n+int\n+fib_event_main_loop_tx_d(__rte_unused void *dummy);\n+int\n+fib_event_main_loop_tx_d_burst(__rte_unused void *dummy);\n+int\n+fib_event_main_loop_tx_q(__rte_unused void *dummy);\n+int\n+fib_event_main_loop_tx_q_burst(__rte_unused void *dummy);\n+\n \n-/* Return ipv4/ipv6 fwd lookup struct for LPM or EM. */\n+/* Return ipv4/ipv6 fwd lookup struct for LPM, EM or FIB. */\n void *\n em_get_ipv4_l3fwd_lookup_struct(const int socketid);\n \n@@ -239,4 +254,10 @@ lpm_get_ipv4_l3fwd_lookup_struct(const int socketid);\n void *\n lpm_get_ipv6_l3fwd_lookup_struct(const int socketid);\n \n+void *\n+fib_get_ipv4_l3fwd_lookup_struct(const int socketid);\n+\n+void *\n+fib_get_ipv6_l3fwd_lookup_struct(const int socketid);\n+\n #endif  /* __L3_FWD_H__ */\ndiff --git a/examples/l3fwd/l3fwd_event.c b/examples/l3fwd/l3fwd_event.c\nindex 4d31593a0a..961860ea18 100644\n--- a/examples/l3fwd/l3fwd_event.c\n+++ b/examples/l3fwd/l3fwd_event.c\n@@ -227,6 +227,12 @@ l3fwd_event_resource_setup(struct rte_eth_conf *port_conf)\n \t\t[1][0] = em_event_main_loop_tx_q,\n \t\t[1][1] = em_event_main_loop_tx_q_burst,\n \t};\n+\tconst event_loop_cb fib_event_loop[2][2] = {\n+\t\t[0][0] = fib_event_main_loop_tx_d,\n+\t\t[0][1] = fib_event_main_loop_tx_d_burst,\n+\t\t[1][0] = fib_event_main_loop_tx_q,\n+\t\t[1][1] = fib_event_main_loop_tx_q_burst,\n+\t};\n \tuint32_t event_queue_cfg;\n \tint ret;\n \n@@ -264,4 +270,7 @@ l3fwd_event_resource_setup(struct rte_eth_conf *port_conf)\n \n \tevt_rsrc->ops.em_event_loop = em_event_loop[evt_rsrc->tx_mode_q]\n \t\t\t\t\t\t       [evt_rsrc->has_burst];\n+\n+\tevt_rsrc->ops.fib_event_loop = fib_event_loop[evt_rsrc->tx_mode_q]\n+\t\t\t\t\t\t       [evt_rsrc->has_burst];\n }\ndiff --git a/examples/l3fwd/l3fwd_event.h b/examples/l3fwd/l3fwd_event.h\nindex 0e46164170..3ad1902ab5 100644\n--- a/examples/l3fwd/l3fwd_event.h\n+++ b/examples/l3fwd/l3fwd_event.h\n@@ -55,6 +55,7 @@ struct l3fwd_event_setup_ops {\n \tadapter_setup_cb adapter_setup;\n \tevent_loop_cb lpm_event_loop;\n \tevent_loop_cb em_event_loop;\n+\tevent_loop_cb fib_event_loop;\n };\n \n struct l3fwd_event_resources {\ndiff --git a/examples/l3fwd/l3fwd_fib.c b/examples/l3fwd/l3fwd_fib.c\nnew file mode 100644\nindex 0000000000..eb5bc2de5b\n--- /dev/null\n+++ b/examples/l3fwd/l3fwd_fib.c\n@@ -0,0 +1,60 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2021 Intel Corporation\n+ */\n+\n+#include <rte_fib.h>\n+#include <rte_fib6.h>\n+\n+#include \"l3fwd.h\"\n+#include \"l3fwd_event.h\"\n+#include \"l3fwd_route.h\"\n+\n+/* Main fib processing loop. */\n+int\n+fib_main_loop(__rte_unused void *dummy)\n+{\n+\treturn 0;\n+}\n+\n+int __rte_noinline\n+fib_event_main_loop_tx_d(__rte_unused void *dummy)\n+{\n+\treturn 0;\n+}\n+\n+int __rte_noinline\n+fib_event_main_loop_tx_d_burst(__rte_unused void *dummy)\n+{\n+\treturn 0;\n+}\n+\n+int __rte_noinline\n+fib_event_main_loop_tx_q(__rte_unused void *dummy)\n+{\n+\treturn 0;\n+}\n+\n+int __rte_noinline\n+fib_event_main_loop_tx_q_burst(__rte_unused void *dummy)\n+{\n+\treturn 0;\n+}\n+\n+/* Function to setup fib. */\n+void\n+setup_fib(__rte_unused const int socketid)\n+{}\n+\n+/* Return ipv4 fib lookup struct. */\n+void *\n+fib_get_ipv4_l3fwd_lookup_struct(__rte_unused const int socketid)\n+{\n+\treturn 0;\n+}\n+\n+/* Return ipv6 fib lookup struct. */\n+void *\n+fib_get_ipv6_l3fwd_lookup_struct(__rte_unused const int socketid)\n+{\n+\treturn 0;\n+}\ndiff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c\nindex 355064a1c7..74413052b0 100644\n--- a/examples/l3fwd/main.c\n+++ b/examples/l3fwd/main.c\n@@ -1,5 +1,5 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n- * Copyright(c) 2010-2016 Intel Corporation\n+ * Copyright(c) 2010-2021 Intel Corporation\n  */\n \n #include <stdio.h>\n@@ -61,9 +61,14 @@ static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;\n /**< Ports set in promiscuous mode off by default. */\n static int promiscuous_on;\n \n-/* Select Longest-Prefix or Exact match. */\n-static int l3fwd_lpm_on;\n-static int l3fwd_em_on;\n+/* Select Longest-Prefix, Exact match or Forwarding Information Base. */\n+enum L3FWD_LOOKUP_MODE {\n+\tL3FWD_LOOKUP_DEFAULT,\n+\tL3FWD_LOOKUP_LPM,\n+\tL3FWD_LOOKUP_EM,\n+\tL3FWD_LOOKUP_FIB\n+};\n+static enum L3FWD_LOOKUP_MODE lookup_mode;\n \n /* Global variables. */\n \n@@ -163,6 +168,15 @@ static struct l3fwd_lkp_mode l3fwd_lpm_lkp = {\n \t.get_ipv6_lookup_struct = lpm_get_ipv6_l3fwd_lookup_struct,\n };\n \n+static struct l3fwd_lkp_mode l3fwd_fib_lkp = {\n+\t.setup                  = setup_fib,\n+\t.check_ptype            = lpm_check_ptype,\n+\t.cb_parse_ptype         = lpm_cb_parse_ptype,\n+\t.main_loop              = fib_main_loop,\n+\t.get_ipv4_lookup_struct = fib_get_ipv4_l3fwd_lookup_struct,\n+\t.get_ipv6_lookup_struct = fib_get_ipv6_l3fwd_lookup_struct,\n+};\n+\n /*\n  * 198.18.0.0/16 are set aside for RFC2544 benchmarking (RFC5735).\n  * 198.18.{0-7}.0/24 = Port {0-7}\n@@ -195,15 +209,18 @@ const struct ipv6_l3fwd_route ipv6_l3fwd_route_array[] = {\n \n /*\n  * Setup lookup methods for forwarding.\n- * Currently exact-match and longest-prefix-match\n- * are supported ones.\n+ * Currently exact-match, longest-prefix-match and forwarding information\n+ * base are the supported ones.\n  */\n static void\n setup_l3fwd_lookup_tables(void)\n {\n \t/* Setup HASH lookup functions. */\n-\tif (l3fwd_em_on)\n+\tif (lookup_mode == L3FWD_LOOKUP_EM)\n \t\tl3fwd_lkp = l3fwd_em_lkp;\n+\t/* Setup FIB lookup functions. */\n+\telse if (lookup_mode == L3FWD_LOOKUP_FIB)\n+\t\tl3fwd_lkp = l3fwd_fib_lkp;\n \t/* Setup LPM lookup functions. */\n \telse\n \t\tl3fwd_lkp = l3fwd_lpm_lkp;\n@@ -306,8 +323,7 @@ print_usage(const char *prgname)\n \tfprintf(stderr, \"%s [EAL options] --\"\n \t\t\" -p PORTMASK\"\n \t\t\" [-P]\"\n-\t\t\" [-E]\"\n-\t\t\" [-L]\"\n+\t\t\" [--lookup]\"\n \t\t\" --config (port,queue,lcore)[,(port,queue,lcore)]\"\n \t\t\" [--eth-dest=X,MM:MM:MM:MM:MM:MM]\"\n \t\t\" [--enable-jumbo [--max-pkt-len PKTLEN]]\"\n@@ -317,12 +333,15 @@ print_usage(const char *prgname)\n \t\t\" [--parse-ptype]\"\n \t\t\" [--per-port-pool]\"\n \t\t\" [--mode]\"\n-\t\t\" [--eventq-sched]\\n\\n\"\n+\t\t\" [--eventq-sched]\"\n+\t\t\" [-E]\"\n+\t\t\" [-L]\\n\\n\"\n \n \t\t\"  -p PORTMASK: Hexadecimal bitmask of ports to configure\\n\"\n \t\t\"  -P : Enable promiscuous mode\\n\"\n-\t\t\"  -E : Enable exact match\\n\"\n-\t\t\"  -L : Enable longest prefix match (default)\\n\"\n+\t\t\"  --lookup: Select the lookup method\\n\"\n+\t\t\"            Default: lpm\\n\"\n+\t\t\"            Accepted: em (Exact Match), lpm (Longest Prefix Match), fib (Forwarding Information Base)\\n\"\n \t\t\"  --config (port,queue,lcore): Rx queue configuration\\n\"\n \t\t\"  --eth-dest=X,MM:MM:MM:MM:MM:MM: Ethernet destination for port X\\n\"\n \t\t\"  --enable-jumbo: Enable jumbo frames\\n\"\n@@ -341,7 +360,9 @@ print_usage(const char *prgname)\n \t\t\"                  Valid only if --mode=eventdev\\n\"\n \t\t\"  --event-eth-rxqs: Number of ethernet RX queues per device.\\n\"\n \t\t\"                    Default: 1\\n\"\n-\t\t\"                    Valid only if --mode=eventdev\\n\\n\",\n+\t\t\"                    Valid only if --mode=eventdev\\n\"\n+\t\t\"  -E : Enable exact match, legacy flag please use --lookup=em instead\\n\"\n+\t\t\"  -L : Enable longest prefix match, legacy flag please use --lookup=lpm instead\\n\\n\",\n \t\tprgname);\n }\n \n@@ -516,13 +537,29 @@ parse_event_eth_rx_queues(const char *eth_rx_queues)\n \tevt_rsrc->eth_rx_queues = num_eth_rx_queues;\n }\n \n+static int\n+parse_lookup(const char *optarg)\n+{\n+\tif (!strcmp(optarg, \"em\"))\n+\t\tlookup_mode = L3FWD_LOOKUP_EM;\n+\telse if (!strcmp(optarg, \"lpm\"))\n+\t\tlookup_mode = L3FWD_LOOKUP_LPM;\n+\telse if (!strcmp(optarg, \"fib\"))\n+\t\tlookup_mode = L3FWD_LOOKUP_FIB;\n+\telse {\n+\t\tfprintf(stderr, \"Invalid lookup option! Accepted options: em, lpm, fib\\n\");\n+\t\treturn -1;\n+\t}\n+\treturn 0;\n+}\n+\n #define MAX_JUMBO_PKT_LEN  9600\n \n static const char short_options[] =\n \t\"p:\"  /* portmask */\n \t\"P\"   /* promiscuous */\n-\t\"L\"   /* enable long prefix match */\n-\t\"E\"   /* enable exact match */\n+\t\"L\"   /* legacy enable long prefix match */\n+\t\"E\"   /* legacy enable exact match */\n \t;\n \n #define CMD_LINE_OPT_CONFIG \"config\"\n@@ -536,6 +573,7 @@ static const char short_options[] =\n #define CMD_LINE_OPT_MODE \"mode\"\n #define CMD_LINE_OPT_EVENTQ_SYNC \"eventq-sched\"\n #define CMD_LINE_OPT_EVENT_ETH_RX_QUEUES \"event-eth-rxqs\"\n+#define CMD_LINE_OPT_LOOKUP \"lookup\"\n enum {\n \t/* long options mapped to a short option */\n \n@@ -553,6 +591,7 @@ enum {\n \tCMD_LINE_OPT_MODE_NUM,\n \tCMD_LINE_OPT_EVENTQ_SYNC_NUM,\n \tCMD_LINE_OPT_EVENT_ETH_RX_QUEUES_NUM,\n+\tCMD_LINE_OPT_LOOKUP_NUM,\n };\n \n static const struct option lgopts[] = {\n@@ -568,6 +607,7 @@ static const struct option lgopts[] = {\n \t{CMD_LINE_OPT_EVENTQ_SYNC, 1, 0, CMD_LINE_OPT_EVENTQ_SYNC_NUM},\n \t{CMD_LINE_OPT_EVENT_ETH_RX_QUEUES, 1, 0,\n \t\t\t\t\tCMD_LINE_OPT_EVENT_ETH_RX_QUEUES_NUM},\n+\t{CMD_LINE_OPT_LOOKUP, 1, 0, CMD_LINE_OPT_LOOKUP_NUM},\n \t{NULL, 0, 0, 0}\n };\n \n@@ -620,11 +660,19 @@ parse_args(int argc, char **argv)\n \t\t\tbreak;\n \n \t\tcase 'E':\n-\t\t\tl3fwd_em_on = 1;\n+\t\t\tif (lookup_mode != L3FWD_LOOKUP_DEFAULT) {\n+\t\t\t\tfprintf(stderr, \"Only one lookup mode is allowed at a time!\\n\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tlookup_mode = L3FWD_LOOKUP_EM;\n \t\t\tbreak;\n \n \t\tcase 'L':\n-\t\t\tl3fwd_lpm_on = 1;\n+\t\t\tif (lookup_mode != L3FWD_LOOKUP_DEFAULT) {\n+\t\t\t\tfprintf(stderr, \"Only one lookup mode is allowed at a time!\\n\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tlookup_mode = L3FWD_LOOKUP_LPM;\n \t\t\tbreak;\n \n \t\t/* long options */\n@@ -711,18 +759,27 @@ parse_args(int argc, char **argv)\n \t\t\teth_rx_q = 1;\n \t\t\tbreak;\n \n+\t\tcase CMD_LINE_OPT_LOOKUP_NUM:\n+\t\t\tif (lookup_mode != L3FWD_LOOKUP_DEFAULT) {\n+\t\t\t\tfprintf(stderr, \"Only one lookup mode is allowed at a time!\\n\");\n+\t\t\t\treturn -1;\n+\t\t\t}\n+\t\t\tret = parse_lookup(optarg);\n+\t\t\t/*\n+\t\t\t * If parse_lookup was passed an invalid lookup type\n+\t\t\t * then return -1. Error log included within\n+\t\t\t * parse_lookup for simplicity.\n+\t\t\t */\n+\t\t\tif (ret)\n+\t\t\t\treturn -1;\n+\t\t\tbreak;\n+\n \t\tdefault:\n \t\t\tprint_usage(prgname);\n \t\t\treturn -1;\n \t\t}\n \t}\n \n-\t/* If both LPM and EM are selected, return error. */\n-\tif (l3fwd_lpm_on && l3fwd_em_on) {\n-\t\tfprintf(stderr, \"LPM and EM are mutually exclusive, select only one\\n\");\n-\t\treturn -1;\n-\t}\n-\n \tif (evt_rsrc->enabled && lcore_params) {\n \t\tfprintf(stderr, \"lcore config is not valid when event mode is selected\\n\");\n \t\treturn -1;\n@@ -742,17 +799,17 @@ parse_args(int argc, char **argv)\n \t * Nothing is selected, pick longest-prefix match\n \t * as default match.\n \t */\n-\tif (!l3fwd_lpm_on && !l3fwd_em_on) {\n-\t\tfprintf(stderr, \"LPM or EM none selected, default LPM on\\n\");\n-\t\tl3fwd_lpm_on = 1;\n+\tif (lookup_mode == L3FWD_LOOKUP_DEFAULT) {\n+\t\tfprintf(stderr, \"Neither LPM, EM, or FIB selected, defaulting to LPM\\n\");\n+\t\tlookup_mode = L3FWD_LOOKUP_LPM;\n \t}\n \n \t/*\n \t * ipv6 and hash flags are valid only for\n-\t * exact macth, reset them to default for\n+\t * exact match, reset them to default for\n \t * longest-prefix match.\n \t */\n-\tif (l3fwd_lpm_on) {\n+\tif (lookup_mode == L3FWD_LOOKUP_LPM) {\n \t\tipv6 = 0;\n \t\thash_entry_number = HASH_ENTRY_NUMBER_DEFAULT;\n \t}\n@@ -811,7 +868,7 @@ init_mem(uint16_t portid, unsigned int nb_mbuf)\n \t\t\t\tprintf(\"Allocated mbuf pool on socket %d\\n\",\n \t\t\t\t\tsocketid);\n \n-\t\t\t/* Setup either LPM or EM(f.e Hash). But, only once per\n+\t\t\t/* Setup LPM, EM(f.e Hash) or FIB. But, only once per\n \t\t\t * available socket.\n \t\t\t */\n \t\t\tif (!lkp_per_socket[socketid]) {\n@@ -1250,8 +1307,10 @@ main(int argc, char **argv)\n \t/* Configure eventdev parameters if user has requested */\n \tif (evt_rsrc->enabled) {\n \t\tl3fwd_event_resource_setup(&port_conf);\n-\t\tif (l3fwd_em_on)\n+\t\tif (lookup_mode == L3FWD_LOOKUP_EM)\n \t\t\tl3fwd_lkp.main_loop = evt_rsrc->ops.em_event_loop;\n+\t\telse if (lookup_mode == L3FWD_LOOKUP_FIB)\n+\t\t\tl3fwd_lkp.main_loop = evt_rsrc->ops.fib_event_loop;\n \t\telse\n \t\t\tl3fwd_lkp.main_loop = evt_rsrc->ops.lpm_event_loop;\n \t\tl3fwd_event_service_setup();\ndiff --git a/examples/l3fwd/meson.build b/examples/l3fwd/meson.build\nindex 7d72b1b365..2e5d1d34f2 100644\n--- a/examples/l3fwd/meson.build\n+++ b/examples/l3fwd/meson.build\n@@ -7,8 +7,8 @@\n # DPDK instance, use 'make'\n \n allow_experimental_apis = true\n-deps += ['hash', 'lpm', 'eventdev']\n+deps += ['hash', 'lpm', 'fib', 'eventdev']\n sources = files(\n-\t'l3fwd_em.c', 'l3fwd_lpm.c', 'l3fwd_event.c',\n+\t'l3fwd_em.c', 'l3fwd_lpm.c', 'l3fwd_fib.c', 'l3fwd_event.c',\n \t'l3fwd_event_internal_port.c', 'l3fwd_event_generic.c', 'main.c'\n )\n",
    "prefixes": [
        "v8",
        "3/5"
    ]
}