get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 112199,
    "url": "http://patchwork.dpdk.org/api/patches/112199/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20220601074930.10313-5-humin29@huawei.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": "<20220601074930.10313-5-humin29@huawei.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20220601074930.10313-5-humin29@huawei.com",
    "date": "2022-06-01T07:49:30",
    "name": "[v3,4/4] app/procinfo: support descriptor dump",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7c834826352ec2ab58aba82c4ab79461832648ad",
    "submitter": {
        "id": 1944,
        "url": "http://patchwork.dpdk.org/api/people/1944/?format=api",
        "name": "humin (Q)",
        "email": "humin29@huawei.com"
    },
    "delegate": {
        "id": 3961,
        "url": "http://patchwork.dpdk.org/api/users/3961/?format=api",
        "username": "arybchenko",
        "first_name": "Andrew",
        "last_name": "Rybchenko",
        "email": "andrew.rybchenko@oktetlabs.ru"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/20220601074930.10313-5-humin29@huawei.com/mbox/",
    "series": [
        {
            "id": 23282,
            "url": "http://patchwork.dpdk.org/api/series/23282/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=23282",
            "date": "2022-06-01T07:49:26",
            "name": "support HW Rx/Tx descriptor dump",
            "version": 3,
            "mbox": "http://patchwork.dpdk.org/series/23282/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/112199/comments/",
    "check": "fail",
    "checks": "http://patchwork.dpdk.org/api/patches/112199/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 98C52A0548;\n\tWed,  1 Jun 2022 09:50:56 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 6C84B40DF7;\n\tWed,  1 Jun 2022 09:50:53 +0200 (CEST)",
            "from szxga01-in.huawei.com (szxga01-in.huawei.com [45.249.212.187])\n by mails.dpdk.org (Postfix) with ESMTP id 435804069F\n for <dev@dpdk.org>; Wed,  1 Jun 2022 09:50:51 +0200 (CEST)",
            "from kwepemi500012.china.huawei.com (unknown [172.30.72.57])\n by szxga01-in.huawei.com (SkyGuard) with ESMTP id 4LChBb1jtszjXGT\n for <dev@dpdk.org>; Wed,  1 Jun 2022 15:49:59 +0800 (CST)",
            "from localhost.localdomain (10.69.192.56) by\n kwepemi500012.china.huawei.com (7.221.188.12) with Microsoft SMTP Server\n (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_128_GCM_SHA256) id\n 15.1.2375.24; Wed, 1 Jun 2022 15:50:49 +0800"
        ],
        "From": "\"Min Hu (Connor)\" <humin29@huawei.com>",
        "To": "<dev@dpdk.org>",
        "Subject": "[PATCH v3 4/4] app/procinfo: support descriptor dump",
        "Date": "Wed, 1 Jun 2022 15:49:30 +0800",
        "Message-ID": "<20220601074930.10313-5-humin29@huawei.com>",
        "X-Mailer": "git-send-email 2.33.0",
        "In-Reply-To": "<20220601074930.10313-1-humin29@huawei.com>",
        "References": "<20220527023351.40577-1-humin29@huawei.com>\n <20220601074930.10313-1-humin29@huawei.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Originating-IP": "[10.69.192.56]",
        "X-ClientProxiedBy": "dggems701-chm.china.huawei.com (10.3.19.178) To\n kwepemi500012.china.huawei.com (7.221.188.12)",
        "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": "This patch support HW Rx/Tx descriptor dump\n\nThe command is like:\ndpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --\n--show-rx-descriptor queue_id:descriptor_id\n\ndpdk-proc-info -a xxxx:xx:xx.x --file-prefix=xxx -- --\n--show-tx-descriptor queue_id:descriptor_id\n\nSigned-off-by: Min Hu (Connor) <humin29@huawei.com>\n---\n app/proc-info/main.c | 81 ++++++++++++++++++++++++++++++++++++++++++++\n 1 file changed, 81 insertions(+)",
    "diff": "diff --git a/app/proc-info/main.c b/app/proc-info/main.c\nindex 56070a3317..eab1b546d1 100644\n--- a/app/proc-info/main.c\n+++ b/app/proc-info/main.c\n@@ -48,6 +48,9 @@\n #define STATS_BDR_STR(w, s) printf(\"%.*s%s%.*s\\n\", w, \\\n \tSTATS_BDR_FMT, s, w, STATS_BDR_FMT)\n \n+typedef int (*desc_dump_t)(FILE *file, uint16_t port_id, uint16_t queue_id,\n+\t\t\t    uint16_t desc_id);\n+\n /**< mask of enabled ports */\n static unsigned long enabled_port_mask;\n /**< Enable stats. */\n@@ -100,6 +103,12 @@ static char *mempool_iter_name;\n /**< Enable dump regs. */\n static uint32_t enable_dump_regs;\n static char *dump_regs_file_prefix;\n+/**< Enable dump buffer descriptor. */\n+#define MAX_NB_ITEM 2\n+static uint16_t rx_nb_item;\n+static uint16_t tx_nb_item;\n+static uint16_t rx_item_opt[MAX_NB_ITEM];\n+static uint16_t tx_item_opt[MAX_NB_ITEM];\n \n /**< display usage */\n static void\n@@ -127,6 +136,8 @@ proc_info_usage(const char *prgname)\n \t\t\"  --show-crypto: to display crypto information\\n\"\n \t\t\"  --show-ring[=name]: to display ring information\\n\"\n \t\t\"  --show-mempool[=name]: to display mempool information\\n\"\n+\t\t\"  --show-rx-descriptor queue_id:descriptor_id: to display ports Rx buffer description by queue id and descriptor id\\n\"\n+\t\t\"  --show-tx-descriptor queue_id:descriptor_id: to display ports Tx buffer description by queue id and descriptor id\\n\"\n \t\t\"  --iter-mempool=name: iterate mempool elements to display content\\n\"\n \t\t\"  --dump-regs=file-prefix: dump registers to file with the file-prefix\\n\",\n \t\tprgname);\n@@ -179,6 +190,34 @@ parse_xstats_ids(char *list, uint64_t *ids, int limit) {\n \treturn length;\n }\n \n+/*\n+ * Parse ids value list into array\n+ */\n+static int\n+parse_descriptor_param(char *list, uint16_t *item_opt, int limit)\n+{\n+\tint length;\n+\tchar *token;\n+\tchar *ctx = NULL;\n+\tchar *endptr;\n+\n+\tlength = 0;\n+\ttoken = strtok_r(list, \":\", &ctx);\n+\twhile (token != NULL) {\n+\t\titem_opt[length] = strtoul(token, &endptr, 10);\n+\t\tif (*endptr != '\\0')\n+\t\t\treturn -EINVAL;\n+\n+\t\tlength++;\n+\t\tif (length > limit)\n+\t\t\treturn -E2BIG;\n+\n+\t\ttoken = strtok_r(NULL, \":\", &ctx);\n+\t}\n+\n+\treturn length;\n+}\n+\n static int\n proc_info_preparse_args(int argc, char **argv)\n {\n@@ -238,6 +277,8 @@ proc_info_parse_args(int argc, char **argv)\n \t\t{\"show-mempool\", optional_argument, NULL, 0},\n \t\t{\"iter-mempool\", required_argument, NULL, 0},\n \t\t{\"dump-regs\", required_argument, NULL, 0},\n+\t\t{\"show-rx-descriptor\", required_argument, NULL, 1},\n+\t\t{\"show-tx-descriptor\", required_argument, NULL, 1},\n \t\t{NULL, 0, 0, 0}\n \t};\n \n@@ -327,6 +368,26 @@ proc_info_parse_args(int argc, char **argv)\n \t\t\t\t\treturn -1;\n \t\t\t\t}\n \t\t\t\tnb_xstats_ids = ret;\n+\t\t\t} else if (!strncmp(long_option[option_index].name,\n+\t\t\t\t\"show-rx-descriptor\", MAX_LONG_OPT_SZ)) {\n+\t\t\t\tint ret = parse_descriptor_param(optarg,\n+\t\t\t\t\t\t\t\t rx_item_opt,\n+\t\t\t\t\t\t\t\t MAX_NB_ITEM);\n+\t\t\t\tif (ret < MAX_NB_ITEM) {\n+\t\t\t\t\tprintf(\"Rx descriptor param parse error.\\n\");\n+\t\t\t\t\treturn -1;\n+\t\t\t\t}\n+\t\t\t\trx_nb_item = ret;\n+\t\t\t} else if (!strncmp(long_option[option_index].name,\n+\t\t\t\t\"show-tx-descriptor\", MAX_LONG_OPT_SZ)) {\n+\t\t\t\tint ret = parse_descriptor_param(optarg,\n+\t\t\t\t\t\t\t\t tx_item_opt,\n+\t\t\t\t\t\t\t\t MAX_NB_ITEM);\n+\t\t\t\tif (ret < MAX_NB_ITEM) {\n+\t\t\t\t\tprintf(\"Tx descriptor param parse error.\\n\");\n+\t\t\t\t\treturn -1;\n+\t\t\t\t}\n+\t\t\t\ttx_nb_item = ret;\n \t\t\t}\n \t\t\tbreak;\n \t\tdefault:\n@@ -1450,6 +1511,20 @@ dump_regs(char *file_prefix)\n \t}\n }\n \n+static void\n+nic_descriptor_display(uint16_t port_id, uint16_t *item_opt,\n+\t\t       desc_dump_t desc_dump)\n+{\n+\tstatic const char *nic_desc_border = \"###\";\n+\tuint16_t queue_id = item_opt[0];\n+\tuint16_t desc_id = item_opt[1];\n+\n+\tprintf(\"%s NIC descriptor for port %u %s\\n\",\n+\t\t   nic_desc_border, port_id, nic_desc_border);\n+\n+\tdesc_dump(stdout, port_id, queue_id, desc_id);\n+}\n+\n int\n main(int argc, char **argv)\n {\n@@ -1533,6 +1608,12 @@ main(int argc, char **argv)\n \t\telse if (nb_xstats_ids > 0)\n \t\t\tnic_xstats_by_ids_display(i, xstats_ids,\n \t\t\t\t\t\t  nb_xstats_ids);\n+\t\telse if (rx_nb_item > 0)\n+\t\t\tnic_descriptor_display(i, rx_item_opt,\n+\t\t\t\t\t       rte_eth_rx_hw_desc_dump);\n+\t\telse if (tx_nb_item > 0)\n+\t\t\tnic_descriptor_display(i, tx_item_opt,\n+\t\t\t\t\t       rte_eth_tx_hw_desc_dump);\n #ifdef RTE_LIB_METRICS\n \t\telse if (enable_metrics)\n \t\t\tmetrics_display(i);\n",
    "prefixes": [
        "v3",
        "4/4"
    ]
}