Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/127391/?format=api
http://patches.dpdk.org/api/patches/127391/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230525094541.331338-5-feifei.wang2@arm.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": "<20230525094541.331338-5-feifei.wang2@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20230525094541.331338-5-feifei.wang2@arm.com", "date": "2023-05-25T09:45:41", "name": "[v6,4/4] app/testpmd: add recycle mbufs engine", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "03a754bd6f5dea410b1e8d4816ccf83c8979486f", "submitter": { "id": 1771, "url": "http://patches.dpdk.org/api/people/1771/?format=api", "name": "Feifei Wang", "email": "feifei.wang2@arm.com" }, "delegate": { "id": 319, "url": "http://patches.dpdk.org/api/users/319/?format=api", "username": "fyigit", "first_name": "Ferruh", "last_name": "Yigit", "email": "ferruh.yigit@amd.com" }, "mbox": "http://patches.dpdk.org/project/dpdk/patch/20230525094541.331338-5-feifei.wang2@arm.com/mbox/", "series": [ { "id": 28175, "url": "http://patches.dpdk.org/api/series/28175/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=28175", "date": "2023-05-25T09:45:37", "name": "Recycle mbufs from Tx queue to Rx queue", "version": 6, "mbox": "http://patches.dpdk.org/series/28175/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/127391/comments/", "check": "fail", "checks": "http://patches.dpdk.org/api/patches/127391/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 1323642B98;\n\tThu, 25 May 2023 11:46:21 +0200 (CEST)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 4D9CD42D42;\n\tThu, 25 May 2023 11:46:02 +0200 (CEST)", "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id 1BB5542D41\n for <dev@dpdk.org>; Thu, 25 May 2023 11:46:01 +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 B75371042;\n Thu, 25 May 2023 02:46:45 -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 4EBD03F67D;\n Thu, 25 May 2023 02:45:58 -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, nd@arm.com, Feifei Wang <feifei.wang2@arm.com>,\n Jerin Jacob <jerinjacobk@gmail.com>, Ruifeng Wang <ruifeng.wang@arm.com>", "Subject": "[PATCH v6 4/4] app/testpmd: add recycle mbufs engine", "Date": "Thu, 25 May 2023 17:45:41 +0800", "Message-Id": "<20230525094541.331338-5-feifei.wang2@arm.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20230525094541.331338-1-feifei.wang2@arm.com>", "References": "<20211224164613.32569-1-feifei.wang2@arm.com>\n <20230525094541.331338-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 | 79 +++++++++++++++++++++\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, 89 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..0c603c3ec2\n--- /dev/null\n+++ b/app/test-pmd/recycle_mbufs.c\n@@ -0,0 +1,79 @@\n+/* SPDX-License-Identifier: BSD-3-Clause\n+ * Copyright (c) 2023 Arm Limited.\n+ */\n+\n+#include <stdarg.h>\n+#include <stdio.h>\n+#include <string.h>\n+#include <errno.h>\n+#include <stdint.h>\n+#include <unistd.h>\n+#include <inttypes.h>\n+\n+#include <sys/queue.h>\n+#include <sys/stat.h>\n+\n+#include <rte_common.h>\n+#include <rte_log.h>\n+#include <rte_debug.h>\n+#include <rte_cycles.h>\n+#include <rte_memory.h>\n+#include <rte_launch.h>\n+#include <rte_eal.h>\n+#include <rte_per_lcore.h>\n+#include <rte_lcore.h>\n+#include <rte_branch_prediction.h>\n+#include <rte_mbuf.h>\n+#include <rte_interrupts.h>\n+#include <rte_ether.h>\n+#include <rte_ethdev.h>\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+\t/* Retrieve information about given ports's Rx queue\n+\t * for recycling mbufs.\n+\t */\n+\trte_eth_recycle_rx_queue_info_get(fs->rx_port, fs->rx_queue,\n+\t\t\t&(fs->recycle_rxq_info));\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 5cb6f92523..050e48d79a 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 bdfbfd36d3..34e72fd7d5 100644\n--- a/app/test-pmd/testpmd.h\n+++ b/app/test-pmd/testpmd.h\n@@ -179,6 +179,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@@ -432,6 +434,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 57b23241cf..cbc68acc36 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 8f23847859..482e583263 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": [ "v6", "4/4" ] }{ "id": 127391, "url": "