get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 125449,
    "url": "http://patches.dpdk.org/api/patches/125449/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20230323104330.3823251-2-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": "<20230323104330.3823251-2-feifei.wang2@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20230323104330.3823251-2-feifei.wang2@arm.com",
    "date": "2023-03-23T10:43:28",
    "name": "[v4,1/3] ethdev: add API for buffer recycle mode",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7e61bd1a6dc4612b579672888371fcb90cefc9a0",
    "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/20230323104330.3823251-2-feifei.wang2@arm.com/mbox/",
    "series": [
        {
            "id": 27516,
            "url": "http://patches.dpdk.org/api/series/27516/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27516",
            "date": "2023-03-23T10:43:27",
            "name": "Recycle buffers from Tx to Rx",
            "version": 4,
            "mbox": "http://patches.dpdk.org/series/27516/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/125449/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/125449/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 DD76542813;\n\tThu, 23 Mar 2023 11:43:46 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id B6660427E9;\n\tThu, 23 Mar 2023 11:43:44 +0100 (CET)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id D430641101\n for <dev@dpdk.org>; Thu, 23 Mar 2023 11:43:42 +0100 (CET)",
            "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 69D14AD7;\n Thu, 23 Mar 2023 03:44:26 -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 267023F766;\n Thu, 23 Mar 2023 03:43:38 -0700 (PDT)"
        ],
        "From": "Feifei Wang <feifei.wang2@arm.com>",
        "To": "Thomas Monjalon <thomas@monjalon.net>,\n Ferruh Yigit <ferruh.yigit@amd.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>",
        "Cc": "dev@dpdk.org, mb@smartsharesystems.com, konstantin.v.ananyev@yandex.ru,\n nd@arm.com, Feifei Wang <feifei.wang2@arm.com>,\n Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,\n Ruifeng Wang <ruifeng.wang@arm.com>",
        "Subject": "[PATCH v4 1/3] ethdev: add API for buffer recycle mode",
        "Date": "Thu, 23 Mar 2023 18:43:28 +0800",
        "Message-Id": "<20230323104330.3823251-2-feifei.wang2@arm.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<20230323104330.3823251-1-feifei.wang2@arm.com>",
        "References": "<20211224164613.32569-1-feifei.wang2@arm.com>\n <20230323104330.3823251-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": "There are 4 upper APIs for buffer recycle mode:\n1. 'rte_eth_rx_queue_buf_recycle_info_get'\nThis is to retrieve buffer ring information about given ports's Rx\nqueue in buffer recycle mode. And due to this, buffer recycle can\nbe no longer limited to the same driver in Rx and Tx.\n\n2. 'rte_eth_dev_buf_recycle'\nUsers can call this API to enable buffer recycle mode in data path.\nThere are 2 internal APIs in it, which is separately for Rx and TX.\n\n3. 'rte_eth_tx_buf_stash'\nInternal API for buffer recycle mode. This is to stash Tx used\nbuffers into Rx buffer ring.\n\n4. 'rte_eth_rx_descriptors_refill'\nInternal API for buffer recycle mode. This is to refill Rx\ndescriptors.\n\nAbove all APIs are just implemented at the upper level.\nFor different APIs, we need to define specific functions separately.\n\nSuggested-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nSuggested-by: Ruifeng Wang <ruifeng.wang@arm.com>\nSigned-off-by: Feifei Wang <feifei.wang2@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\nReviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\n---\n lib/ethdev/ethdev_driver.h   |  10 ++\n lib/ethdev/ethdev_private.c  |   2 +\n lib/ethdev/rte_ethdev.c      |  37 ++++++\n lib/ethdev/rte_ethdev.h      | 230 +++++++++++++++++++++++++++++++++++\n lib/ethdev/rte_ethdev_core.h |  11 ++\n lib/ethdev/version.map       |   6 +\n 6 files changed, 296 insertions(+)",
    "diff": "diff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h\nindex 2c9d615fb5..412f064975 100644\n--- a/lib/ethdev/ethdev_driver.h\n+++ b/lib/ethdev/ethdev_driver.h\n@@ -59,6 +59,10 @@ struct rte_eth_dev {\n \teth_rx_descriptor_status_t rx_descriptor_status;\n \t/** Check the status of a Tx descriptor */\n \teth_tx_descriptor_status_t tx_descriptor_status;\n+\t/** Stash Tx used buffers into RX ring in buffer recycle mode */\n+\teth_tx_buf_stash_t tx_buf_stash;\n+\t/** Refill Rx descriptors in buffer recycle mode */\n+\teth_rx_descriptors_refill_t rx_descriptors_refill;\n \n \t/**\n \t * Device data that is shared between primary and secondary processes\n@@ -504,6 +508,10 @@ typedef void (*eth_rxq_info_get_t)(struct rte_eth_dev *dev,\n typedef void (*eth_txq_info_get_t)(struct rte_eth_dev *dev,\n \tuint16_t tx_queue_id, struct rte_eth_txq_info *qinfo);\n \n+typedef void (*eth_rxq_buf_recycle_info_get_t)(struct rte_eth_dev *dev,\n+\tuint16_t rx_queue_id,\n+\tstruct rte_eth_rxq_buf_recycle_info *rxq_buf_recycle_info);\n+\n typedef int (*eth_burst_mode_get_t)(struct rte_eth_dev *dev,\n \tuint16_t queue_id, struct rte_eth_burst_mode *mode);\n \n@@ -1247,6 +1255,8 @@ struct eth_dev_ops {\n \teth_rxq_info_get_t         rxq_info_get;\n \t/** Retrieve Tx queue information */\n \teth_txq_info_get_t         txq_info_get;\n+\t/** Get Rx queue buffer recycle information */\n+\teth_rxq_buf_recycle_info_get_t rxq_buf_recycle_info_get;\n \teth_burst_mode_get_t       rx_burst_mode_get; /**< Get Rx burst mode */\n \teth_burst_mode_get_t       tx_burst_mode_get; /**< Get Tx burst mode */\n \teth_fw_version_get_t       fw_version_get; /**< Get firmware version */\ndiff --git a/lib/ethdev/ethdev_private.c b/lib/ethdev/ethdev_private.c\nindex 14ec8c6ccf..f8d0ae9226 100644\n--- a/lib/ethdev/ethdev_private.c\n+++ b/lib/ethdev/ethdev_private.c\n@@ -277,6 +277,8 @@ eth_dev_fp_ops_setup(struct rte_eth_fp_ops *fpo,\n \tfpo->rx_queue_count = dev->rx_queue_count;\n \tfpo->rx_descriptor_status = dev->rx_descriptor_status;\n \tfpo->tx_descriptor_status = dev->tx_descriptor_status;\n+\tfpo->tx_buf_stash = dev->tx_buf_stash;\n+\tfpo->rx_descriptors_refill = dev->rx_descriptors_refill;\n \n \tfpo->rxq.data = dev->data->rx_queues;\n \tfpo->rxq.clbk = (void **)(uintptr_t)dev->post_rx_burst_cbs;\ndiff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c\nindex 4d03255683..2e049f2176 100644\n--- a/lib/ethdev/rte_ethdev.c\n+++ b/lib/ethdev/rte_ethdev.c\n@@ -5784,6 +5784,43 @@ rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,\n \treturn 0;\n }\n \n+int\n+rte_eth_rx_queue_buf_recycle_info_get(uint16_t port_id, uint16_t queue_id,\n+\t\tstruct rte_eth_rxq_buf_recycle_info *rxq_buf_recycle_info)\n+{\n+\tstruct rte_eth_dev *dev;\n+\n+\tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n+\tdev = &rte_eth_devices[port_id];\n+\n+\tif (queue_id >= dev->data->nb_rx_queues) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Invalid Rx queue_id=%u\\n\", queue_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (rxq_buf_recycle_info == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Cannot get ethdev port %u Rx queue %u buf_recycle_info to NULL\\n\",\n+\t\t\tport_id, queue_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (dev->data->rx_queues == NULL ||\n+\t\t\tdev->data->rx_queues[queue_id] == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR,\n+\t\t\t   \"Rx queue %\"PRIu16\" of device with port_id=%\"\n+\t\t\t   PRIu16\" has not been setup\\n\",\n+\t\t\t   queue_id, port_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tif (*dev->dev_ops->rxq_buf_recycle_info_get == NULL)\n+\t\treturn -ENOTSUP;\n+\n+\tdev->dev_ops->rxq_buf_recycle_info_get(dev, queue_id, rxq_buf_recycle_info);\n+\n+\treturn 0;\n+}\n+\n int\n rte_eth_rx_burst_mode_get(uint16_t port_id, uint16_t queue_id,\n \t\t\t  struct rte_eth_burst_mode *mode)\ndiff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h\nindex 99fe9e238b..977075782e 100644\n--- a/lib/ethdev/rte_ethdev.h\n+++ b/lib/ethdev/rte_ethdev.h\n@@ -1820,6 +1820,29 @@ struct rte_eth_txq_info {\n \tuint8_t queue_state;        /**< one of RTE_ETH_QUEUE_STATE_*. */\n } __rte_cache_min_aligned;\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this structure may change without prior notice.\n+ *\n+ * Ethernet device Rx queue buffer ring information structure in buffer recycle mode.\n+ * Used to retrieve Rx queue buffer ring information when Tx queue stashing used buffers\n+ * in Rx buffer ring.\n+ */\n+struct rte_eth_rxq_buf_recycle_info {\n+\tstruct rte_mbuf **buf_ring; /**< buffer ring of Rx queue. */\n+\tstruct rte_mempool *mp;     /**< mempool of Rx queue. */\n+\tuint16_t *refill_head;      /**< head of buffer ring refilling descriptors. */\n+\tuint16_t *receive_tail;     /**< tail of buffer ring receiving pkts. */\n+\tuint16_t buf_ring_size;     /**< configured number of buffer ring size. */\n+\t/**\n+\t *  request for number of Rx refill buffers.\n+\t *   For some PMD drivers, Rx refiil buffers number should be aligned with\n+\t *   its buffer ring size. This is to simplify ring wraparound.\n+\t *   Value 0 means that no request for this.\n+\t */\n+\tuint16_t refill_request;\n+} __rte_cache_min_aligned;\n+\n /* Generic Burst mode flag definition, values can be ORed. */\n \n /**\n@@ -4809,6 +4832,32 @@ int rte_eth_rx_queue_info_get(uint16_t port_id, uint16_t queue_id,\n int rte_eth_tx_queue_info_get(uint16_t port_id, uint16_t queue_id,\n \tstruct rte_eth_txq_info *qinfo);\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice\n+ *\n+ * Retrieve buffer ring information about given ports's Rx queue in buffer recycle\n+ * mode.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param queue_id\n+ *   The Rx queue on the Ethernet device for which buffer ring information\n+ *   will be retrieved.\n+ * @param rxq_buf_recycle_info\n+ *   A pointer to a structure of type *rte_eth_rxq_buf_recycle_info* to be filled.\n+ *\n+ * @return\n+ *   - 0: Success\n+ *   - -ENODEV:  If *port_id* is invalid.\n+ *   - -ENOTSUP: routine is not supported by the device PMD.\n+ *   - -EINVAL:  The queue_id is out of range.\n+ */\n+__rte_experimental\n+int rte_eth_rx_queue_buf_recycle_info_get(uint16_t port_id,\n+\t\tuint16_t queue_id,\n+\t\tstruct rte_eth_rxq_buf_recycle_info *rxq_buf_recycle_info);\n+\n /**\n  * Retrieve information about the Rx packet burst mode.\n  *\n@@ -5987,6 +6036,71 @@ rte_eth_rx_queue_count(uint16_t port_id, uint16_t queue_id)\n \treturn (int)(*p->rx_queue_count)(qd);\n }\n \n+/**\n+ * @internal\n+ * Rx routine for rte_eth_dev_buf_recycle().\n+ * Refill Rx descriptors in buffer recycle mode.\n+ *\n+ * @note\n+ * This API can only be called by rte_eth_dev_buf_recycle().\n+ * Before calling this API, rte_eth_tx_buf_stash() should be\n+ * called to stash Tx used buffers into Rx buffer ring.\n+ *\n+ * When this functionality is not implemented in the driver, the return\n+ * buffer number is 0.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param queue_id\n+ *   The index of the receive queue.\n+ *   The value must be in the range [0, nb_rx_queue - 1] previously supplied\n+ *   to rte_eth_dev_configure().\n+ *@param nb\n+ *   The number of Rx descriptors to be refilled.\n+ * @return\n+ *   The number Rx descriptors correct to be refilled.\n+ *   - ENODEV: bad port or queue (only if compiled with debug).\n+ */\n+static inline uint16_t rte_eth_rx_descriptors_refill(uint16_t port_id,\n+\t\tuint16_t queue_id, uint16_t nb)\n+{\n+\tstruct rte_eth_fp_ops *p;\n+\tvoid *qd;\n+\n+#ifdef RTE_ETHDEV_DEBUG_RX\n+\tif (port_id >= RTE_MAX_ETHPORTS ||\n+\t\t\tqueue_id >= RTE_MAX_QUEUES_PER_PORT) {\n+\t\tRTE_ETHDEV_LOG(ERR,\n+\t\t\t\"Invalid port_id=%u or queue_id=%u\\n\",\n+\t\t\tport_id, queue_id);\n+\t\trte_errno = ENODEV;\n+\t\treturn 0;\n+\t}\n+#endif\n+\n+\tp = &rte_eth_fp_ops[port_id];\n+\tqd = p->rxq.data[queue_id];\n+\n+#ifdef RTE_ETHDEV_DEBUG_RX\n+\tif (!rte_eth_dev_is_valid_port(port_id)) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Invalid Rx port_id=%u\\n\", port_id);\n+\t\trte_errno = ENODEV;\n+\t\treturn 0;\n+\n+\tif (qd == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Invalid Rx queue_id=%u for port_id=%u\\n\",\n+\t\t\tqueue_id, port_id);\n+\t\trte_errno = ENODEV;\n+\t\treturn 0;\n+\t}\n+#endif\n+\n+\tif (!p->rx_descriptors_refill)\n+\t\treturn 0;\n+\n+\treturn p->rx_descriptors_refill(qd, nb);\n+}\n+\n /**@{@name Rx hardware descriptor states\n  * @see rte_eth_rx_descriptor_status\n  */\n@@ -6483,6 +6597,122 @@ rte_eth_tx_buffer(uint16_t port_id, uint16_t queue_id,\n \treturn rte_eth_tx_buffer_flush(port_id, queue_id, buffer);\n }\n \n+/**\n+ * @internal\n+ * Tx routine for rte_eth_dev_buf_recycle().\n+ * Stash Tx used buffers into Rx buffer ring in buffer recycle mode.\n+ *\n+ * @note\n+ * This API can only be called by rte_eth_dev_buf_recycle().\n+ * After calling this API, rte_eth_rx_descriptors_refill() should be\n+ * called to refill Rx ring descriptors.\n+ *\n+ * When this functionality is not implemented in the driver, the return\n+ * buffer number is 0.\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param queue_id\n+ *   The index of the transmit queue.\n+ *   The value must be in the range [0, nb_tx_queue - 1] previously supplied\n+ *   to rte_eth_dev_configure().\n+ * @param rxq_buf_recycle_info\n+ *   A pointer to a structure of Rx queue buffer ring information in buffer\n+ *   recycle mode.\n+ *\n+ * @return\n+ *   The number buffers correct to be filled in the Rx buffer ring.\n+ *   - ENODEV: bad port or queue (only if compiled with debug).\n+ */\n+static inline uint16_t rte_eth_tx_buf_stash(uint16_t port_id, uint16_t queue_id,\n+\t\tstruct rte_eth_rxq_buf_recycle_info *rxq_buf_recycle_info)\n+{\n+\tstruct rte_eth_fp_ops *p;\n+\tvoid *qd;\n+\n+#ifdef RTE_ETHDEV_DEBUG_TX\n+\tif (port_id >= RTE_MAX_ETHPORTS ||\n+\t\t\tqueue_id >= RTE_MAX_QUEUES_PER_PORT) {\n+\t\tRTE_ETHDEV_LOG(ERR,\n+\t\t\t\"Invalid port_id=%u or queue_id=%u\\n\",\n+\t\t\tport_id, queue_id);\n+\t\trte_errno = ENODEV;\n+\t\treturn 0;\n+\t}\n+#endif\n+\n+\tp = &rte_eth_fp_ops[port_id];\n+\tqd = p->txq.data[queue_id];\n+\n+#ifdef RTE_ETHDEV_DEBUG_TX\n+\tif (!rte_eth_dev_is_valid_port(port_id)) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Invalid Tx port_id=%u\\n\", port_id);\n+\t\trte_errno = ENODEV;\n+\t\treturn 0;\n+\n+\tif (qd == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Invalid Tx queue_id=%u for port_id=%u\\n\",\n+\t\t\tqueue_id, port_id);\n+\t\trte_erno = ENODEV;\n+\t\treturn 0;\n+\t}\n+#endif\n+\n+\tif (p->tx_buf_stash == NULL)\n+\t\treturn 0;\n+\n+\treturn p->tx_buf_stash(qd, rxq_buf_recycle_info);\n+}\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice\n+ *\n+ * Buffer recycle mode can let Tx queue directly put used buffers into Rx buffer\n+ * ring. This avoids freeing buffers into mempool and allocating buffers from\n+ * mempool.\n+ *\n+ * @param rx_port_id\n+ *   Port identifying the receive side.\n+ * @param rx_queue_id\n+ *   The index of the receive queue identifying the receive side.\n+ *   The value must be in the range [0, nb_rx_queue - 1] previously supplied\n+ *   to rte_eth_dev_configure().\n+ * @param tx_port_id\n+ *   Port identifying the transmit side.\n+ * @param tx_queue_id\n+ *   The index of the transmit queue identifying the transmit side.\n+ *   The value must be in the range [0, nb_tx_queue - 1] previously supplied\n+ *   to rte_eth_dev_configure().\n+ * @param rxq_recycle_info\n+ *   A pointer to a structure of type *rte_eth_txq_rearm_data* to be filled.\n+ * @return\n+ *   - (0) on success or no recycling buffer.\n+ *   - (-EINVAL) rxq_recycle_info is NULL.\n+ */\n+__rte_experimental\n+static inline int\n+rte_eth_dev_buf_recycle(uint16_t rx_port_id, uint16_t rx_queue_id,\n+\t\tuint16_t tx_port_id, uint16_t tx_queue_id,\n+\t\tstruct rte_eth_rxq_buf_recycle_info *rxq_buf_recycle_info)\n+{\n+\t/* The number of recycling buffers. */\n+\tuint16_t nb_buf;\n+\n+\tif (!rxq_buf_recycle_info)\n+\t\treturn -EINVAL;\n+\n+\t/* Stash Tx used buffers into Rx buffer ring */\n+\tnb_buf = rte_eth_tx_buf_stash(tx_port_id, tx_queue_id,\n+\t\t\t\trxq_buf_recycle_info);\n+\t/* If there are recycling buffers, refill Rx queue descriptors. */\n+\tif (nb_buf)\n+\t\trte_eth_rx_descriptors_refill(rx_port_id, rx_queue_id,\n+\t\t\t\t\tnb_buf);\n+\n+\treturn 0;\n+}\n+\n /**\n  * @warning\n  * @b EXPERIMENTAL: this API may change without prior notice\ndiff --git a/lib/ethdev/rte_ethdev_core.h b/lib/ethdev/rte_ethdev_core.h\nindex dcf8adab92..10f9d5cbe7 100644\n--- a/lib/ethdev/rte_ethdev_core.h\n+++ b/lib/ethdev/rte_ethdev_core.h\n@@ -56,6 +56,13 @@ typedef int (*eth_rx_descriptor_status_t)(void *rxq, uint16_t offset);\n /** @internal Check the status of a Tx descriptor */\n typedef int (*eth_tx_descriptor_status_t)(void *txq, uint16_t offset);\n \n+/** @internal Stash Tx used buffers into RX ring in buffer recycle mode */\n+typedef uint16_t (*eth_tx_buf_stash_t)(void *txq,\n+\t\tstruct rte_eth_rxq_buf_recycle_info *rxq_buf_recycle_info);\n+\n+/** @internal Refill Rx descriptors in buffer recycle mode */\n+typedef uint16_t (*eth_rx_descriptors_refill_t)(void *rxq, uint16_t nb);\n+\n /**\n  * @internal\n  * Structure used to hold opaque pointers to internal ethdev Rx/Tx\n@@ -90,6 +97,8 @@ struct rte_eth_fp_ops {\n \teth_rx_queue_count_t rx_queue_count;\n \t/** Check the status of a Rx descriptor. */\n \teth_rx_descriptor_status_t rx_descriptor_status;\n+\t/** Refill Rx descriptors in buffer recycle mode */\n+\teth_rx_descriptors_refill_t rx_descriptors_refill;\n \t/** Rx queues data. */\n \tstruct rte_ethdev_qdata rxq;\n \tuintptr_t reserved1[3];\n@@ -106,6 +115,8 @@ struct rte_eth_fp_ops {\n \teth_tx_prep_t tx_pkt_prepare;\n \t/** Check the status of a Tx descriptor. */\n \teth_tx_descriptor_status_t tx_descriptor_status;\n+\t/** Stash Tx used buffers into RX ring in buffer recycle mode */\n+\teth_tx_buf_stash_t tx_buf_stash;\n \t/** Tx queues data. */\n \tstruct rte_ethdev_qdata txq;\n \tuintptr_t reserved2[3];\ndiff --git a/lib/ethdev/version.map b/lib/ethdev/version.map\nindex 357d1a88c0..8a4b1dac80 100644\n--- a/lib/ethdev/version.map\n+++ b/lib/ethdev/version.map\n@@ -299,6 +299,10 @@ EXPERIMENTAL {\n \trte_flow_action_handle_query_update;\n \trte_flow_async_action_handle_query_update;\n \trte_flow_async_create_by_index;\n+\n+\t# added in 23.07\n+\trte_eth_dev_buf_recycle;\n+\trte_eth_rx_queue_buf_recycle_info_get;\n };\n \n INTERNAL {\n@@ -328,4 +332,6 @@ INTERNAL {\n \trte_eth_representor_id_get;\n \trte_eth_switch_domain_alloc;\n \trte_eth_switch_domain_free;\n+\trte_eth_tx_buf_stash;\n+\trte_eth_rx_descriptors_refill;\n };\n",
    "prefixes": [
        "v4",
        "1/3"
    ]
}