Show a cover letter.

GET /api/covers/129332/?format=api
HTTP 200 OK
Allow: GET, HEAD, OPTIONS
Content-Type: application/json
Vary: Accept

{
    "id": 129332,
    "url": "http://patchwork.dpdk.org/api/covers/129332/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/cover/20230706095004.1848199-1-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-1-feifei.wang2@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230706095004.1848199-1-feifei.wang2@arm.com",
    "date": "2023-07-06T09:50:00",
    "name": "[v7,0/4] Recycle mbufs from Tx queue to Rx queue",
    "submitter": {
        "id": 1771,
        "url": "http://patchwork.dpdk.org/api/people/1771/?format=api",
        "name": "Feifei Wang",
        "email": "feifei.wang2@arm.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/cover/20230706095004.1848199-1-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/covers/129332/comments/",
    "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 5472F42DE6;\n\tThu,  6 Jul 2023 11:50:15 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 377C7410FA;\n\tThu,  6 Jul 2023 11:50:15 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id CFB3D40A79\n for <dev@dpdk.org>; Thu,  6 Jul 2023 11:50:13 +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 664882F4;\n Thu,  6 Jul 2023 02:50:55 -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 BC8873F663;\n Thu,  6 Jul 2023 02:50:10 -0700 (PDT)"
        ],
        "From": "Feifei Wang <feifei.wang2@arm.com>",
        "To": "",
        "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>",
        "Subject": "[PATCH v7 0/4] Recycle mbufs from Tx queue to Rx queue",
        "Date": "Thu,  6 Jul 2023 17:50:00 +0800",
        "Message-Id": "<20230706095004.1848199-1-feifei.wang2@arm.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "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": "Currently, the transmit side frees the buffers into the lcore cache and\nthe receive side allocates buffers from the lcore cache. The transmit\nside typically frees 32 buffers resulting in 32*8=256B of stores to\nlcore cache. The receive side allocates 32 buffers and stores them in\nthe receive side software ring, resulting in 32*8=256B of stores and\n256B of load from the lcore cache.\n\nThis patch proposes a mechanism to avoid freeing to/allocating from\nthe lcore cache. i.e. the receive side will free the buffers from\ntransmit side directly into its software ring. This will avoid the 256B\nof loads and stores introduced by the lcore cache. It also frees up the\ncache lines used by the lcore cache. And we can call this mode as mbufs\nrecycle mode.\n\nIn the latest version, mbufs recycle mode is packaged as a separate API. \nThis allows for the users to change rxq/txq pairing in real time in data plane,\naccording to the analysis of the packet flow by the application, for example:\n-----------------------------------------------------------------------\nStep 1: upper application analyse the flow direction\nStep 2: recycle_rxq_info = rte_eth_recycle_rx_queue_info_get(rx_portid, rx_queueid)\nStep 3: rte_eth_recycle_mbufs(rx_portid, rx_queueid, tx_portid, tx_queueid, recycle_rxq_info);\nStep 4: rte_eth_rx_burst(rx_portid,rx_queueid);\nStep 5: rte_eth_tx_burst(tx_portid,tx_queueid);\n-----------------------------------------------------------------------\nAbove can support user to change rxq/txq pairing  at run-time and user does not need to\nknow the direction of flow in advance. This can effectively expand mbufs recycle mode's\nuse scenarios.\n\nFurthermore, mbufs recycle mode is no longer limited to the same pmd,\nit can support moving mbufs between different vendor pmds, even can put the mbufs\nanywhere into your Rx mbuf ring as long as the address of the mbuf ring can be provided.\nIn the latest version, we enable mbufs recycle mode in i40e pmd and ixgbe pmd, and also try to\nuse i40e driver in Rx, ixgbe driver in Tx, and then achieve 7-9% performance improvement\nby mbufs recycle mode.\n\nDifference between mbuf recycle, ZC API used in mempool and general path\nFor general path: \n                Rx: 32 pkts memcpy from mempool cache to rx_sw_ring\n                Tx: 32 pkts memcpy from tx_sw_ring to temporary variable + 32 pkts memcpy from temporary variable to mempool cache\nFor ZC API used in mempool:\n                Rx: 32 pkts memcpy from mempool cache to rx_sw_ring\n                Tx: 32 pkts memcpy from tx_sw_ring to zero-copy mempool cache\n                Refer link: http://patches.dpdk.org/project/dpdk/patch/20230221055205.22984-2-kamalakshitha.aligeri@arm.com/\nFor mbufs recycle:\n                Rx/Tx: 32 pkts memcpy from tx_sw_ring to rx_sw_ring\nThus we can see in the one loop, compared to general path, mbufs recycle mode reduces 32+32=64 pkts memcpy;\nCompared to ZC API used in mempool, we can see mbufs recycle mode reduce 32 pkts memcpy in each loop.\nSo, mbufs recycle has its own benefits.\n\nTesting status:\n(1) dpdk l3fwd test with multiple drivers:\n    port 0: 82599 NIC   port 1: XL710 NIC\n-------------------------------------------------------------\n\t\tWithout fast free\tWith fast free\nThunderx2:      +7.53%\t                +13.54%\n-------------------------------------------------------------\n\n(2) dpdk l3fwd test with same driver:\n    port 0 && 1: XL710 NIC\n-------------------------------------------------------------\n\t\tWithout fast free\tWith fast free\nAmpere altra:   +12.61%\t\t        +11.42%\nn1sdp:\t\t+8.30%\t\t\t+3.85%\nx86-sse:\t+8.43%\t\t\t+3.72%\n-------------------------------------------------------------\n\n(3) Performance comparison with ZC_mempool used\n    port 0 && 1: XL710 NIC\n    with fast free\n-------------------------------------------------------------\n\t\tWith recycle buffer\tWith zc_mempool\nAmpere altra:\t11.42%\t\t\t3.54%\n-------------------------------------------------------------\n\nFurthermore, we add recycle_mbuf engine in testpmd. Due to XL710 NIC has\nI/O bottleneck in testpmd in ampere altra, we can not see throughput change\ncompared with I/O fwd engine. However, using record cmd in testpmd:\n'$set record-burst-stats on'\nwe can see the ratio of 'Rx/Tx burst size of 32' is reduced. This\nindicate mbufs recycle can save CPU cycles.\n\nV2:\n1. Use data-plane API to enable direct-rearm (Konstantin, Honnappa)\n2. Add 'txq_data_get' API to get txq info for Rx (Konstantin)\n3. Use input parameter to enable direct rearm in l3fwd (Konstantin)\n4. Add condition detection for direct rearm API (Morten, Andrew Rybchenko)\n\nV3:\n1. Seperate Rx and Tx operation with two APIs in direct-rearm (Konstantin)\n2. Delete L3fwd change for direct rearm (Jerin)\n3. enable direct rearm in ixgbe driver in Arm\n\nv4:\n1. Rename direct-rearm as buffer recycle. Based on this, function name\nand variable name are changed to let this mode more general for all\ndrivers. (Konstantin, Morten)\n2. Add ring wrapping check (Konstantin)\n\nv5:\n1. some change for ethdev API (Morten)\n2. add support for avx2, sse, altivec path\n\nv6:\n1. fix ixgbe build issue in ppc\n2. remove 'recycle_tx_mbufs_reuse' and 'recycle_rx_descriptors_refill'\n   API wrapper (Tech Board meeting)\n3. add recycle_mbufs engine in testpmd (Tech Board meeting)\n4. add namespace in the functions related to mbufs recycle(Ferruh)\n\nv7:\n1. move 'rxq/txq data' pointers to the beginning of eth_dev structure,\nin order to keep them in the same cache line as rx/tx_burst function\npointers (Morten)\n2. add the extra description for 'rte_eth_recycle_mbufs' to show it can\nsupport feeding 1 Rx queue from 2 Tx queues in the same thread\n(Konstantin)\n3. For i40e/ixgbe driver, make the previous copied buffers as invalid if\nthere are Tx buffers refcnt > 1 or from unexpected mempool (Konstantin)\n4. add check for the return value of 'rte_eth_recycle_rx_queue_info_get'\nin testpmd fwd engine (Morten)\n\nFeifei Wang (4):\n  ethdev: add API for mbufs recycle mode\n  net/i40e: implement mbufs recycle mode\n  net/ixgbe: implement mbufs recycle mode\n  app/testpmd: add recycle mbufs engine\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/rel_notes/release_23_07.rst        |   7 +\n doc/guides/testpmd_app_ug/run_app.rst         |   1 +\n doc/guides/testpmd_app_ug/testpmd_funcs.rst   |   5 +-\n drivers/net/i40e/i40e_ethdev.c                |   1 +\n drivers/net/i40e/i40e_ethdev.h                |   2 +\n .../net/i40e/i40e_recycle_mbufs_vec_common.c  | 147 ++++++++++++++\n drivers/net/i40e/i40e_rxtx.c                  |  32 ++++\n drivers/net/i40e/i40e_rxtx.h                  |   4 +\n drivers/net/i40e/meson.build                  |   1 +\n drivers/net/ixgbe/ixgbe_ethdev.c              |   1 +\n drivers/net/ixgbe/ixgbe_ethdev.h              |   3 +\n .../ixgbe/ixgbe_recycle_mbufs_vec_common.c    | 143 ++++++++++++++\n drivers/net/ixgbe/ixgbe_rxtx.c                |  29 +++\n drivers/net/ixgbe/ixgbe_rxtx.h                |   4 +\n drivers/net/ixgbe/meson.build                 |   1 +\n lib/ethdev/ethdev_driver.h                    |  10 +\n lib/ethdev/ethdev_private.c                   |   2 +\n lib/ethdev/rte_ethdev.c                       |  31 +++\n lib/ethdev/rte_ethdev.h                       | 181 ++++++++++++++++++\n lib/ethdev/rte_ethdev_core.h                  |  23 ++-\n lib/ethdev/version.map                        |   2 +\n 25 files changed, 686 insertions(+), 7 deletions(-)\n create mode 100644 app/test-pmd/recycle_mbufs.c\n create mode 100644 drivers/net/i40e/i40e_recycle_mbufs_vec_common.c\n create mode 100644 drivers/net/ixgbe/ixgbe_recycle_mbufs_vec_common.c"
}