get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 59845,
    "url": "https://patches.dpdk.org/api/patches/59845/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20190926100558.24348-9-pbhagavatula@marvell.com/",
    "project": {
        "id": 1,
        "url": "https://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": "<20190926100558.24348-9-pbhagavatula@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20190926100558.24348-9-pbhagavatula@marvell.com",
    "date": "2019-09-26T10:05:55",
    "name": "[08/11] examples/l3fwd: add event lpm main loop",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0be3ca358e92599fa59189de2c21e5908e85792d",
    "submitter": {
        "id": 1183,
        "url": "https://patches.dpdk.org/api/people/1183/?format=api",
        "name": "Pavan Nikhilesh Bhagavatula",
        "email": "pbhagavatula@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "https://patches.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20190926100558.24348-9-pbhagavatula@marvell.com/mbox/",
    "series": [
        {
            "id": 6542,
            "url": "https://patches.dpdk.org/api/series/6542/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=6542",
            "date": "2019-09-26T10:05:47",
            "name": "example/l3fwd: introduce event device support",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/6542/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/59845/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/59845/checks/",
    "tags": {},
    "related": [],
    "headers": {
        "Return-Path": "<dev-bounces@dpdk.org>",
        "X-Original-To": "patchwork@dpdk.org",
        "Delivered-To": "patchwork@dpdk.org",
        "Received": [
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 399F71BF8B;\n\tThu, 26 Sep 2019 12:06:37 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n\t[67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 65DD91BF8B\n\tfor <dev@dpdk.org>; Thu, 26 Sep 2019 12:06:35 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n\tby mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id\n\tx8QA5PsW000795; Thu, 26 Sep 2019 03:06:34 -0700",
            "from sc-exch04.marvell.com ([199.233.58.184])\n\tby mx0b-0016f401.pphosted.com with ESMTP id 2v8u5dr1b6-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tThu, 26 Sep 2019 03:06:34 -0700",
            "from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH04.marvell.com\n\t(10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tThu, 26 Sep 2019 03:06:32 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH03.marvell.com\n\t(10.93.176.83) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Thu, 26 Sep 2019 03:06:32 -0700",
            "from BG-LT7430.marvell.com (unknown [10.28.17.15])\n\tby maili.marvell.com (Postfix) with ESMTP id BBC1F3F7043;\n\tThu, 26 Sep 2019 03:06:29 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n\th=from : to : cc :\n\tsubject : date : message-id : in-reply-to : references : mime-version\n\t: content-transfer-encoding : content-type; s=pfpt0818;\n\tbh=HuQ/S5gtPLLWTPZKCkXilRjCkCrvwJk3zwwFO2V4uMM=;\n\tb=IZBK2fZb2YyqnUTB0j5XGuHFvPFrRLPO+6ec8zWfCDWtT0xlFcbYWKQWaSehq1LcWqHR\n\tNWm/B2HtAGBfAlu/kYBua4epUCklsI/5HO/feiDq7K5a5QqVjwusBsOtgiZByAXeX35b\n\twoVyRqKB74DrD/pjd8M3QgFHnt6Zs6DFXQ+mW/L/kA/pOD5J7FfaE4r3Zu2kBeVqyszC\n\tQKvZWdX5UFioeHCo81pSHkWZhRJS7B9Ffk3dR9n7MrlTsW9rWbePHQHjm/jaAqjqzzwA\n\tOMOgTv+HQ+3WIftvD7EXMfpSHD6A8EQQNORHqUKLJKMPIPoEj3KSNbCCaVY4S7PwUb28\n\taw== ",
        "From": "<pbhagavatula@marvell.com>",
        "To": "<jerinj@marvell.com>, <akhil.goyal@nxp.com>, Marko Kovacevic\n\t<marko.kovacevic@intel.com>, Ori Kam <orika@mellanox.com>,\n\tBruce Richardson\n\t<bruce.richardson@intel.com>, Radu Nicolau <radu.nicolau@intel.com>, \n\t\"Tomasz Kantecki\" <tomasz.kantecki@intel.com>",
        "CC": "<dev@dpdk.org>, Pavan Nikhilesh <pbhagavatula@marvell.com>",
        "Date": "Thu, 26 Sep 2019 15:35:55 +0530",
        "Message-ID": "<20190926100558.24348-9-pbhagavatula@marvell.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20190926100558.24348-1-pbhagavatula@marvell.com>",
        "References": "<20190926100558.24348-1-pbhagavatula@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.95,1.0.8\n\tdefinitions=2019-09-26_04:2019-09-25,2019-09-26 signatures=0",
        "Subject": "[dpdk-dev]  [PATCH 08/11] examples/l3fwd: add event lpm main loop",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "Precedence": "list",
        "List-Id": "DPDK patches and discussions <dev.dpdk.org>",
        "List-Unsubscribe": "<https://mails.dpdk.org/options/dev>,\n\t<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\t<mailto:dev-request@dpdk.org?subject=subscribe>",
        "Errors-To": "dev-bounces@dpdk.org",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "From: Pavan Nikhilesh <pbhagavatula@marvell.com>\n\nAdd lpm main loop for handling events based on capabilities of the\nevent device.\n\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\n---\n examples/l3fwd/l3fwd.h          |  12 ++\n examples/l3fwd/l3fwd_eventdev.c |   9 ++\n examples/l3fwd/l3fwd_eventdev.h |   5 +\n examples/l3fwd/l3fwd_lpm.c      | 205 ++++++++++++++++++++++++++++++++\n examples/l3fwd/main.c           |  10 +-\n 5 files changed, 237 insertions(+), 4 deletions(-)",
    "diff": "diff --git a/examples/l3fwd/l3fwd.h b/examples/l3fwd/l3fwd.h\nindex ef978ae64..2cee544a5 100644\n--- a/examples/l3fwd/l3fwd.h\n+++ b/examples/l3fwd/l3fwd.h\n@@ -209,6 +209,18 @@ em_main_loop(__attribute__((unused)) void *dummy);\n int\n lpm_main_loop(__attribute__((unused)) void *dummy);\n \n+#define L3FWD_LPM_EVENT_MODE\t\t\t\t\t\t  \\\n+LPM_FP(tx_d,\t\t0, 0, L3FWD_EVENT_TX_DIRECT | L3FWD_EVENT_SINGLE) \\\n+LPM_FP(tx_d_burst,\t0, 1, L3FWD_EVENT_TX_DIRECT | L3FWD_EVENT_BURST)  \\\n+LPM_FP(tx_q,\t\t1, 0, L3FWD_EVENT_TX_ENQ | L3FWD_EVENT_SINGLE)\t  \\\n+LPM_FP(tx_q_burst,\t1, 1, L3FWD_EVENT_TX_ENQ | L3FWD_EVENT_BURST)\t  \\\n+\n+#define LPM_FP(_name, _f2, _f1, flags)\t\t\t\t\t\\\n+int\t\t\t\t\t\t\t\t\t\\\n+lpm_event_main_loop_ ## _name(__attribute__((unused)) void *dummy);\n+L3FWD_LPM_EVENT_MODE\n+#undef LPM_FP\n+\n /* Return ipv4/ipv6 fwd lookup struct for LPM or EM. */\n void *\n em_get_ipv4_l3fwd_lookup_struct(const int socketid);\ndiff --git a/examples/l3fwd/l3fwd_eventdev.c b/examples/l3fwd/l3fwd_eventdev.c\nindex 4863f0a68..8cb12d661 100644\n--- a/examples/l3fwd/l3fwd_eventdev.c\n+++ b/examples/l3fwd/l3fwd_eventdev.c\n@@ -301,6 +301,12 @@ void\n l3fwd_eventdev_resource_setup(struct rte_eth_conf *port_conf)\n {\n \tstruct l3fwd_eventdev_resources *evdev_rsrc = l3fwd_get_eventdev_rsrc();\n+\tconst event_loop_cb lpm_event_loop[2][2] = {\n+#define LPM_FP(_name, _f2, _f1, flags) \\\n+\t\t[_f2][_f1] = lpm_event_main_loop_ ## _name,\n+\t\tL3FWD_LPM_EVENT_MODE\n+#undef LPM_FP\n+\t};\n \tuint16_t ethdev_count = rte_eth_dev_count_avail();\n \tuint32_t event_queue_cfg;\n \tint32_t ret;\n@@ -335,4 +341,7 @@ l3fwd_eventdev_resource_setup(struct rte_eth_conf *port_conf)\n \tret = rte_event_dev_start(evdev_rsrc->event_d_id);\n \tif (ret < 0)\n \t\trte_exit(EXIT_FAILURE, \"Error in starting eventdev\");\n+\n+\tevdev_rsrc->ops.lpm_event_loop = lpm_event_loop[evdev_rsrc->tx_mode_q]\n+\t\t\t\t\t\t       [evdev_rsrc->has_burst];\n }\ndiff --git a/examples/l3fwd/l3fwd_eventdev.h b/examples/l3fwd/l3fwd_eventdev.h\nindex 127bb7f42..179a01056 100644\n--- a/examples/l3fwd/l3fwd_eventdev.h\n+++ b/examples/l3fwd/l3fwd_eventdev.h\n@@ -14,6 +14,11 @@\n \n #include \"l3fwd.h\"\n \n+#define L3FWD_EVENT_SINGLE     0x1\n+#define L3FWD_EVENT_BURST      0x2\n+#define L3FWD_EVENT_TX_DIRECT  0x4\n+#define L3FWD_EVENT_TX_ENQ     0x8\n+\n #define CMD_LINE_OPT_MODE \"mode\"\n #define CMD_LINE_OPT_EVENTQ_SYNC \"eventq-sync\"\n \ndiff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c\nindex 4143683cb..7d5ce5864 100644\n--- a/examples/l3fwd/l3fwd_lpm.c\n+++ b/examples/l3fwd/l3fwd_lpm.c\n@@ -28,6 +28,7 @@\n #include <rte_lpm6.h>\n \n #include \"l3fwd.h\"\n+#include \"l3fwd_eventdev.h\"\n \n struct ipv4_l3fwd_lpm_route {\n \tuint32_t ip;\n@@ -254,6 +255,210 @@ lpm_main_loop(__attribute__((unused)) void *dummy)\n \treturn 0;\n }\n \n+static __rte_always_inline void\n+lpm_event_loop_single(struct l3fwd_eventdev_resources *evdev_rsrc,\n+\t\tconst uint8_t flags)\n+{\n+\tconst int event_p_id = l3fwd_get_free_event_port(evdev_rsrc);\n+\tconst uint8_t tx_q_id = evdev_rsrc->evq.event_q_id[\n+\t\tevdev_rsrc->evq.nb_queues - 1];\n+\tconst uint8_t event_d_id = evdev_rsrc->event_d_id;\n+\tstruct lcore_conf *lconf;\n+\tunsigned int lcore_id;\n+\tstruct rte_event ev;\n+\n+\tif (event_p_id < 0)\n+\t\treturn;\n+\n+\tlcore_id = rte_lcore_id();\n+\tlconf = &lcore_conf[lcore_id];\n+\n+\tRTE_LOG(INFO, L3FWD, \"entering %s on lcore %u\\n\", __func__, lcore_id);\n+\twhile (!force_quit) {\n+\t\tif (!rte_event_dequeue_burst(event_d_id, event_p_id, &ev, 1, 0))\n+\t\t\tcontinue;\n+\n+\t\tstruct rte_mbuf *mbuf = ev.mbuf;\n+\t\tmbuf->port = lpm_get_dst_port(lconf, mbuf, mbuf->port);\n+\n+#if defined RTE_ARCH_X86 || defined RTE_MACHINE_CPUFLAG_NEON \\\n+\t\t\t\t|| defined RTE_ARCH_PPC_64\n+\t\tprocess_packet(mbuf, &mbuf->port);\n+#else\n+\n+\t\tstruct rte_ether_hdr *eth_hdr = rte_pktmbuf_mtod(mbuf,\n+\t\t\t\t\t\t\tstruct rte_ether_hdr *);\n+#ifdef DO_RFC_1812_CHECKS\n+\t\tstruct rte_ipv4_hdr *ipv4_hdr;\n+\t\tif (RTE_ETH_IS_IPV4_HDR(mbuf->packet_type)) {\n+\t\t\t/* Handle IPv4 headers.*/\n+\t\t\tipv4_hdr = rte_pktmbuf_mtod_offset(mbuf,\n+\t\t\t\t\tstruct rte_ipv4_hdr *,\n+\t\t\t\t\tsizeof(struct rte_ether_hdr));\n+\n+\t\t\tif (is_valid_ipv4_pkt(ipv4_hdr, mbuf->pkt_len)\n+\t\t\t\t\t< 0) {\n+\t\t\t\tmbuf->port = BAD_PORT;\n+\t\t\t\tcontinue;\n+\t\t\t}\n+\t\t\t/* Update time to live and header checksum */\n+\t\t\t--(ipv4_hdr->time_to_live);\n+\t\t\t++(ipv4_hdr->hdr_checksum);\n+\t\t}\n+#endif\n+\t\t/* dst addr */\n+\t\t*(uint64_t *)&eth_hdr->d_addr = dest_eth_addr[mbuf->port];\n+\n+\t\t/* src addr */\n+\t\trte_ether_addr_copy(&ports_eth_addr[mbuf->port],\n+\t\t\t\t&eth_hdr->s_addr);\n+#endif\n+\t\tif (mbuf->port == BAD_PORT) {\n+\t\t\trte_pktmbuf_free(mbuf);\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tif (flags & L3FWD_EVENT_TX_ENQ) {\n+\t\t\tev.queue_id = tx_q_id;\n+\t\t\tev.op = RTE_EVENT_OP_FORWARD;\n+\t\t\twhile (rte_event_enqueue_burst(event_d_id, event_p_id,\n+\t\t\t\t\t\t&ev, 1) && !force_quit)\n+\t\t\t\t;\n+\t\t}\n+\n+\t\tif (flags & L3FWD_EVENT_TX_DIRECT) {\n+\t\t\trte_event_eth_tx_adapter_txq_set(mbuf, 0);\n+\t\t\twhile (!rte_event_eth_tx_adapter_enqueue(event_d_id,\n+\t\t\t\t\t\tevent_p_id, &ev, 1) &&\n+\t\t\t\t\t!force_quit)\n+\t\t\t\t;\n+\t\t}\n+\t}\n+}\n+\n+static __rte_always_inline void\n+lpm_event_loop_burst(struct l3fwd_eventdev_resources *evdev_rsrc,\n+\t\tconst uint8_t flags)\n+{\n+\tconst int event_p_id = l3fwd_get_free_event_port(evdev_rsrc);\n+\tconst uint8_t tx_q_id = evdev_rsrc->evq.event_q_id[\n+\t\tevdev_rsrc->evq.nb_queues - 1];\n+\tconst uint8_t event_d_id = evdev_rsrc->event_d_id;\n+\tconst uint16_t deq_len = evdev_rsrc->deq_depth;\n+\tstruct rte_event events[MAX_PKT_BURST];\n+\tstruct lcore_conf *lconf;\n+\tunsigned int lcore_id;\n+\tint i, nb_enq, nb_deq;\n+\n+\tif (event_p_id < 0)\n+\t\treturn;\n+\n+\tlcore_id = rte_lcore_id();\n+\n+\tlconf = &lcore_conf[lcore_id];\n+\n+\tRTE_LOG(INFO, L3FWD, \"entering %s on lcore %u\\n\", __func__, lcore_id);\n+\n+\twhile (!force_quit) {\n+\t\t/* Read events from RX queues */\n+\t\tnb_deq = rte_event_dequeue_burst(event_d_id, event_p_id,\n+\t\t\t\tevents, deq_len, 0);\n+\t\tif (nb_deq == 0) {\n+\t\t\trte_pause();\n+\t\t\tcontinue;\n+\t\t}\n+\n+\t\tfor (i = 0; i < nb_deq; i++) {\n+\t\t\tstruct rte_mbuf *mbuf = events[i].mbuf;\n+\n+\t\t\tmbuf->port = lpm_get_dst_port(lconf, mbuf, mbuf->port);\n+\n+#if defined RTE_ARCH_X86 || defined RTE_MACHINE_CPUFLAG_NEON \\\n+\t\t\t\t\t|| defined RTE_ARCH_PPC_64\n+\t\t\tprocess_packet(mbuf, &mbuf->port);\n+#else\n+\t\t\tstruct rte_ether_hdr *eth_hdr = rte_pktmbuf_mtod(mbuf,\n+\t\t\t\t\t\tstruct rte_ether_hdr *);\n+\n+#ifdef DO_RFC_1812_CHECKS\n+\t\t\tstruct rte_ipv4_hdr *ipv4_hdr;\n+\t\t\tif (RTE_ETH_IS_IPV4_HDR(mbuf->packet_type)) {\n+\t\t\t\t/* Handle IPv4 headers.*/\n+\t\t\t\tipv4_hdr = rte_pktmbuf_mtod_offset(mbuf,\n+\t\t\t\t\t\tstruct rte_ipv4_hdr *,\n+\t\t\t\t\t\tsizeof(struct rte_ether_hdr));\n+\n+\t\t\t\tif (is_valid_ipv4_pkt(ipv4_hdr, mbuf->pkt_len)\n+\t\t\t\t\t\t< 0) {\n+\t\t\t\t\tmbuf->port = BAD_PORT;\n+\t\t\t\t\tcontinue;\n+\t\t\t\t}\n+\t\t\t\t/* Update time to live and header checksum */\n+\t\t\t\t--(ipv4_hdr->time_to_live);\n+\t\t\t\t++(ipv4_hdr->hdr_checksum);\n+\t\t\t}\n+#endif\n+\t\t\t/* dst addr */\n+\t\t\t*(uint64_t *)&eth_hdr->d_addr = dest_eth_addr[\n+\t\t\t\t\t\t\t\tmbuf->port];\n+\t\t\t/* src addr */\n+\t\t\trte_ether_addr_copy(&ports_eth_addr[mbuf->port],\n+\t\t\t\t\t&eth_hdr->s_addr);\n+#endif\n+\t\t\tif (flags & L3FWD_EVENT_TX_ENQ) {\n+\t\t\t\tevents[i].queue_id = tx_q_id;\n+\t\t\t\tevents[i].op = RTE_EVENT_OP_FORWARD;\n+\t\t\t}\n+\n+\t\t\tif (flags & L3FWD_EVENT_TX_DIRECT)\n+\t\t\t\trte_event_eth_tx_adapter_txq_set(mbuf, 0);\n+\t\t}\n+\n+\t\tif (flags & L3FWD_EVENT_TX_ENQ) {\n+\t\t\tnb_enq = rte_event_enqueue_burst(event_d_id, event_p_id,\n+\t\t\t\t\tevents, nb_deq);\n+\t\t\twhile (nb_enq < nb_deq && !force_quit)\n+\t\t\t\tnb_enq += rte_event_enqueue_burst(event_d_id,\n+\t\t\t\t\t\tevent_p_id, events + nb_enq,\n+\t\t\t\t\t\tnb_deq - nb_enq);\n+\t\t}\n+\n+\t\tif (flags & L3FWD_EVENT_TX_DIRECT) {\n+\t\t\tnb_enq = rte_event_eth_tx_adapter_enqueue(event_d_id,\n+\t\t\t\t\tevent_p_id, events, nb_deq);\n+\t\t\twhile (nb_enq < nb_deq && !force_quit)\n+\t\t\t\tnb_enq += rte_event_eth_tx_adapter_enqueue(\n+\t\t\t\t\t\tevent_d_id, event_p_id,\n+\t\t\t\t\t\tevents + nb_enq,\n+\t\t\t\t\t\tnb_deq - nb_enq);\n+\t\t}\n+\t}\n+}\n+\n+static __rte_always_inline void\n+lpm_event_loop(struct l3fwd_eventdev_resources *evdev_rsrc,\n+\t\t const uint8_t flags)\n+{\n+\tif (flags & L3FWD_EVENT_SINGLE)\n+\t\tlpm_event_loop_single(evdev_rsrc, flags);\n+\tif (flags & L3FWD_EVENT_BURST)\n+\t\tlpm_event_loop_burst(evdev_rsrc, flags);\n+}\n+\n+#define LPM_FP(_name, _f2, _f1, flags)\t\t\t\t\t\\\n+int __rte_noinline\t\t\t\t\t\t\t\\\n+lpm_event_main_loop_ ## _name(__attribute__((unused)) void *dummy)\t\\\n+{\t\t\t\t\t\t\t\t\t\\\n+\tstruct l3fwd_eventdev_resources *evdev_rsrc =\t\t\t\\\n+\t\t\t\t\tl3fwd_get_eventdev_rsrc();\t\\\n+\t\t\t\t\t\t\t\t\t\\\n+\tlpm_event_loop(evdev_rsrc, flags);\t\t\t\t\\\n+\treturn 0;\t\t\t\t\t\t\t\\\n+}\n+\n+L3FWD_LPM_EVENT_MODE\n+#undef LPM_FP\n+\n void\n setup_lpm(const int socketid)\n {\ndiff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c\nindex 8fec381ef..dd371b945 100644\n--- a/examples/l3fwd/main.c\n+++ b/examples/l3fwd/main.c\n@@ -942,13 +942,18 @@ main(int argc, char **argv)\n \tif (ret < 0)\n \t\trte_exit(EXIT_FAILURE, \"Invalid L3FWD parameters\\n\");\n \n+\t/* Setup function pointers for lookup method. */\n+\tsetup_l3fwd_lookup_tables();\n+\n \tevdev_rsrc->per_port_pool = per_port_pool;\n \tevdev_rsrc->pkt_pool = pktmbuf_pool;\n \tevdev_rsrc->port_mask = enabled_port_mask;\n \t/* Configure eventdev parameters if user has requested */\n \tl3fwd_eventdev_resource_setup(&port_conf);\n-\tif (evdev_rsrc->enabled)\n+\tif (evdev_rsrc->enabled) {\n+\t\tl3fwd_lkp.main_loop = evdev_rsrc->ops.lpm_event_loop;\n \t\tgoto skip_port_config;\n+\t}\n \n \tif (check_lcore_params() < 0)\n \t\trte_exit(EXIT_FAILURE, \"check_lcore_params failed\\n\");\n@@ -964,9 +969,6 @@ main(int argc, char **argv)\n \n \tnb_lcores = rte_lcore_count();\n \n-\t/* Setup function pointers for lookup method. */\n-\tsetup_l3fwd_lookup_tables();\n-\n \t/* initialize all ports */\n \tRTE_ETH_FOREACH_DEV(portid) {\n \t\tstruct rte_eth_conf local_port_conf = port_conf;\n",
    "prefixes": [
        "08/11"
    ]
}