get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 61156,
    "url": "http://patches.dpdk.org/api/patches/61156/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191014182247.961-9-pbhagavatula@marvell.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": "<20191014182247.961-9-pbhagavatula@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191014182247.961-9-pbhagavatula@marvell.com",
    "date": "2019-10-14T18:22:45",
    "name": "[v6,08/10] examples/l2fwd-event: add eventdev main loop",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "e197b7d3df3e53972d4d950fb9d708cee5f0f061",
    "submitter": {
        "id": 1183,
        "url": "http://patches.dpdk.org/api/people/1183/?format=api",
        "name": "Pavan Nikhilesh Bhagavatula",
        "email": "pbhagavatula@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "http://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20191014182247.961-9-pbhagavatula@marvell.com/mbox/",
    "series": [
        {
            "id": 6839,
            "url": "http://patches.dpdk.org/api/series/6839/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=6839",
            "date": "2019-10-14T18:22:37",
            "name": "example/l2fwd-event: introduce l2fwd-event example",
            "version": 6,
            "mbox": "http://patches.dpdk.org/series/6839/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/61156/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/61156/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 8E38E1D404;\n\tMon, 14 Oct 2019 20:23:32 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n\t[67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 792551D380\n\tfor <dev@dpdk.org>; Mon, 14 Oct 2019 20:23:28 +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\tx9EIM5VX024857; Mon, 14 Oct 2019 11:23:28 -0700",
            "from sc-exch02.marvell.com ([199.233.58.182])\n\tby mx0b-0016f401.pphosted.com with ESMTP id 2vkebnxsey-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 14 Oct 2019 11:23:27 -0700",
            "from SC-EXCH01.marvell.com (10.93.176.81) by SC-EXCH02.marvell.com\n\t(10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3;\n\tMon, 14 Oct 2019 11:23:26 -0700",
            "from maili.marvell.com (10.93.176.43) by SC-EXCH01.marvell.com\n\t(10.93.176.81) with Microsoft SMTP Server id 15.0.1367.3 via Frontend\n\tTransport; Mon, 14 Oct 2019 11:23:26 -0700",
            "from BG-LT7430.marvell.com (pe-lt7585.marvell.com [10.28.17.46])\n\tby maili.marvell.com (Postfix) with ESMTP id 8B7203F703F;\n\tMon, 14 Oct 2019 11:23:22 -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=NV0xdLw88h5wtw4TRDBI9VfkQLVAQ4CfwcCnp4p2QXg=;\n\tb=wXb8VjxtTQ+/lQ2o42lvKQ2tdPH6CEo37xlkDFqGkfXi69ETiWmNJ7bTODSUBnC3VMlt\n\tY7pW/ColIA/QZnF1srUV/7YigzbUdeC9/bPL6r3rHiW9dDi899NSo9VUhPDNL8YMJWq2\n\tyiAzJHr9uxUgQIQasMmCE+Dv0h+13VAT240IAczFhFBrxdD3tO/bFt24LmGlX+3518p1\n\tKdr1mI8+0vD5V7a+Ok+ftXBC3k6mJb9HbeNO9w5oKGQVClJh0jEtfWFv8f/aBIOAldVZ\n\ttYC9PpDN99CHSsjGOIe+11Pkc4kI1Jc0w0pKFs/MFMsygDawzksLsJnYmPrkufsZz+uW\n\t7w== ",
        "From": "<pbhagavatula@marvell.com>",
        "To": "<jerinj@marvell.com>, <bruce.richardson@intel.com>,\n\t<hemant.agrawal@nxp.com>, Marko Kovacevic <marko.kovacevic@intel.com>,\n\t\"Ori Kam\" <orika@mellanox.com>, Radu Nicolau <radu.nicolau@intel.com>,\n\tAkhil Goyal <akhil.goyal@nxp.com>,\n\tTomasz Kantecki <tomasz.kantecki@intel.com>, \"Sunil\n\tKumar Kori\" <skori@marvell.com>,\n\tPavan Nikhilesh <pbhagavatula@marvell.com>",
        "CC": "<dev@dpdk.org>",
        "Date": "Mon, 14 Oct 2019 23:52:45 +0530",
        "Message-ID": "<20191014182247.961-9-pbhagavatula@marvell.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191014182247.961-1-pbhagavatula@marvell.com>",
        "References": "<20191002205754.11746-1-pbhagavatula@marvell.com>\n\t<20191014182247.961-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-10-14_09:2019-10-11,2019-10-14 signatures=0",
        "Subject": "[dpdk-dev] [PATCH v6 08/10] examples/l2fwd-event: add eventdev main\n\tloop",
        "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 event dev main loop based on enabled l2fwd options and eventdev\ncapabilities.\n\nSigned-off-by: Pavan Nikhilesh <pbhagavatula@marvell.com>\n---\n examples/l2fwd-event/l2fwd_common.c |   6 +\n examples/l2fwd-event/l2fwd_common.h |   1 +\n examples/l2fwd-event/l2fwd_event.c  | 276 ++++++++++++++++++++++++++++\n examples/l2fwd-event/l2fwd_event.h  |   2 +\n examples/l2fwd-event/main.c         |   6 +-\n 5 files changed, 290 insertions(+), 1 deletion(-)",
    "diff": "diff --git a/examples/l2fwd-event/l2fwd_common.c b/examples/l2fwd-event/l2fwd_common.c\nindex 8edbe1ba5..67441a316 100644\n--- a/examples/l2fwd-event/l2fwd_common.c\n+++ b/examples/l2fwd-event/l2fwd_common.c\n@@ -65,6 +65,12 @@ l2fwd_event_init_ports(struct l2fwd_resources *rsrc)\n \tuint16_t port_id;\n \tint ret;\n \n+\tif (rsrc->event_mode) {\n+\t\tport_conf.rxmode.mq_mode = ETH_MQ_RX_RSS;\n+\t\tport_conf.rx_adv_conf.rss_conf.rss_key = NULL;\n+\t\tport_conf.rx_adv_conf.rss_conf.rss_hf = ETH_RSS_IP;\n+\t}\n+\n \t/* Initialise each port */\n \tRTE_ETH_FOREACH_DEV(port_id) {\n \t\tstruct rte_eth_conf local_port_conf = port_conf;\ndiff --git a/examples/l2fwd-event/l2fwd_common.h b/examples/l2fwd-event/l2fwd_common.h\nindex 7ce78da3d..e484946dc 100644\n--- a/examples/l2fwd-event/l2fwd_common.h\n+++ b/examples/l2fwd-event/l2fwd_common.h\n@@ -114,6 +114,7 @@ l2fwd_get_rsrc(void)\n \n \t\tmemset(rsrc, 0, sizeof(struct l2fwd_resources));\n \t\trsrc->mac_updating = true;\n+\t\trsrc->event_mode = true;\n \t\trsrc->rx_queue_per_lcore = 1;\n \t\trsrc->sched_type = RTE_SCHED_TYPE_ATOMIC;\n \t\trsrc->timer_period = 10 * rte_get_timer_hz();\ndiff --git a/examples/l2fwd-event/l2fwd_event.c b/examples/l2fwd-event/l2fwd_event.c\nindex 562d61292..634f9974e 100644\n--- a/examples/l2fwd-event/l2fwd_event.c\n+++ b/examples/l2fwd-event/l2fwd_event.c\n@@ -17,6 +17,12 @@\n \n #include \"l2fwd_event.h\"\n \n+#define L2FWD_EVENT_SINGLE\t0x1\n+#define L2FWD_EVENT_BURST\t0x2\n+#define L2FWD_EVENT_TX_DIRECT\t0x4\n+#define L2FWD_EVENT_TX_ENQ\t0x8\n+#define L2FWD_EVENT_UPDT_MAC\t0x10\n+\n static inline int\n l2fwd_event_service_enable(uint32_t service_id)\n {\n@@ -122,11 +128,271 @@ l2fwd_event_capability_setup(struct l2fwd_event_resources *evt_rsrc)\n \t\tl2fwd_event_set_internal_port_ops(&evt_rsrc->ops);\n }\n \n+static __rte_noinline int\n+l2fwd_get_free_event_port(struct l2fwd_event_resources *evt_rsrc)\n+{\n+\tstatic int index;\n+\tint port_id;\n+\n+\trte_spinlock_lock(&evt_rsrc->evp.lock);\n+\tif (index >= evt_rsrc->evp.nb_ports) {\n+\t\tprintf(\"No free event port is available\\n\");\n+\t\treturn -1;\n+\t}\n+\n+\tport_id = evt_rsrc->evp.event_p_id[index];\n+\tindex++;\n+\trte_spinlock_unlock(&evt_rsrc->evp.lock);\n+\n+\treturn port_id;\n+}\n+\n+static  __rte_always_inline void\n+l2fwd_event_fwd(struct l2fwd_resources *rsrc, struct rte_event *ev,\n+\t\tconst uint8_t tx_q_id, const uint64_t timer_period,\n+\t\tconst uint32_t flags)\n+{\n+\tstruct rte_mbuf *mbuf = ev->mbuf;\n+\tuint16_t dst_port;\n+\n+\trte_prefetch0(rte_pktmbuf_mtod(mbuf, void *));\n+\tdst_port = rsrc->dst_ports[mbuf->port];\n+\n+\tif (timer_period > 0)\n+\t\t__atomic_fetch_add(&rsrc->port_stats[mbuf->port].rx,\n+\t\t\t\t1, __ATOMIC_RELAXED);\n+\tmbuf->port = dst_port;\n+\n+\tif (flags & L2FWD_EVENT_UPDT_MAC)\n+\t\tl2fwd_mac_updating(mbuf, dst_port, &rsrc->eth_addr[dst_port]);\n+\n+\tif (flags & L2FWD_EVENT_TX_ENQ) {\n+\t\tev->queue_id = tx_q_id;\n+\t\tev->op = RTE_EVENT_OP_FORWARD;\n+\t}\n+\n+\tif (flags & L2FWD_EVENT_TX_DIRECT)\n+\t\trte_event_eth_tx_adapter_txq_set(mbuf, 0);\n+\n+\tif (timer_period > 0)\n+\t\t__atomic_fetch_add(&rsrc->port_stats[mbuf->port].tx,\n+\t\t\t\t1, __ATOMIC_RELAXED);\n+}\n+\n+static __rte_always_inline void\n+l2fwd_event_loop_single(struct l2fwd_resources *rsrc,\n+\t\t\tconst uint32_t flags)\n+{\n+\tconst uint8_t is_master = rte_get_master_lcore() == rte_lcore_id();\n+\tstruct l2fwd_event_resources *evt_rsrc = rsrc->evt_rsrc;\n+\tconst int port_id = l2fwd_get_free_event_port(evt_rsrc);\n+\tuint64_t prev_tsc = 0, diff_tsc, cur_tsc, timer_tsc = 0;\n+\tconst uint64_t timer_period = rsrc->timer_period;\n+\tconst uint8_t tx_q_id = evt_rsrc->evq.event_q_id[\n+\t\t\t\t\tevt_rsrc->evq.nb_queues - 1];\n+\tconst uint8_t event_d_id = evt_rsrc->event_d_id;\n+\tstruct rte_event ev;\n+\n+\tif (port_id < 0)\n+\t\treturn;\n+\n+\tprintf(\"%s(): entering eventdev main loop on lcore %u\\n\", __func__,\n+\t\trte_lcore_id());\n+\n+\twhile (!rsrc->force_quit) {\n+\t\t/* if timer is enabled */\n+\t\tif (is_master && timer_period > 0) {\n+\t\t\tcur_tsc = rte_rdtsc();\n+\t\t\tdiff_tsc = cur_tsc - prev_tsc;\n+\n+\t\t\t/* advance the timer */\n+\t\t\ttimer_tsc += diff_tsc;\n+\n+\t\t\t/* if timer has reached its timeout */\n+\t\t\tif (unlikely(timer_tsc >= timer_period)) {\n+\t\t\t\tprint_stats(rsrc);\n+\t\t\t\t/* reset the timer */\n+\t\t\t\ttimer_tsc = 0;\n+\t\t\t}\n+\t\t\tprev_tsc = cur_tsc;\n+\t\t}\n+\n+\t\t/* Read packet from eventdev */\n+\t\tif (!rte_event_dequeue_burst(event_d_id, port_id, &ev, 1, 0))\n+\t\t\tcontinue;\n+\n+\t\tl2fwd_event_fwd(rsrc, &ev, tx_q_id, timer_period, flags);\n+\n+\t\tif (flags & L2FWD_EVENT_TX_ENQ) {\n+\t\t\twhile (rte_event_enqueue_burst(event_d_id, port_id,\n+\t\t\t\t\t\t       &ev, 1) &&\n+\t\t\t\t\t!rsrc->force_quit)\n+\t\t\t\t;\n+\t\t}\n+\n+\t\tif (flags & L2FWD_EVENT_TX_DIRECT) {\n+\t\t\twhile (!rte_event_eth_tx_adapter_enqueue(event_d_id,\n+\t\t\t\t\t\t\t\tport_id,\n+\t\t\t\t\t\t\t\t&ev, 1, 0) &&\n+\t\t\t\t\t!rsrc->force_quit)\n+\t\t\t\t;\n+\t\t}\n+\t}\n+}\n+\n+static __rte_always_inline void\n+l2fwd_event_loop_burst(struct l2fwd_resources *rsrc,\n+\t\t       const uint32_t flags)\n+{\n+\tconst uint8_t is_master = rte_get_master_lcore() == rte_lcore_id();\n+\tstruct l2fwd_event_resources *evt_rsrc = rsrc->evt_rsrc;\n+\tconst int port_id = l2fwd_get_free_event_port(evt_rsrc);\n+\tuint64_t prev_tsc = 0, diff_tsc, cur_tsc, timer_tsc = 0;\n+\tconst uint64_t timer_period = rsrc->timer_period;\n+\tconst uint8_t tx_q_id = evt_rsrc->evq.event_q_id[\n+\t\t\t\t\tevt_rsrc->evq.nb_queues - 1];\n+\tconst uint8_t event_d_id = evt_rsrc->event_d_id;\n+\tconst uint8_t deq_len = evt_rsrc->deq_depth;\n+\tstruct rte_event ev[MAX_PKT_BURST];\n+\tuint16_t nb_rx, nb_tx;\n+\tuint8_t i;\n+\n+\tif (port_id < 0)\n+\t\treturn;\n+\n+\tprintf(\"%s(): entering eventdev main loop on lcore %u\\n\", __func__,\n+\t\trte_lcore_id());\n+\n+\twhile (!rsrc->force_quit) {\n+\t\t/* if timer is enabled */\n+\t\tif (is_master && timer_period > 0) {\n+\t\t\tcur_tsc = rte_rdtsc();\n+\t\t\tdiff_tsc = cur_tsc - prev_tsc;\n+\n+\t\t\t/* advance the timer */\n+\t\t\ttimer_tsc += diff_tsc;\n+\n+\t\t\t/* if timer has reached its timeout */\n+\t\t\tif (unlikely(timer_tsc >= timer_period)) {\n+\t\t\t\tprint_stats(rsrc);\n+\t\t\t\t/* reset the timer */\n+\t\t\t\ttimer_tsc = 0;\n+\t\t\t}\n+\t\t\tprev_tsc = cur_tsc;\n+\t\t}\n+\n+\t\t/* Read packet from eventdev */\n+\t\tnb_rx = rte_event_dequeue_burst(event_d_id, port_id, ev,\n+\t\t\t\t\t\tdeq_len, 0);\n+\t\tif (nb_rx == 0)\n+\t\t\tcontinue;\n+\n+\t\tfor (i = 0; i < nb_rx; i++) {\n+\t\t\tl2fwd_event_fwd(rsrc, &ev[i], tx_q_id, timer_period,\n+\t\t\t\t\tflags);\n+\t\t}\n+\n+\t\tif (flags & L2FWD_EVENT_TX_ENQ) {\n+\t\t\tnb_tx = rte_event_enqueue_burst(event_d_id, port_id,\n+\t\t\t\t\t\t\tev, nb_rx);\n+\t\t\twhile (nb_tx < nb_rx && !rsrc->force_quit)\n+\t\t\t\tnb_tx += rte_event_enqueue_burst(event_d_id,\n+\t\t\t\t\t\tport_id, ev + nb_tx,\n+\t\t\t\t\t\tnb_rx - nb_tx);\n+\t\t}\n+\n+\t\tif (flags & L2FWD_EVENT_TX_DIRECT) {\n+\t\t\tnb_tx = rte_event_eth_tx_adapter_enqueue(event_d_id,\n+\t\t\t\t\t\t\t\t port_id, ev,\n+\t\t\t\t\t\t\t\t nb_rx, 0);\n+\t\t\twhile (nb_tx < nb_rx && !rsrc->force_quit)\n+\t\t\t\tnb_tx += rte_event_eth_tx_adapter_enqueue(\n+\t\t\t\t\t\tevent_d_id, port_id,\n+\t\t\t\t\t\tev + nb_tx, nb_rx - nb_tx, 0);\n+\t\t}\n+\t}\n+}\n+\n+static __rte_always_inline void\n+l2fwd_event_loop(struct l2fwd_resources *rsrc,\n+\t\t\tconst uint32_t flags)\n+{\n+\tif (flags & L2FWD_EVENT_SINGLE)\n+\t\tl2fwd_event_loop_single(rsrc, flags);\n+\tif (flags & L2FWD_EVENT_BURST)\n+\t\tl2fwd_event_loop_burst(rsrc, flags);\n+}\n+\n+static void __rte_noinline\n+l2fwd_event_main_loop_tx_d(struct l2fwd_resources *rsrc)\n+{\n+\tl2fwd_event_loop(rsrc,\n+\t\t\t L2FWD_EVENT_TX_DIRECT | L2FWD_EVENT_SINGLE);\n+}\n+\n+static void __rte_noinline\n+l2fwd_event_main_loop_tx_d_brst(struct l2fwd_resources *rsrc)\n+{\n+\tl2fwd_event_loop(rsrc, L2FWD_EVENT_TX_DIRECT | L2FWD_EVENT_BURST);\n+}\n+\n+static void __rte_noinline\n+l2fwd_event_main_loop_tx_q(struct l2fwd_resources *rsrc)\n+{\n+\tl2fwd_event_loop(rsrc, L2FWD_EVENT_TX_ENQ | L2FWD_EVENT_SINGLE);\n+}\n+\n+static void __rte_noinline\n+l2fwd_event_main_loop_tx_q_brst(struct l2fwd_resources *rsrc)\n+{\n+\tl2fwd_event_loop(rsrc, L2FWD_EVENT_TX_ENQ | L2FWD_EVENT_BURST);\n+}\n+\n+static void __rte_noinline\n+l2fwd_event_main_loop_tx_d_mac(struct l2fwd_resources *rsrc)\n+{\n+\tl2fwd_event_loop(rsrc, L2FWD_EVENT_UPDT_MAC |\n+\t\t\tL2FWD_EVENT_TX_DIRECT | L2FWD_EVENT_SINGLE);\n+}\n+\n+static void __rte_noinline\n+l2fwd_event_main_loop_tx_d_brst_mac(struct l2fwd_resources *rsrc)\n+{\n+\tl2fwd_event_loop(rsrc, L2FWD_EVENT_UPDT_MAC |\n+\t\t\tL2FWD_EVENT_TX_DIRECT | L2FWD_EVENT_BURST);\n+}\n+\n+static void __rte_noinline\n+l2fwd_event_main_loop_tx_q_mac(struct l2fwd_resources *rsrc)\n+{\n+\tl2fwd_event_loop(rsrc, L2FWD_EVENT_UPDT_MAC |\n+\t\t\tL2FWD_EVENT_TX_ENQ | L2FWD_EVENT_SINGLE);\n+}\n+\n+static void __rte_noinline\n+l2fwd_event_main_loop_tx_q_brst_mac(struct l2fwd_resources *rsrc)\n+{\n+\tl2fwd_event_loop(rsrc, L2FWD_EVENT_UPDT_MAC |\n+\t\t\tL2FWD_EVENT_TX_ENQ | L2FWD_EVENT_BURST);\n+}\n+\n void\n l2fwd_event_resource_setup(struct l2fwd_resources *rsrc)\n {\n+\t/* [MAC_UPDT][TX_MODE][BURST] */\n+\tconst event_loop_cb event_loop[2][2][2] = {\n+\t\t[0][0][0] = l2fwd_event_main_loop_tx_d,\n+\t\t[0][0][1] = l2fwd_event_main_loop_tx_d_brst,\n+\t\t[0][1][0] = l2fwd_event_main_loop_tx_q,\n+\t\t[0][1][1] = l2fwd_event_main_loop_tx_q_brst,\n+\t\t[1][0][0] = l2fwd_event_main_loop_tx_d_mac,\n+\t\t[1][0][1] = l2fwd_event_main_loop_tx_d_brst_mac,\n+\t\t[1][1][0] = l2fwd_event_main_loop_tx_q_mac,\n+\t\t[1][1][1] = l2fwd_event_main_loop_tx_q_brst_mac,\n+\t};\n \tstruct l2fwd_event_resources *evt_rsrc;\n \tuint32_t event_queue_cfg;\n+\tint ret;\n \n \tif (!rte_event_dev_count())\n \t\trte_panic(\"No Eventdev found\\n\");\n@@ -152,4 +418,14 @@ l2fwd_event_resource_setup(struct l2fwd_resources *rsrc)\n \n \t/* Rx/Tx adapters configuration */\n \tevt_rsrc->ops.adapter_setup(rsrc);\n+\n+\t/* Start event device */\n+\tret = rte_event_dev_start(evt_rsrc->event_d_id);\n+\tif (ret < 0)\n+\t\trte_panic(\"Error in starting eventdev\\n\");\n+\n+\tevt_rsrc->ops.l2fwd_event_loop = event_loop\n+\t\t\t\t\t[rsrc->mac_updating]\n+\t\t\t\t\t[evt_rsrc->tx_mode_q]\n+\t\t\t\t\t[evt_rsrc->has_burst];\n }\ndiff --git a/examples/l2fwd-event/l2fwd_event.h b/examples/l2fwd-event/l2fwd_event.h\nindex ebfbfe460..78f22e5f9 100644\n--- a/examples/l2fwd-event/l2fwd_event.h\n+++ b/examples/l2fwd-event/l2fwd_event.h\n@@ -18,6 +18,7 @@ typedef void (*event_port_setup_cb)(struct l2fwd_resources *rsrc);\n typedef void (*event_queue_setup_cb)(struct l2fwd_resources *rsrc,\n \t\t\t\t     uint32_t event_queue_cfg);\n typedef void (*adapter_setup_cb)(struct l2fwd_resources *rsrc);\n+typedef void (*event_loop_cb)(struct l2fwd_resources *rsrc);\n \n struct event_queues {\n \tuint8_t *event_q_id;\n@@ -47,6 +48,7 @@ struct event_setup_ops {\n \tevent_queue_setup_cb event_queue_setup;\n \tevent_port_setup_cb event_port_setup;\n \tadapter_setup_cb adapter_setup;\n+\tevent_loop_cb l2fwd_event_loop;\n };\n \n struct l2fwd_event_resources {\ndiff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c\nindex 48a91dc70..c11b057aa 100644\n--- a/examples/l2fwd-event/main.c\n+++ b/examples/l2fwd-event/main.c\n@@ -214,8 +214,12 @@ l2fwd_launch_one_lcore(void *args)\n {\n \tstruct l2fwd_resources *rsrc = args;\n \tstruct l2fwd_poll_resources *poll_rsrc = rsrc->poll_rsrc;\n+\tstruct l2fwd_event_resources *evt_rsrc = rsrc->evt_rsrc;\n \n-\tpoll_rsrc->poll_main_loop(rsrc);\n+\tif (rsrc->event_mode)\n+\t\tevt_rsrc->ops.l2fwd_event_loop(rsrc);\n+\telse\n+\t\tpoll_rsrc->poll_main_loop(rsrc);\n \n \treturn 0;\n }\n",
    "prefixes": [
        "v6",
        "08/10"
    ]
}