get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 116719,
    "url": "https://patches.dpdk.org/api/patches/116719/?format=api",
    "web_url": "https://patches.dpdk.org/project/dpdk/patch/20220923074316.25077-2-liudongdong3@huawei.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": "<20220923074316.25077-2-liudongdong3@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220923074316.25077-2-liudongdong3@huawei.com",
    "date": "2022-09-23T07:43:14",
    "name": "[v4,1/3] ethdev: introduce ethdev desc dump API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "237c47b9c3cb8025d5bfd9c563861988498b781b",
    "submitter": {
        "id": 2718,
        "url": "https://patches.dpdk.org/api/people/2718/?format=api",
        "name": "Dongdong Liu",
        "email": "liudongdong3@huawei.com"
    },
    "delegate": {
        "id": 319,
        "url": "https://patches.dpdk.org/api/users/319/?format=api",
        "username": "fyigit",
        "first_name": "Ferruh",
        "last_name": "Yigit",
        "email": "ferruh.yigit@amd.com"
    },
    "mbox": "https://patches.dpdk.org/project/dpdk/patch/20220923074316.25077-2-liudongdong3@huawei.com/mbox/",
    "series": [
        {
            "id": 24796,
            "url": "https://patches.dpdk.org/api/series/24796/?format=api",
            "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=24796",
            "date": "2022-09-23T07:43:13",
            "name": "support ethdev Rx/Tx descriptor dump",
            "version": 4,
            "mbox": "https://patches.dpdk.org/series/24796/mbox/"
        }
    ],
    "comments": "https://patches.dpdk.org/api/patches/116719/comments/",
    "check": "warning",
    "checks": "https://patches.dpdk.org/api/patches/116719/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 D12B0A0544;\n\tFri, 23 Sep 2022 09:45:08 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 377164282D;\n\tFri, 23 Sep 2022 09:45:00 +0200 (CEST)",
            "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id D748E400D7\n for <dev@dpdk.org>; Fri, 23 Sep 2022 09:44:56 +0200 (CEST)",
            "from kwepemi500017.china.huawei.com (unknown [172.30.72.56])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4MYkbJ1lB7zlWN0;\n Fri, 23 Sep 2022 15:40:44 +0800 (CST)",
            "from localhost.localdomain (10.28.79.22) by\n kwepemi500017.china.huawei.com (7.221.188.110) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2375.31; Fri, 23 Sep 2022 15:44:53 +0800"
        ],
        "From": "Dongdong Liu <liudongdong3@huawei.com>",
        "To": "<dev@dpdk.org>, <thomas@monjalon.net>, <ferruh.yigit@xilinx.com>,\n <andrew.rybchenko@oktetlabs.ru>, <stephen@networkplumber.org>,\n <mdr@ashroe.eu>",
        "CC": "\"Min Hu (Connor)\" <humin29@huawei.com>, Dongdong Liu\n <liudongdong3@huawei.com>",
        "Subject": "[PATCH v4 1/3] ethdev: introduce ethdev desc dump API",
        "Date": "Fri, 23 Sep 2022 15:43:14 +0800",
        "Message-ID": "<20220923074316.25077-2-liudongdong3@huawei.com>",
        "X-Mailer": "git-send-email 2.22.0",
        "In-Reply-To": "<20220923074316.25077-1-liudongdong3@huawei.com>",
        "References": "<20220527023351.40577-1-humin29@huawei.com>\n <20220923074316.25077-1-liudongdong3@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.28.79.22]",
        "X-ClientProxiedBy": "dggems702-chm.china.huawei.com (10.3.19.179) To\n kwepemi500017.china.huawei.com (7.221.188.110)",
        "X-CFilter-Loop": "Reflected",
        "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": "From: \"Min Hu (Connor)\" <humin29@huawei.com>\n\nAdded the ethdev Rx/Tx desc dump API which provides functions for query\ndescriptor from device. HW descriptor info differs in different NICs.\nThe information demonstrates I/O process which is important for debug.\nAs the information is different between NICs, the new API is introduced.\n\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\nSigned-off-by: Dongdong Liu <liudongdong3@huawei.com>\nAcked-by: Ray Kinsella <mdr@ashroe.eu>\n---\n doc/guides/rel_notes/release_22_11.rst |  7 ++++\n lib/ethdev/ethdev_driver.h             | 46 +++++++++++++++++++++++\n lib/ethdev/rte_ethdev.c                | 52 ++++++++++++++++++++++++++\n lib/ethdev/rte_ethdev.h                | 49 ++++++++++++++++++++++++\n lib/ethdev/version.map                 |  2 +\n 5 files changed, 156 insertions(+)",
    "diff": "diff --git a/doc/guides/rel_notes/release_22_11.rst b/doc/guides/rel_notes/release_22_11.rst\nindex f60161765b..d3f3f2e50c 100644\n--- a/doc/guides/rel_notes/release_22_11.rst\n+++ b/doc/guides/rel_notes/release_22_11.rst\n@@ -55,6 +55,13 @@ New Features\n      Also, make sure to start the actual text at the margin.\n      =======================================================\n \n+* **Added ethdev desc dump API, to dump Rx/Tx desc info from device.**\n+\n+Added the ethdev Rx/Tx desc dump API which provides functions for query\n+descriptor from device. The descriptor info differs in different NICs.\n+The information demonstrates I/O process which is important for debug.\n+As the information is different between NICs, the new API is introduced.\n+The dump format is vendor-specific.\n \n Removed Items\n -------------\ndiff --git a/lib/ethdev/ethdev_driver.h b/lib/ethdev/ethdev_driver.h\nindex a0e0b2ae88..76808dae89 100644\n--- a/lib/ethdev/ethdev_driver.h\n+++ b/lib/ethdev/ethdev_driver.h\n@@ -1093,6 +1093,47 @@ typedef int (*eth_rx_queue_avail_thresh_query_t)(struct rte_eth_dev *dev,\n \t\t\t\t\tuint16_t *rx_queue_id,\n \t\t\t\t\tuint8_t *avail_thresh);\n \n+\n+/**\n+ * @internal\n+ * Dump Rx descriptor info to a file.\n+ *\n+ * It is used for debugging, not a dataplane API.\n+ *\n+ * @param file\n+ *   A pointer to a file for output.\n+ * @param dev\n+ *   Port (ethdev) handle.\n+ * @param queue_id\n+ *   The selected queue.\n+ * @param num\n+ *   The number of the descriptors to dump.\n+ * @return\n+ *   Negative errno value on error, zero on success.\n+ */\n+typedef int (*eth_rx_hw_desc_dump_t)(FILE *file, const struct rte_eth_dev *dev,\n+\t\t\t\t     uint16_t queue_id, uint16_t num);\n+\n+/**\n+ * @internal\n+ * Dump Tx descriptor info to a file.\n+ *\n+ * This API is used for debugging, not a dataplane API.\n+ *\n+ * @param file\n+ *   A pointer to a file for output.\n+ * @param dev\n+ *   Port (ethdev) handle.\n+ * @param queue_id\n+ *   The selected queue.\n+ * @param num\n+ *   The number of the descriptors to dump.\n+ * @return\n+ *   Negative errno value on error, zero on success.\n+ */\n+typedef int (*eth_tx_hw_desc_dump_t)(FILE *file, const struct rte_eth_dev *dev,\n+\t\t\t\t     uint16_t queue_id, uint16_t num);\n+\n /**\n  * @internal A structure containing the functions exported by an Ethernet driver.\n  */\n@@ -1308,6 +1349,11 @@ struct eth_dev_ops {\n \teth_rx_queue_avail_thresh_set_t rx_queue_avail_thresh_set;\n \t/** Query Rx queue available descriptors threshold event */\n \teth_rx_queue_avail_thresh_query_t rx_queue_avail_thresh_query;\n+\n+\t/** Dump Rx descriptor info */\n+\teth_rx_hw_desc_dump_t eth_rx_hw_desc_dump;\n+\t/** Dump Tx descriptor info */\n+\teth_tx_hw_desc_dump_t eth_tx_hw_desc_dump;\n };\n \n /**\ndiff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c\nindex 1979dc0850..2093275d87 100644\n--- a/lib/ethdev/rte_ethdev.c\n+++ b/lib/ethdev/rte_ethdev.c\n@@ -5917,6 +5917,58 @@ rte_eth_dev_priv_dump(uint16_t port_id, FILE *file)\n \treturn eth_err(port_id, (*dev->dev_ops->eth_dev_priv_dump)(dev, file));\n }\n \n+int\n+rte_eth_rx_hw_desc_dump(FILE *file, uint16_t port_id, uint16_t queue_id,\n+\t\t\tuint16_t num)\n+{\n+\tstruct rte_eth_dev *dev;\n+\tint ret;\n+\n+\tif (file == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Invalid file (NULL)\\n\");\n+\t\treturn -EINVAL;\n+\t}\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+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->eth_rx_hw_desc_dump, -ENOTSUP);\n+\tret = (*dev->dev_ops->eth_rx_hw_desc_dump)(file, dev, queue_id, num);\n+\n+\treturn ret;\n+}\n+\n+int\n+rte_eth_tx_hw_desc_dump(FILE *file, uint16_t port_id, uint16_t queue_id,\n+\t\t\tuint16_t num)\n+{\n+\tstruct rte_eth_dev *dev;\n+\tint ret;\n+\n+\tif (file == NULL) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Invalid file (NULL)\\n\");\n+\t\treturn -EINVAL;\n+\t}\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_tx_queues) {\n+\t\tRTE_ETHDEV_LOG(ERR, \"Invalid Tx queue_id=%u\\n\", queue_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\tRTE_FUNC_PTR_OR_ERR_RET(*dev->dev_ops->eth_tx_hw_desc_dump, -ENOTSUP);\n+\tret = (*dev->dev_ops->eth_tx_hw_desc_dump)(file, dev, queue_id, num);\n+\n+\treturn ret;\n+}\n+\n RTE_LOG_REGISTER_DEFAULT(rte_eth_dev_logtype, INFO);\n \n RTE_INIT(ethdev_init_telemetry)\ndiff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h\nindex b62ac5bb6f..4671e6b28e 100644\n--- a/lib/ethdev/rte_ethdev.h\n+++ b/lib/ethdev/rte_ethdev.h\n@@ -5221,6 +5221,55 @@ typedef struct {\n __rte_experimental\n int rte_eth_dev_priv_dump(uint16_t port_id, FILE *file);\n \n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice\n+ *\n+ * Dump ethdev Rx descriptor info to a file.\n+ *\n+ * This API is used for debugging, not a dataplane API.\n+ *\n+ * @param file\n+ *   A pointer to a file for output.\n+ * @param dev\n+ *   Port (ethdev) handle.\n+ * @param queue_id\n+ *   The selected queue.\n+ * @param num\n+ *   The number of the descriptors to dump.\n+ * @return\n+ *   - On success, zero.\n+ *   - On failure, a negative value.\n+ */\n+__rte_experimental\n+int rte_eth_rx_hw_desc_dump(FILE *file, uint16_t port_id, uint16_t queue_id,\n+\t\t\t    uint16_t num);\n+\n+/**\n+ * @warning\n+ * @b EXPERIMENTAL: this API may change, or be removed, without prior notice\n+ *\n+ * Dump ethdev Tx descriptor info to a file.\n+ *\n+ * This API is used for debugging, not a dataplane API.\n+ *\n+ * @param file\n+ *   A pointer to a file for output.\n+ * @param dev\n+ *   Port (ethdev) handle.\n+ * @param queue_id\n+ *   The selected queue.\n+ * @param num\n+ *   The number of the descriptors to dump.\n+ * @return\n+ *   - On success, zero.\n+ *   - On failure, a negative value.\n+ */\n+__rte_experimental\n+int rte_eth_tx_hw_desc_dump(FILE *file, uint16_t port_id, uint16_t queue_id,\n+\t\t\t    uint16_t num);\n+\n+\n #include <rte_ethdev_core.h>\n \n /**\ndiff --git a/lib/ethdev/version.map b/lib/ethdev/version.map\nindex 03f52fee91..3c7c75b582 100644\n--- a/lib/ethdev/version.map\n+++ b/lib/ethdev/version.map\n@@ -285,6 +285,8 @@ EXPERIMENTAL {\n \trte_mtr_color_in_protocol_priority_get;\n \trte_mtr_color_in_protocol_set;\n \trte_mtr_meter_vlan_table_update;\n+\trte_eth_rx_hw_desc_dump;\n+\trte_eth_tx_hw_desc_dump;\n };\n \n INTERNAL {\n",
    "prefixes": [
        "v4",
        "1/3"
    ]
}