Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/129336/?format=api
http://patchwork.dpdk.org/api/patches/129336/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20230706095004.1848199-5-feifei.wang2@arm.com/", "project": { "id": 1, "url": "http://patchwork.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": "<20230706095004.1848199-5-feifei.wang2@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230706095004.1848199-5-feifei.wang2@arm.com", "date": "2023-07-06T09:50:04", "name": "[v7,4/4] app/testpmd: add recycle mbufs engine", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "97eba6b5a18a9920b5e8f77217ce12fadc29cae5", "submitter": { "id": 1771, "url": "http://patchwork.dpdk.org/api/people/1771/?format=api", "name": "Feifei Wang", "email": "feifei.wang2@arm.com" }, "delegate": { "id": 319, "url": "http://patchwork.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20230706095004.1848199-5-feifei.wang2@arm.com/mbox/", "series": [ { "id": 28857, "url": "http://patchwork.dpdk.org/api/series/28857/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=28857", "date": "2023-07-06T09:50:00", "name": "Recycle mbufs from Tx queue to Rx queue", "version": 7, "mbox": "http://patchwork.dpdk.org/series/28857/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/129336/comments/", "check": "fail", "checks": "http://patchwork.dpdk.org/api/patches/129336/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 162E142DE6;\n\tThu, 6 Jul 2023 11:50:39 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 1ED4042FA0;\n\tThu, 6 Jul 2023 11:50:32 +0200 (CEST)", "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id 3D5DE42F9C\n for <dev@dpdk.org>; Thu, 6 Jul 2023 11:50:30 +0200 (CEST)", "from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14])\n by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id D73621477;\n Thu, 6 Jul 2023 02:51:11 -0700 (PDT)", "from net-x86-dell-8268.shanghai.arm.com\n (net-x86-dell-8268.shanghai.arm.com [10.169.210.116])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 32C253F663;\n Thu, 6 Jul 2023 02:50:25 -0700 (PDT)" ], "From": "Feifei Wang <feifei.wang2@arm.com>", "To": "Aman Singh <aman.deep.singh@intel.com>,\n Yuying Zhang <yuying.zhang@intel.com>", "Cc": "dev@dpdk.org, ferruh.yigit@amd.com, konstantin.v.ananyev@yandex.ru,\n thomas@monjalon.net, andrew.rybchenko@oktetlabs.ru,\n mb@smartsharesystems.com, nd@arm.com, Feifei Wang <feifei.wang2@arm.com>,\n Jerin Jacob <jerinjacobk@gmail.com>, Ruifeng Wang <ruifeng.wang@arm.com>", "Subject": "[PATCH v7 4/4] app/testpmd: add recycle mbufs engine", "Date": "Thu, 6 Jul 2023 17:50:04 +0800", "Message-Id": "<20230706095004.1848199-5-feifei.wang2@arm.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20230706095004.1848199-1-feifei.wang2@arm.com>", "References": "<20230706095004.1848199-1-feifei.wang2@arm.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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" }, "content": "Add recycle mbufs engine for testpmd. This engine forward pkts with\nI/O forward mode. But enable mbufs recycle feature to recycle used\ntxq mbufs for rxq mbuf ring, which can bypass mempool path and save\nCPU cycles.\n\nSuggested-by: Jerin Jacob <jerinjacobk@gmail.com>\nSigned-off-by: Feifei Wang <feifei.wang2@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\n---\n app/test-pmd/meson.build | 1 +\n app/test-pmd/recycle_mbufs.c | 58 +++++++++++++++++++++\n app/test-pmd/testpmd.c | 1 +\n app/test-pmd/testpmd.h | 3 ++\n doc/guides/testpmd_app_ug/run_app.rst | 1 +\n doc/guides/testpmd_app_ug/testpmd_funcs.rst | 5 +-\n 6 files changed, 68 insertions(+), 1 deletion(-)\n create mode 100644 app/test-pmd/recycle_mbufs.c", "diff": "diff --git a/app/test-pmd/meson.build b/app/test-pmd/meson.build\nindex d2e3f60892..6e5f067274 100644\n--- a/app/test-pmd/meson.build\n+++ b/app/test-pmd/meson.build\n@@ -22,6 +22,7 @@ sources = files(\n 'macswap.c',\n 'noisy_vnf.c',\n 'parameters.c',\n+\t'recycle_mbufs.c',\n 'rxonly.c',\n 'shared_rxq_fwd.c',\n 'testpmd.c',\ndiff --git a/app/test-pmd/recycle_mbufs.c b/app/test-pmd/recycle_mbufs.c\nnew file mode 100644\nindex 0000000000..6e9e1c5eb6\n--- /dev/null\n+++ b/app/test-pmd/recycle_mbufs.c\n@@ -0,0 +1,58 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (c) 2023 Arm Limited.\n+ */\n+\n+#include \"testpmd.h\"\n+\n+/*\n+ * Forwarding of packets in I/O mode.\n+ * Enable mbufs recycle mode to recycle txq used mbufs\n+ * for rxq mbuf ring. This can bypass mempool path and\n+ * save CPU cycles.\n+ */\n+static bool\n+pkt_burst_recycle_mbufs(struct fwd_stream *fs)\n+{\n+\tstruct rte_mbuf *pkts_burst[MAX_PKT_BURST];\n+\tuint16_t nb_rx;\n+\n+\t/* Recycle used mbufs from the txq, and move these mbufs into\n+\t * the rxq mbuf ring.\n+\t */\n+\trte_eth_recycle_mbufs(fs->rx_port, fs->rx_queue,\n+\t\t\tfs->tx_port, fs->tx_queue, &(fs->recycle_rxq_info));\n+\n+\t/*\n+\t * Receive a burst of packets and forward them.\n+\t */\n+\tnb_rx = common_fwd_stream_receive(fs, pkts_burst, nb_pkt_per_burst);\n+\tif (unlikely(nb_rx == 0))\n+\t\treturn false;\n+\n+\tcommon_fwd_stream_transmit(fs, pkts_burst, nb_rx);\n+\n+\treturn true;\n+}\n+\n+static void\n+recycle_mbufs_stream_init(struct fwd_stream *fs)\n+{\n+\tint rc;\n+\n+\t/* Retrieve information about given ports's Rx queue\n+\t * for recycling mbufs.\n+\t */\n+\trc = rte_eth_recycle_rx_queue_info_get(fs->rx_port,\n+\t\t\tfs->rx_queue, &(fs->recycle_rxq_info));\n+\tif (rc != 0)\n+\t\tTESTPMD_LOG(WARNING,\n+\t\t\t\"Failed to get rx queue mbufs recycle info\\n\");\n+\n+\tcommon_fwd_stream_init(fs);\n+}\n+\n+struct fwd_engine recycle_mbufs_engine = {\n+\t.fwd_mode_name = \"recycle_mbufs\",\n+\t.stream_init = recycle_mbufs_stream_init,\n+\t.packet_fwd = pkt_burst_recycle_mbufs,\n+};\ndiff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c\nindex 1fc70650e0..b10128bb77 100644\n--- a/app/test-pmd/testpmd.c\n+++ b/app/test-pmd/testpmd.c\n@@ -199,6 +199,7 @@ struct fwd_engine * fwd_engines[] = {\n \t&icmp_echo_engine,\n \t&noisy_vnf_engine,\n \t&five_tuple_swap_fwd_engine,\n+\t&recycle_mbufs_engine,\n #ifdef RTE_LIBRTE_IEEE1588\n \t&ieee1588_fwd_engine,\n #endif\ndiff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h\nindex 1761768add..f1ddea16bd 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -188,6 +188,8 @@ struct fwd_stream {\n \tstruct pkt_burst_stats rx_burst_stats;\n \tstruct pkt_burst_stats tx_burst_stats;\n \tstruct fwd_lcore *lcore; /**< Lcore being scheduled. */\n+\t/**< Rx queue information for recycling mbufs */\n+\tstruct rte_eth_recycle_rxq_info recycle_rxq_info;\n };\n \n /**\n@@ -448,6 +450,7 @@ extern struct fwd_engine csum_fwd_engine;\n extern struct fwd_engine icmp_echo_engine;\n extern struct fwd_engine noisy_vnf_engine;\n extern struct fwd_engine five_tuple_swap_fwd_engine;\n+extern struct fwd_engine recycle_mbufs_engine;\n #ifdef RTE_LIBRTE_IEEE1588\n extern struct fwd_engine ieee1588_fwd_engine;\n #endif\ndiff --git a/doc/guides/testpmd_app_ug/run_app.rst b/doc/guides/testpmd_app_ug/run_app.rst\nindex 6e9c552e76..24a086401e 100644\n--- a/doc/guides/testpmd_app_ug/run_app.rst\n+++ b/doc/guides/testpmd_app_ug/run_app.rst\n@@ -232,6 +232,7 @@ The command line options are:\n noisy\n 5tswap\n shared-rxq\n+ recycle_mbufs\n \n * ``--rss-ip``\n \ndiff --git a/doc/guides/testpmd_app_ug/testpmd_funcs.rst b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\nindex b755c38c98..723ccb28cb 100644\n--- a/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n+++ b/doc/guides/testpmd_app_ug/testpmd_funcs.rst\n@@ -318,7 +318,7 @@ set fwd\n Set the packet forwarding mode::\n \n testpmd> set fwd (io|mac|macswap|flowgen| \\\n- rxonly|txonly|csum|icmpecho|noisy|5tswap|shared-rxq) (\"\"|retry)\n+ rxonly|txonly|csum|icmpecho|noisy|5tswap|shared-rxq|recycle_mbufs) (\"\"|retry)\n \n ``retry`` can be specified for forwarding engines except ``rx_only``.\n \n@@ -364,6 +364,9 @@ The available information categories are:\n * ``shared-rxq``: Receive only for shared Rx queue.\n Resolve packet source port from mbuf and update stream statistics accordingly.\n \n+* ``recycle_mbufs``: Recycle Tx queue used mbufs for Rx queue mbuf ring.\n+ This mode uses fast path mbuf recycle feature and forwards packets in I/O mode.\n+\n Example::\n \n testpmd> set fwd rxonly\n", "prefixes": [ "v7", "4/4" ] }{ "id": 129336, "url": "