get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 136898,
    "url": "http://patches.dpdk.org/api/patches/136898/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20240220105823.570841-2-haijie1@huawei.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": "<20240220105823.570841-2-haijie1@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20240220105823.570841-2-haijie1@huawei.com",
    "date": "2024-02-20T10:58:17",
    "name": "[v3,1/7] ethdev: support report register names and filter",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "fcd8fd532bf62c19393b146f4b2f96887214548e",
    "submitter": {
        "id": 2935,
        "url": "http://patches.dpdk.org/api/people/2935/?format=api",
        "name": "Jie Hai",
        "email": "haijie1@huawei.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/20240220105823.570841-2-haijie1@huawei.com/mbox/",
    "series": [
        {
            "id": 31148,
            "url": "http://patches.dpdk.org/api/series/31148/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=31148",
            "date": "2024-02-20T10:58:16",
            "name": "support dump reigser names and filter them",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/31148/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/136898/comments/",
    "check": "warning",
    "checks": "http://patches.dpdk.org/api/patches/136898/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 9409943B53;\n\tTue, 20 Feb 2024 12:02:44 +0100 (CET)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id A68E640FDE;\n\tTue, 20 Feb 2024 12:02:39 +0100 (CET)",
            "from szxga04-in.huawei.com (szxga04-in.huawei.com [45.249.212.190])\n by mails.dpdk.org (Postfix) with ESMTP id 4C443402B8\n for <dev@dpdk.org>; Tue, 20 Feb 2024 12:02:37 +0100 (CET)",
            "from mail.maildlp.com (unknown [172.19.163.44])\n by szxga04-in.huawei.com (SkyGuard) with ESMTP id 4TfGfy4wkjz1xp7M;\n Tue, 20 Feb 2024 19:01:14 +0800 (CST)",
            "from kwepemd100004.china.huawei.com (unknown [7.221.188.31])\n by mail.maildlp.com (Postfix) with ESMTPS id 39C21140118;\n Tue, 20 Feb 2024 19:02:36 +0800 (CST)",
            "from localhost.localdomain (10.67.165.2) by\n kwepemd100004.china.huawei.com (7.221.188.31) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.2.1258.28; Tue, 20 Feb 2024 19:02:35 +0800"
        ],
        "From": "Jie Hai <haijie1@huawei.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<lihuisong@huawei.com>, <fengchengwen@huawei.com>,\n <liuyonglong@huawei.com>, <huangdengdui@huawei.com>, <ferruh.yigit@amd.com>",
        "Subject": "[PATCH v3 1/7] ethdev: support report register names and filter",
        "Date": "Tue, 20 Feb 2024 18:58:17 +0800",
        "Message-ID": "<20240220105823.570841-2-haijie1@huawei.com>",
        "X-Mailer": "git-send-email 2.30.0",
        "In-Reply-To": "<20240220105823.570841-1-haijie1@huawei.com>",
        "References": "<20231214015650.3738578-1-haijie1@huawei.com>\n <20240220105823.570841-1-haijie1@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.67.165.2]",
        "X-ClientProxiedBy": "dggems706-chm.china.huawei.com (10.3.19.183) To\n kwepemd100004.china.huawei.com (7.221.188.31)",
        "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": "This patch adds \"filter\" and \"names\" fields to \"rte_dev_reg_info\"\nstructure. Names of registers in data fields can be reported and\nthe registers can be filtered by their names.\n\nThe new API rte_eth_dev_get_reg_info_ext() is added to support\nreporting names and filtering by names. And the original API\nrte_eth_dev_get_reg_info() does not use the name and filter fields.\nA local variable is used in rte_eth_dev_get_reg_info for\ncompatibility. If the drivers does not report the names, set them\nto \"offset_XXX\".\n\nSigned-off-by: Jie Hai <haijie1@huawei.com>\n---\n doc/guides/rel_notes/release_24_03.rst |  9 +++++++\n lib/ethdev/rte_dev_info.h              | 11 ++++++++\n lib/ethdev/rte_ethdev.c                | 36 ++++++++++++++++++++++++++\n lib/ethdev/rte_ethdev.h                | 28 ++++++++++++++++++++\n lib/ethdev/version.map                 |  1 +\n 5 files changed, 85 insertions(+)",
    "diff": "diff --git a/doc/guides/rel_notes/release_24_03.rst b/doc/guides/rel_notes/release_24_03.rst\nindex db8be50c6dfd..f8882ba36bb9 100644\n--- a/doc/guides/rel_notes/release_24_03.rst\n+++ b/doc/guides/rel_notes/release_24_03.rst\n@@ -102,6 +102,12 @@ New Features\n \n   * Added support for comparing result between packet fields or value.\n \n+* **Added support for dumping regiters with names and filter.**\n+\n+  * Added new API functions ``rte_eth_dev_get_reg_info_ext()`` to and filter\n+    the registers by their names and get the information of registers(names,\n+    values and other attributes).\n+\n \n Removed Items\n -------------\n@@ -154,6 +160,9 @@ ABI Changes\n \n * No ABI change that would break compatibility with 23.11.\n \n+* ethdev: Added ``filter`` and ``names`` fields to ``rte_dev_reg_info``\n+  structure for reporting names of registers and filtering them by names.\n+\n \n Known Issues\n ------------\ndiff --git a/lib/ethdev/rte_dev_info.h b/lib/ethdev/rte_dev_info.h\nindex 67cf0ae52668..2f4541bd46c8 100644\n--- a/lib/ethdev/rte_dev_info.h\n+++ b/lib/ethdev/rte_dev_info.h\n@@ -11,6 +11,11 @@ extern \"C\" {\n \n #include <stdint.h>\n \n+#define RTE_ETH_REG_NAME_SIZE 128\n+struct rte_eth_reg_name {\n+\tchar name[RTE_ETH_REG_NAME_SIZE];\n+};\n+\n /*\n  * Placeholder for accessing device registers\n  */\n@@ -20,6 +25,12 @@ struct rte_dev_reg_info {\n \tuint32_t length; /**< Number of registers to fetch */\n \tuint32_t width; /**< Size of device register */\n \tuint32_t version; /**< Device version */\n+\t/**\n+\t * Filter for target subset of registers.\n+\t * This field could affects register selection for data/length/names.\n+\t */\n+\tchar *filter;\n+\tstruct rte_eth_reg_name *names; /**< Registers name saver */\n };\n \n /*\ndiff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c\nindex f1c658f49e80..9eb4e696a51a 100644\n--- a/lib/ethdev/rte_ethdev.c\n+++ b/lib/ethdev/rte_ethdev.c\n@@ -6388,8 +6388,39 @@ rte_eth_read_clock(uint16_t port_id, uint64_t *clock)\n \n int\n rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info)\n+{\n+\tstruct rte_dev_reg_info reg_info = { 0 };\n+\tint ret;\n+\n+\tif (info == NULL) {\n+\t\tRTE_ETHDEV_LOG_LINE(ERR,\n+\t\t\t\"Cannot get ethdev port %u register info to NULL\",\n+\t\t\tport_id);\n+\t\treturn -EINVAL;\n+\t}\n+\n+\treg_info.length = info->length;\n+\treg_info.data = info->data;\n+\treg_info.names = NULL;\n+\treg_info.filter = NULL;\n+\n+\tret = rte_eth_dev_get_reg_info_ext(port_id, &reg_info);\n+\tif (ret != 0)\n+\t\treturn ret;\n+\n+\tinfo->length = reg_info.length;\n+\tinfo->width = reg_info.width;\n+\tinfo->version = reg_info.version;\n+\tinfo->offset = reg_info.offset;\n+\n+\treturn 0;\n+}\n+\n+int\n+rte_eth_dev_get_reg_info_ext(uint16_t port_id, struct rte_dev_reg_info *info)\n {\n \tstruct rte_eth_dev *dev;\n+\tuint32_t i;\n \tint ret;\n \n \tRTE_ETH_VALID_PORTID_OR_ERR_RET(port_id, -ENODEV);\n@@ -6408,6 +6439,11 @@ rte_eth_dev_get_reg_info(uint16_t port_id, struct rte_dev_reg_info *info)\n \n \trte_ethdev_trace_get_reg_info(port_id, info, ret);\n \n+\t/* Report the default names if drivers not report. */\n+\tif (info->names != NULL && strlen(info->names[0].name) == 0)\n+\t\tfor (i = 0; i < info->length; i++)\n+\t\t\tsnprintf(info->names[i].name, RTE_ETH_REG_NAME_SIZE,\n+\t\t\t\t\"offset_%x\", info->offset + i * info->width);\n \treturn ret;\n }\n \ndiff --git a/lib/ethdev/rte_ethdev.h b/lib/ethdev/rte_ethdev.h\nindex a14ca15f34ce..4b4aa8d2152e 100644\n--- a/lib/ethdev/rte_ethdev.h\n+++ b/lib/ethdev/rte_ethdev.h\n@@ -5066,6 +5066,34 @@ __rte_experimental\n int rte_eth_get_monitor_addr(uint16_t port_id, uint16_t queue_id,\n \t\tstruct rte_power_monitor_cond *pmc);\n \n+/**\n+ * Retrieve the filtered device registers (values and names) and\n+ * register attributes (number of registers and register size)\n+ *\n+ * @param port_id\n+ *   The port identifier of the Ethernet device.\n+ * @param info\n+ *   Pointer to rte_dev_reg_info structure to fill in.\n+ *   If info->filter is not NULL and the driver does not support names or\n+ *   filter, return error. If info->filter is NULL, return info for all\n+ *   registers (seen as filter none).\n+ *   If info->data is NULL, the function fills in the width and length fields.\n+ *   If non-NULL, ethdev considers there are enough spaces to store the\n+ *   registers, and the values of registers whose name contains the filter\n+ *   string are put into the buffer pointed at by the data field. Do the same\n+ *   for the names of registers if info->names is not NULL. If drivers do not\n+ *   report names, default names are given by ethdev.\n+ * @return\n+ *   - (0) if successful.\n+ *   - (-ENOTSUP) if hardware doesn't support.\n+ *   - (-EINVAL) if bad parameter.\n+ *   - (-ENODEV) if *port_id* invalid.\n+ *   - (-EIO) if device is removed.\n+ *   - others depends on the specific operations implementation.\n+ */\n+__rte_experimental\n+int rte_eth_dev_get_reg_info_ext(uint16_t port_id, struct rte_dev_reg_info *info);\n+\n /**\n  * Retrieve device registers and register attributes (number of registers and\n  * register size)\ndiff --git a/lib/ethdev/version.map b/lib/ethdev/version.map\nindex 8678b6991eee..2bdafce693c3 100644\n--- a/lib/ethdev/version.map\n+++ b/lib/ethdev/version.map\n@@ -325,6 +325,7 @@ EXPERIMENTAL {\n \trte_flow_template_table_resizable;\n \trte_flow_template_table_resize;\n \trte_flow_template_table_resize_complete;\n+\trte_eth_dev_get_reg_info_ext;\n };\n \n INTERNAL {\n",
    "prefixes": [
        "v3",
        "1/7"
    ]
}