get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 54229,
    "url": "https://patches.dpdk.org/api/patches/54229/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/1559583160-13944-6-git-send-email-anoobj@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": "<1559583160-13944-6-git-send-email-anoobj@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1559583160-13944-6-git-send-email-anoobj@marvell.com",
    "date": "2019-06-03T17:32:05",
    "name": "[05/39] examples/l2fwd-event: move dataplane code to new file",
    "commit_ref": null,
    "pull_url": null,
    "state": "changes-requested",
    "archived": true,
    "hash": "9524a358758a5aaf97ca39f1876ce41e9b355c1f",
    "submitter": {
        "id": 1205,
        "url": "https://patches.dpdk.org/api/people/1205/?format=api",
        "name": "Anoob Joseph",
        "email": "anoobj@marvell.com"
    },
    "delegate": {
        "id": 310,
        "url": "https://patches.dpdk.org/api/users/310/?format=api",
        "username": "jerin",
        "first_name": "Jerin",
        "last_name": "Jacob",
        "email": "jerinj@marvell.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/1559583160-13944-6-git-send-email-anoobj@marvell.com/mbox/",
    "series": [
        {
            "id": 4868,
            "url": "https://patches.dpdk.org/api/series/4868/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=4868",
            "date": "2019-06-03T17:32:00",
            "name": "adding eventmode helper library",
            "version": 1,
            "mbox": "https://patches.dpdk.org/series/4868/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/54229/comments/",
    "check": "fail",
    "checks": "https://patches.dpdk.org/api/patches/54229/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 B27901B9CC;\n\tMon,  3 Jun 2019 19:33:53 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n\t[67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 25ACC1B9CB\n\tfor <dev@dpdk.org>; Mon,  3 Jun 2019 19:33:52 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n\tby mx0b-0016f401.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id\n\tx53HKPJM027530; Mon, 3 Jun 2019 10:33:51 -0700",
            "from sc-exch02.marvell.com ([199.233.58.182])\n\tby mx0b-0016f401.pphosted.com with ESMTP id 2sw79pr6q6-1\n\t(version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); \n\tMon, 03 Jun 2019 10:33:51 -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, 3 Jun 2019 10:33:48 -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, 3 Jun 2019 10:33:48 -0700",
            "from ajoseph83.caveonetworks.com.com (unknown [10.29.45.56])\n\tby maili.marvell.com (Postfix) with ESMTP id E5E183F703F;\n\tMon,  3 Jun 2019 10:33:43 -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=n0hH40DkGH55FeGJaQGicN5UFGTcE56JrHFfzsn56dU=;\n\tb=KVtfIZUyJ4Efsinag96vtdEI4m9LtJBFf7OJ9lYsYgX5n/aVwzPMHsvAFYcb/8UmkzSi\n\tFhPe17zKOShG33g30hCR/xK8bNZ4Wrwo8WJF/oRks9Vzv+l68OBZMe3Qg+OCK3lIJiQb\n\tC85SpcvPZ/Yg1NCjHf2EM1xNE+EopGsc2QkTlHsLzRb3zdO/KWSslKDsU+tre3LmXfAl\n\t+wBAnJ513E+UTueLV47LKRrJN5NeH7l4pcFycDzcXHriK2BoKH9fJI1SuY6ApD+j9CCd\n\teKch7TmLY66djCFuXK3inBKxLkMdrgjpK6tUK5LgI4KB4YOy6CrhJ9vpU3kEriIOSYuj\n\tVg== ",
        "From": "Anoob Joseph <anoobj@marvell.com>",
        "To": "Jerin Jacob <jerinj@marvell.com>, Nikhil Rao <nikhil.rao@intel.com>,\n\t\"Erik Gabriel Carrillo\" <erik.g.carrillo@intel.com>, Abhinandan Gujjar\n\t<abhinandan.gujjar@intel.com>,\n\tBruce Richardson <bruce.richardson@intel.com>,\n\tPablo de Lara <pablo.de.lara.guarch@intel.com>",
        "CC": "Anoob Joseph <anoobj@marvell.com>, Narayana Prasad <pathreya@marvell.com>,\n\t<dev@dpdk.org>, Lukasz Bartosik <lbartosik@marvell.com>, Pavan Nikhilesh\n\t<pbhagavatula@marvell.com>, Hemant Agrawal <hemant.agrawal@nxp.com>,\n\t\"Nipun  Gupta\" <nipun.gupta@nxp.com>, Harry van Haaren\n\t<harry.van.haaren@intel.com>, =?utf-8?q?Mattias_R=C3=B6nnblom?=\n\t<mattias.ronnblom@ericsson.com>,  Liang Ma <liang.j.ma@intel.com>",
        "Date": "Mon, 3 Jun 2019 23:02:05 +0530",
        "Message-ID": "<1559583160-13944-6-git-send-email-anoobj@marvell.com>",
        "X-Mailer": "git-send-email 2.7.4",
        "In-Reply-To": "<1559583160-13944-1-git-send-email-anoobj@marvell.com>",
        "References": "<1559583160-13944-1-git-send-email-anoobj@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:, ,\n\tdefinitions=2019-06-03_13:, , signatures=0",
        "Subject": "[dpdk-dev] [PATCH 05/39] examples/l2fwd-event: move dataplane code\n\tto new file",
        "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": "Splitting control path and data path code to two different files.\n\nSigned-off-by: Anoob Joseph <anoobj@marvell.com>\nSigned-off-by: Lukasz Bartosik <lbartosik@marvell.com>\n---\n examples/l2fwd-event/Makefile       |   1 +\n examples/l2fwd-event/l2fwd_worker.c | 231 ++++++++++++++++++++++++++++++++++++\n examples/l2fwd-event/l2fwd_worker.h |  10 ++\n examples/l2fwd-event/main.c         | 189 +----------------------------\n examples/l2fwd-event/meson.build    |   1 +\n 5 files changed, 244 insertions(+), 188 deletions(-)\n create mode 100644 examples/l2fwd-event/l2fwd_worker.c\n create mode 100644 examples/l2fwd-event/l2fwd_worker.h",
    "diff": "diff --git a/examples/l2fwd-event/Makefile b/examples/l2fwd-event/Makefile\nindex 398f7a1..d6bdb9e 100644\n--- a/examples/l2fwd-event/Makefile\n+++ b/examples/l2fwd-event/Makefile\n@@ -6,6 +6,7 @@ APP = l2fwd-event\n \n # all source are stored in SRCS-y\n SRCS-y := main.c\n+SRCS-y += l2fwd_worker.c\n \n # Build using pkg-config variables if possible\n $(shell pkg-config --exists libdpdk)\ndiff --git a/examples/l2fwd-event/l2fwd_worker.c b/examples/l2fwd-event/l2fwd_worker.c\nnew file mode 100644\nindex 0000000..167fe39\n--- /dev/null\n+++ b/examples/l2fwd-event/l2fwd_worker.c\n@@ -0,0 +1,231 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright(c) 2010-2016 Intel Corporation\n+ * Copyright (C) 2019 Marvell International Ltd.\n+ */\n+#include <stdio.h>\n+#include <stdlib.h>\n+#include <string.h>\n+#include <stdint.h>\n+#include <inttypes.h>\n+#include <sys/types.h>\n+#include <sys/queue.h>\n+#include <netinet/in.h>\n+#include <setjmp.h>\n+#include <stdarg.h>\n+#include <ctype.h>\n+#include <errno.h>\n+#include <getopt.h>\n+#include <signal.h>\n+#include <stdbool.h>\n+\n+#include <rte_common.h>\n+#include <rte_log.h>\n+#include <rte_malloc.h>\n+#include <rte_memory.h>\n+#include <rte_memcpy.h>\n+#include <rte_eal.h>\n+#include <rte_launch.h>\n+#include <rte_atomic.h>\n+#include <rte_cycles.h>\n+#include <rte_prefetch.h>\n+#include <rte_lcore.h>\n+#include <rte_per_lcore.h>\n+#include <rte_branch_prediction.h>\n+#include <rte_interrupts.h>\n+#include <rte_random.h>\n+#include <rte_debug.h>\n+#include <rte_ether.h>\n+#include <rte_ethdev.h>\n+#include <rte_mempool.h>\n+#include <rte_mbuf.h>\n+\n+#include \"l2fwd_common.h\"\n+#include \"l2fwd_worker.h\"\n+\n+/* Print out statistics on packets dropped */\n+static void\n+print_stats(void)\n+{\n+\tuint64_t total_packets_dropped, total_packets_tx, total_packets_rx;\n+\tunsigned int portid;\n+\n+\ttotal_packets_dropped = 0;\n+\ttotal_packets_tx = 0;\n+\ttotal_packets_rx = 0;\n+\n+\tconst char clr[] = { 27, '[', '2', 'J', '\\0' };\n+\tconst char topLeft[] = { 27, '[', '1', ';', '1', 'H', '\\0' };\n+\n+\t\t/* Clear screen and move to top left */\n+\tprintf(\"%s%s\", clr, topLeft);\n+\n+\tprintf(\"\\nPort statistics ====================================\");\n+\n+\tfor (portid = 0; portid < RTE_MAX_ETHPORTS; portid++) {\n+\t\t/* skip disabled ports */\n+\t\tif ((l2fwd_enabled_port_mask & (1 << portid)) == 0)\n+\t\t\tcontinue;\n+\t\tprintf(\"\\nStatistics for port %u ------------------------------\"\n+\t\t\t   \"\\nPackets sent: %24\"PRIu64\n+\t\t\t   \"\\nPackets received: %20\"PRIu64\n+\t\t\t   \"\\nPackets dropped: %21\"PRIu64,\n+\t\t\t   portid,\n+\t\t\t   port_statistics[portid].tx,\n+\t\t\t   port_statistics[portid].rx,\n+\t\t\t   port_statistics[portid].dropped);\n+\n+\t\ttotal_packets_dropped += port_statistics[portid].dropped;\n+\t\ttotal_packets_tx += port_statistics[portid].tx;\n+\t\ttotal_packets_rx += port_statistics[portid].rx;\n+\t}\n+\tprintf(\"\\nAggregate statistics ===============================\"\n+\t\t   \"\\nTotal packets sent: %18\"PRIu64\n+\t\t   \"\\nTotal packets received: %14\"PRIu64\n+\t\t   \"\\nTotal packets dropped: %15\"PRIu64,\n+\t\t   total_packets_tx,\n+\t\t   total_packets_rx,\n+\t\t   total_packets_dropped);\n+\tprintf(\"\\n====================================================\\n\");\n+}\n+\n+static void\n+l2fwd_mac_updating(struct rte_mbuf *m, unsigned int dest_portid)\n+{\n+\tstruct rte_ether_hdr *eth;\n+\tvoid *tmp;\n+\n+\teth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);\n+\n+\t/* 02:00:00:00:00:xx */\n+\ttmp = &eth->d_addr.addr_bytes[0];\n+\t*((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dest_portid << 40);\n+\n+\t/* src addr */\n+\trte_ether_addr_copy(&l2fwd_ports_eth_addr[dest_portid], &eth->s_addr);\n+}\n+\n+static void\n+l2fwd_simple_forward(struct rte_mbuf *m, unsigned int portid)\n+{\n+\tunsigned int dst_port;\n+\tint sent;\n+\tstruct rte_eth_dev_tx_buffer *buffer;\n+\n+\tdst_port = l2fwd_dst_ports[portid];\n+\n+\tif (mac_updating)\n+\t\tl2fwd_mac_updating(m, dst_port);\n+\n+\tbuffer = tx_buffer[dst_port];\n+\tsent = rte_eth_tx_buffer(dst_port, 0, buffer, m);\n+\tif (sent)\n+\t\tport_statistics[dst_port].tx += sent;\n+}\n+\n+/* main processing loop */\n+static void\n+l2fwd_main_loop(void)\n+{\n+\tstruct rte_mbuf *pkts_burst[MAX_PKT_BURST];\n+\tstruct rte_mbuf *m;\n+\tint sent;\n+\tunsigned int lcore_id;\n+\tuint64_t prev_tsc, diff_tsc, cur_tsc, timer_tsc;\n+\tunsigned int i, j, portid, nb_rx;\n+\tstruct lcore_queue_conf *qconf;\n+\tconst uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1)\n+\t\t\t/ US_PER_S * BURST_TX_DRAIN_US;\n+\tstruct rte_eth_dev_tx_buffer *buffer;\n+\n+\tprev_tsc = 0;\n+\ttimer_tsc = 0;\n+\n+\tlcore_id = rte_lcore_id();\n+\tqconf = &lcore_queue_conf[lcore_id];\n+\n+\tif (qconf->n_rx_port == 0) {\n+\t\tRTE_LOG(INFO, L2FWD, \"lcore %u has nothing to do\\n\", lcore_id);\n+\t\treturn;\n+\t}\n+\n+\tRTE_LOG(INFO, L2FWD, \"entering main loop on lcore %u\\n\", lcore_id);\n+\n+\tfor (i = 0; i < qconf->n_rx_port; i++) {\n+\n+\t\tportid = qconf->rx_port_list[i];\n+\t\tRTE_LOG(INFO, L2FWD, \" -- lcoreid=%u portid=%u\\n\", lcore_id,\n+\t\t\tportid);\n+\n+\t}\n+\n+\twhile (!force_quit) {\n+\n+\t\tcur_tsc = rte_rdtsc();\n+\n+\t\t/*\n+\t\t * TX burst queue drain\n+\t\t */\n+\t\tdiff_tsc = cur_tsc - prev_tsc;\n+\t\tif (unlikely(diff_tsc > drain_tsc)) {\n+\n+\t\t\tfor (i = 0; i < qconf->n_rx_port; i++) {\n+\n+\t\t\t\tportid =\n+\t\t\t\t\tl2fwd_dst_ports[qconf->rx_port_list[i]];\n+\t\t\t\tbuffer = tx_buffer[portid];\n+\n+\t\t\t\tsent = rte_eth_tx_buffer_flush(portid, 0,\n+\t\t\t\t\t\t\t       buffer);\n+\t\t\t\tif (sent)\n+\t\t\t\t\tport_statistics[portid].tx += sent;\n+\n+\t\t\t}\n+\n+\t\t\t/* if timer is enabled */\n+\t\t\tif (timer_period > 0) {\n+\n+\t\t\t\t/* advance the timer */\n+\t\t\t\ttimer_tsc += diff_tsc;\n+\n+\t\t\t\t/* if timer has reached its timeout */\n+\t\t\t\tif (unlikely(timer_tsc >= timer_period)) {\n+\n+\t\t\t\t\t/* do this only on master core */\n+\t\t\t\t\tif (lcore_id ==\n+\t\t\t\t\t    rte_get_master_lcore()) {\n+\t\t\t\t\t\tprint_stats();\n+\t\t\t\t\t\t/* reset the timer */\n+\t\t\t\t\t\ttimer_tsc = 0;\n+\t\t\t\t\t}\n+\t\t\t\t}\n+\t\t\t}\n+\n+\t\t\tprev_tsc = cur_tsc;\n+\t\t}\n+\n+\t\t/*\n+\t\t * Read packet from RX queues\n+\t\t */\n+\t\tfor (i = 0; i < qconf->n_rx_port; i++) {\n+\n+\t\t\tportid = qconf->rx_port_list[i];\n+\t\t\tnb_rx = rte_eth_rx_burst(portid, 0,\n+\t\t\t\t\t\t pkts_burst, MAX_PKT_BURST);\n+\n+\t\t\tport_statistics[portid].rx += nb_rx;\n+\n+\t\t\tfor (j = 0; j < nb_rx; j++) {\n+\t\t\t\tm = pkts_burst[j];\n+\t\t\t\trte_prefetch0(rte_pktmbuf_mtod(m, void *));\n+\t\t\t\tl2fwd_simple_forward(m, portid);\n+\t\t\t}\n+\t\t}\n+\t}\n+}\n+\n+int\n+l2fwd_launch_one_lcore(__attribute__((unused)) void *dummy)\n+{\n+\tl2fwd_main_loop();\n+\treturn 0;\n+}\ndiff --git a/examples/l2fwd-event/l2fwd_worker.h b/examples/l2fwd-event/l2fwd_worker.h\nnew file mode 100644\nindex 0000000..dc4da5b\n--- /dev/null\n+++ b/examples/l2fwd-event/l2fwd_worker.h\n@@ -0,0 +1,10 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (C) 2019 Marvell International Ltd.\n+ */\n+#ifndef _L2FWD_WORKER_H_\n+#define _L2FWD_WORKER_H_\n+\n+int\n+l2fwd_launch_one_lcore(__attribute__((unused)) void *dummy);\n+\n+#endif /* _L2FWD_WORKER_H_ */\ndiff --git a/examples/l2fwd-event/main.c b/examples/l2fwd-event/main.c\nindex 67f2bb0..241a8f2 100644\n--- a/examples/l2fwd-event/main.c\n+++ b/examples/l2fwd-event/main.c\n@@ -41,6 +41,7 @@\n #include <rte_mbuf.h>\n \n #include \"l2fwd_common.h\"\n+#include \"l2fwd_worker.h\"\n \n static uint16_t nb_rxd = RTE_TEST_RX_DESC_DEFAULT;\n static uint16_t nb_txd = RTE_TEST_TX_DESC_DEFAULT;\n@@ -58,194 +59,6 @@ static struct rte_eth_conf port_conf = {\n \n struct rte_mempool *l2fwd_pktmbuf_pool;\n \n-/* Print out statistics on packets dropped */\n-static void\n-print_stats(void)\n-{\n-\tuint64_t total_packets_dropped, total_packets_tx, total_packets_rx;\n-\tunsigned int portid;\n-\n-\ttotal_packets_dropped = 0;\n-\ttotal_packets_tx = 0;\n-\ttotal_packets_rx = 0;\n-\n-\tconst char clr[] = { 27, '[', '2', 'J', '\\0' };\n-\tconst char topLeft[] = { 27, '[', '1', ';', '1', 'H', '\\0' };\n-\n-\t\t/* Clear screen and move to top left */\n-\tprintf(\"%s%s\", clr, topLeft);\n-\n-\tprintf(\"\\nPort statistics ====================================\");\n-\n-\tfor (portid = 0; portid < RTE_MAX_ETHPORTS; portid++) {\n-\t\t/* skip disabled ports */\n-\t\tif ((l2fwd_enabled_port_mask & (1 << portid)) == 0)\n-\t\t\tcontinue;\n-\t\tprintf(\"\\nStatistics for port %u ------------------------------\"\n-\t\t\t   \"\\nPackets sent: %24\"PRIu64\n-\t\t\t   \"\\nPackets received: %20\"PRIu64\n-\t\t\t   \"\\nPackets dropped: %21\"PRIu64,\n-\t\t\t   portid,\n-\t\t\t   port_statistics[portid].tx,\n-\t\t\t   port_statistics[portid].rx,\n-\t\t\t   port_statistics[portid].dropped);\n-\n-\t\ttotal_packets_dropped += port_statistics[portid].dropped;\n-\t\ttotal_packets_tx += port_statistics[portid].tx;\n-\t\ttotal_packets_rx += port_statistics[portid].rx;\n-\t}\n-\tprintf(\"\\nAggregate statistics ===============================\"\n-\t\t   \"\\nTotal packets sent: %18\"PRIu64\n-\t\t   \"\\nTotal packets received: %14\"PRIu64\n-\t\t   \"\\nTotal packets dropped: %15\"PRIu64,\n-\t\t   total_packets_tx,\n-\t\t   total_packets_rx,\n-\t\t   total_packets_dropped);\n-\tprintf(\"\\n====================================================\\n\");\n-}\n-\n-static void\n-l2fwd_mac_updating(struct rte_mbuf *m, unsigned int dest_portid)\n-{\n-\tstruct rte_ether_hdr *eth;\n-\tvoid *tmp;\n-\n-\teth = rte_pktmbuf_mtod(m, struct rte_ether_hdr *);\n-\n-\t/* 02:00:00:00:00:xx */\n-\ttmp = &eth->d_addr.addr_bytes[0];\n-\t*((uint64_t *)tmp) = 0x000000000002 + ((uint64_t)dest_portid << 40);\n-\n-\t/* src addr */\n-\trte_ether_addr_copy(&l2fwd_ports_eth_addr[dest_portid], &eth->s_addr);\n-}\n-\n-static void\n-l2fwd_simple_forward(struct rte_mbuf *m, unsigned int portid)\n-{\n-\tunsigned int dst_port;\n-\tint sent;\n-\tstruct rte_eth_dev_tx_buffer *buffer;\n-\n-\tdst_port = l2fwd_dst_ports[portid];\n-\n-\tif (mac_updating)\n-\t\tl2fwd_mac_updating(m, dst_port);\n-\n-\tbuffer = tx_buffer[dst_port];\n-\tsent = rte_eth_tx_buffer(dst_port, 0, buffer, m);\n-\tif (sent)\n-\t\tport_statistics[dst_port].tx += sent;\n-}\n-\n-/* main processing loop */\n-static void\n-l2fwd_main_loop(void)\n-{\n-\tstruct rte_mbuf *pkts_burst[MAX_PKT_BURST];\n-\tstruct rte_mbuf *m;\n-\tint sent;\n-\tunsigned int lcore_id;\n-\tuint64_t prev_tsc, diff_tsc, cur_tsc, timer_tsc;\n-\tunsigned int i, j, portid, nb_rx;\n-\tstruct lcore_queue_conf *qconf;\n-\tconst uint64_t drain_tsc = (rte_get_tsc_hz() + US_PER_S - 1)\n-\t\t\t/ US_PER_S * BURST_TX_DRAIN_US;\n-\tstruct rte_eth_dev_tx_buffer *buffer;\n-\n-\tprev_tsc = 0;\n-\ttimer_tsc = 0;\n-\n-\tlcore_id = rte_lcore_id();\n-\tqconf = &lcore_queue_conf[lcore_id];\n-\n-\tif (qconf->n_rx_port == 0) {\n-\t\tRTE_LOG(INFO, L2FWD, \"lcore %u has nothing to do\\n\", lcore_id);\n-\t\treturn;\n-\t}\n-\n-\tRTE_LOG(INFO, L2FWD, \"entering main loop on lcore %u\\n\", lcore_id);\n-\n-\tfor (i = 0; i < qconf->n_rx_port; i++) {\n-\n-\t\tportid = qconf->rx_port_list[i];\n-\t\tRTE_LOG(INFO, L2FWD, \" -- lcoreid=%u portid=%u\\n\", lcore_id,\n-\t\t\tportid);\n-\n-\t}\n-\n-\twhile (!force_quit) {\n-\n-\t\tcur_tsc = rte_rdtsc();\n-\n-\t\t/*\n-\t\t * TX burst queue drain\n-\t\t */\n-\t\tdiff_tsc = cur_tsc - prev_tsc;\n-\t\tif (unlikely(diff_tsc > drain_tsc)) {\n-\n-\t\t\tfor (i = 0; i < qconf->n_rx_port; i++) {\n-\n-\t\t\t\tportid =\n-\t\t\t\t\tl2fwd_dst_ports[qconf->rx_port_list[i]];\n-\t\t\t\tbuffer = tx_buffer[portid];\n-\n-\t\t\t\tsent = rte_eth_tx_buffer_flush(portid, 0,\n-\t\t\t\t\t\t\t       buffer);\n-\t\t\t\tif (sent)\n-\t\t\t\t\tport_statistics[portid].tx += sent;\n-\n-\t\t\t}\n-\n-\t\t\t/* if timer is enabled */\n-\t\t\tif (timer_period > 0) {\n-\n-\t\t\t\t/* advance the timer */\n-\t\t\t\ttimer_tsc += diff_tsc;\n-\n-\t\t\t\t/* if timer has reached its timeout */\n-\t\t\t\tif (unlikely(timer_tsc >= timer_period)) {\n-\n-\t\t\t\t\t/* do this only on master core */\n-\t\t\t\t\tif (lcore_id ==\n-\t\t\t\t\t    rte_get_master_lcore()) {\n-\t\t\t\t\t\tprint_stats();\n-\t\t\t\t\t\t/* reset the timer */\n-\t\t\t\t\t\ttimer_tsc = 0;\n-\t\t\t\t\t}\n-\t\t\t\t}\n-\t\t\t}\n-\n-\t\t\tprev_tsc = cur_tsc;\n-\t\t}\n-\n-\t\t/*\n-\t\t * Read packet from RX queues\n-\t\t */\n-\t\tfor (i = 0; i < qconf->n_rx_port; i++) {\n-\n-\t\t\tportid = qconf->rx_port_list[i];\n-\t\t\tnb_rx = rte_eth_rx_burst(portid, 0,\n-\t\t\t\t\t\t pkts_burst, MAX_PKT_BURST);\n-\n-\t\t\tport_statistics[portid].rx += nb_rx;\n-\n-\t\t\tfor (j = 0; j < nb_rx; j++) {\n-\t\t\t\tm = pkts_burst[j];\n-\t\t\t\trte_prefetch0(rte_pktmbuf_mtod(m, void *));\n-\t\t\t\tl2fwd_simple_forward(m, portid);\n-\t\t\t}\n-\t\t}\n-\t}\n-}\n-\n-static int\n-l2fwd_launch_one_lcore(__attribute__((unused)) void *dummy)\n-{\n-\tl2fwd_main_loop();\n-\treturn 0;\n-}\n-\n /* display usage */\n static void\n l2fwd_usage(const char *prgname)\ndiff --git a/examples/l2fwd-event/meson.build b/examples/l2fwd-event/meson.build\nindex c34e11e..1d2df49 100644\n--- a/examples/l2fwd-event/meson.build\n+++ b/examples/l2fwd-event/meson.build\n@@ -7,5 +7,6 @@\n # DPDK instance, use 'make'\n \n sources = files(\n+\t'l2fwd_worker.c',\n \t'main.c'\n )\n",
    "prefixes": [
        "05/39"
    ]
}