get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96423,
    "url": "http://patchwork.dpdk.org/api/patches/96423/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/604cef7dae418edfa928e63731772e51ad26d6d3.1627572033.git.gmuthukrishn@marvell.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": "<604cef7dae418edfa928e63731772e51ad26d6d3.1627572033.git.gmuthukrishn@marvell.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/604cef7dae418edfa928e63731772e51ad26d6d3.1627572033.git.gmuthukrishn@marvell.com",
    "date": "2021-07-29T15:25:36",
    "name": "[v1,2/3] test/telemetry: add unit tests for pointer value",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "97687b4236463ebd11ec7e1d38d39dcf72ce98d2",
    "submitter": {
        "id": 2301,
        "url": "http://patchwork.dpdk.org/api/people/2301/?format=api",
        "name": "Gowrishankar Muthukrishnan",
        "email": "gmuthukrishn@marvell.com"
    },
    "delegate": {
        "id": 1,
        "url": "http://patchwork.dpdk.org/api/users/1/?format=api",
        "username": "tmonjalo",
        "first_name": "Thomas",
        "last_name": "Monjalon",
        "email": "thomas@monjalon.net"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/604cef7dae418edfa928e63731772e51ad26d6d3.1627572033.git.gmuthukrishn@marvell.com/mbox/",
    "series": [
        {
            "id": 18069,
            "url": "http://patchwork.dpdk.org/api/series/18069/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=18069",
            "date": "2021-07-29T15:25:34",
            "name": "common/cnxk: enable npa telemetry",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/18069/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/96423/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/96423/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 20B41A034F;\n\tThu, 29 Jul 2021 17:26:28 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 23F72410FB;\n\tThu, 29 Jul 2021 17:26:24 +0200 (CEST)",
            "from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com\n [67.231.156.173])\n by mails.dpdk.org (Postfix) with ESMTP id 4B566410FB\n for <dev@dpdk.org>; Thu, 29 Jul 2021 17:26:22 +0200 (CEST)",
            "from pps.filterd (m0045851.ppops.net [127.0.0.1])\n by mx0b-0016f401.pphosted.com (8.16.0.43/8.16.0.43) with SMTP id\n 16TFB7m7028635; Thu, 29 Jul 2021 08:26:21 -0700",
            "from dc5-exch02.marvell.com ([199.233.59.182])\n by mx0b-0016f401.pphosted.com with ESMTP id 3a35pr5gq9-1\n (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT);\n Thu, 29 Jul 2021 08:26:21 -0700",
            "from DC5-EXCH02.marvell.com (10.69.176.39) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server (TLS) id 15.0.1497.18;\n Thu, 29 Jul 2021 08:26:18 -0700",
            "from maili.marvell.com (10.69.176.80) by DC5-EXCH02.marvell.com\n (10.69.176.39) with Microsoft SMTP Server id 15.0.1497.18 via Frontend\n Transport; Thu, 29 Jul 2021 08:26:18 -0700",
            "from localhost.localdomain (unknown [10.28.34.38])\n by maili.marvell.com (Postfix) with ESMTP id 379FF3F7085;\n Thu, 29 Jul 2021 08:26:15 -0700 (PDT)"
        ],
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com;\n h=from : to : cc :\n subject : date : message-id : in-reply-to : references : mime-version :\n content-transfer-encoding : content-type; s=pfpt0220;\n bh=bjmCCBk0eLvIMZm/3unP/Oy33Wd/SfrsK3Vb6QMs+io=;\n b=CGCrG6+IUcRlza7VSfcmmiDB4p4ig5jeJCjX+2AuSSWyqL0qxjKU9TGvUU5mR+ALRFVp\n Zh/YRpkiWK05SKubUbWby4YSVy8XMsvvbvOY74JhE6VvFqzwW2KCk8MGdYic17u84vDT\n xPJMKaN84pRBXZrT9DJ6fdvPpDTQSOwhSZAPUrcZ/grkQ4mx/9lRqOmUSNlrsyju/YcO\n e0bVaVKrf6Qj2Ij8AHlvV3JEmpyc/VCYWclNrNZKovxU6VsOQlbkadDnXJfJZAqNHZkO\n OyxTaJBGdND8exX6rfE7p/QMEz6kbPvQsLEUPLbfGa9kw9WwMMZSQef2s8Kzduxckr7z DA==",
        "From": "Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>",
        "To": "<dev@dpdk.org>",
        "CC": "<ciara.power@intel.com>, <jerinj@marvell.com>, <kirankumark@marvell.com>,\n <ndabilpuram@marvell.com>, <skori@marvell.com>, <skoteshwar@marvell.com>,\n Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>",
        "Date": "Thu, 29 Jul 2021 20:55:36 +0530",
        "Message-ID": "\n <604cef7dae418edfa928e63731772e51ad26d6d3.1627572033.git.gmuthukrishn@marvell.com>",
        "X-Mailer": "git-send-email 2.25.1",
        "In-Reply-To": "<cover.1627572033.git.gmuthukrishn@marvell.com>",
        "References": "<cover.1627572033.git.gmuthukrishn@marvell.com>",
        "MIME-Version": "1.0",
        "Content-Transfer-Encoding": "8bit",
        "Content-Type": "text/plain",
        "X-Proofpoint-ORIG-GUID": "OT924JCsqt0O-2qaikeMxy3hE1fAICIV",
        "X-Proofpoint-GUID": "OT924JCsqt0O-2qaikeMxy3hE1fAICIV",
        "X-Proofpoint-Virus-Version": "vendor=fsecure engine=2.50.10434:6.0.391, 18.0.790\n definitions=2021-07-29_10:2021-07-29,\n 2021-07-29 signatures=0",
        "Subject": "[dpdk-dev] [v1,\n 2/3] test/telemetry: add unit tests for pointer value",
        "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",
        "Sender": "\"dev\" <dev-bounces@dpdk.org>"
    },
    "content": "Adding tests to evaluate pointer value in array and dict.\n\nSigned-off-by: Gowrishankar Muthukrishnan <gmuthukrishn@marvell.com>\n---\n app/test/test_telemetry_data.c | 124 +++++++++++++++++++++++++++++++++\n app/test/test_telemetry_json.c |  28 ++++++--\n 2 files changed, 145 insertions(+), 7 deletions(-)",
    "diff": "diff --git a/app/test/test_telemetry_data.c b/app/test/test_telemetry_data.c\nindex f34d691265..59f68f135a 100644\n--- a/app/test/test_telemetry_data.c\n+++ b/app/test/test_telemetry_data.c\n@@ -301,6 +301,126 @@ test_array_with_array_u64_values(void)\n \treturn TEST_OUTPUT(\"{\\\"/test\\\":[[0,1,2,3,4],[0,1,2,3,4]]}\");\n }\n \n+static int\n+test_case_array_ptr(void)\n+{\n+\tint *p, i, j, a[] = {1, 2, 3, 4, 5};\n+\tchar exp[120];\n+\n+\tmemset(&response_data, 0, sizeof(response_data));\n+\tmemset(exp, 0, sizeof(exp));\n+\trte_tel_data_start_array(&response_data, RTE_TEL_PTR_VAL);\n+\n+\ti = sprintf(exp, \"{\\\"/test\\\":[\");\n+\tfor (j = 0; j < 5; j++) {\n+\t\tp = &a[j];\n+\t\ti += sprintf(exp + i, \"\\\"%p\\\",\", p);\n+\t\trte_tel_data_add_array_ptr(&response_data, p);\n+\t}\n+\n+\tsprintf(exp + i - 1, \"]}\");\n+\treturn TEST_OUTPUT(exp);\n+}\n+\n+static int\n+test_case_add_dict_ptr(void)\n+{\n+\tint *p, i, j, a[] = {1, 2, 3, 4, 5};\n+\tchar name[8], exp[160];\n+\n+\tmemset(&response_data, 0, sizeof(response_data));\n+\tmemset(exp, 0, sizeof(exp));\n+\trte_tel_data_start_dict(&response_data);\n+\n+\ti = sprintf(exp, \"{\\\"/test\\\":{\");\n+\tfor (j = 0; j < 5; j++) {\n+\t\tp = &a[j];\n+\t\tsprintf(name, \"dict_%d\", j);\n+\t\ti += sprintf(exp + i, \"\\\"%s\\\":\\\"%p\\\",\", name, p);\n+\t\trte_tel_data_add_dict_ptr(&response_data, name, p);\n+\t}\n+\n+\tsprintf(exp + i - 1, \"}}\");\n+\treturn TEST_OUTPUT(exp);\n+}\n+\n+static int\n+test_dict_with_array_ptr_values(void)\n+{\n+\tint *p, i, j, a[] = {1, 2, 3, 4, 5};\n+\tchar exp[256];\n+\n+\tstruct rte_tel_data *child_data = rte_tel_data_alloc();\n+\trte_tel_data_start_array(child_data, RTE_TEL_PTR_VAL);\n+\n+\tstruct rte_tel_data *child_data2 = rte_tel_data_alloc();\n+\trte_tel_data_start_array(child_data2, RTE_TEL_PTR_VAL);\n+\n+\tmemset(&response_data, 0, sizeof(response_data));\n+\tmemset(exp, 0, sizeof(exp));\n+\trte_tel_data_start_dict(&response_data);\n+\n+\ti = sprintf(exp, \"{\\\"/test\\\":{\\\"dict_0\\\":[\");\n+\tfor (j = 0; j < 5; j++) {\n+\t\tp = &a[j];\n+\t\ti += sprintf(exp + i, \"\\\"%p\\\",\", p);\n+\t\trte_tel_data_add_array_ptr(child_data, p);\n+\t}\n+\n+\ti += sprintf(exp + i - 1, \"],\\\"dict_1\\\":[\");\n+\tfor (j = 5; j > 0; j--) {\n+\t\tp = &a[j - 1];\n+\t\ti += sprintf(exp + i - 1, \"\\\"%p\\\",\", p);\n+\t\trte_tel_data_add_array_ptr(child_data2, p);\n+\t}\n+\n+\tsprintf(exp + i - 2, \"]}}\");\n+\trte_tel_data_add_dict_container(&response_data, \"dict_0\",\n+\t\t\t\t\t\t\t\tchild_data, 0);\n+\trte_tel_data_add_dict_container(&response_data, \"dict_1\",\n+\t\t\t\t\t\t\t\tchild_data2, 0);\n+\n+\treturn TEST_OUTPUT(exp);\n+}\n+\n+static int\n+test_array_with_array_ptr_values(void)\n+{\n+\tint *p, i, j, a[] = {1, 2, 3, 4, 5};\n+\tchar exp[256];\n+\n+\tstruct rte_tel_data *child_data = rte_tel_data_alloc();\n+\trte_tel_data_start_array(child_data, RTE_TEL_PTR_VAL);\n+\n+\tstruct rte_tel_data *child_data2 = rte_tel_data_alloc();\n+\trte_tel_data_start_array(child_data2, RTE_TEL_PTR_VAL);\n+\n+\tmemset(&response_data, 0, sizeof(response_data));\n+\tmemset(exp, 0, sizeof(exp));\n+\trte_tel_data_start_array(&response_data, RTE_TEL_CONTAINER);\n+\n+\ti = sprintf(exp, \"{\\\"/test\\\":[[\");\n+\tfor (j = 0; j < 5; j++) {\n+\t\tp = &a[j];\n+\t\ti += sprintf(exp + i, \"\\\"%p\\\",\", p);\n+\t\trte_tel_data_add_array_ptr(child_data, p);\n+\t}\n+\n+\ti += sprintf(exp + i - 1, \"],[\");\n+\tfor (j = 5; j > 0; j--) {\n+\t\tp = &a[j - 1];\n+\t\ti += sprintf(exp + i - 1, \"\\\"%p\\\",\", p);\n+\t\trte_tel_data_add_array_ptr(child_data2, p);\n+\t}\n+\n+\tsprintf(exp + i - 2, \"]]}\");\n+\n+\trte_tel_data_add_array_container(&response_data, child_data, 0);\n+\trte_tel_data_add_array_container(&response_data, child_data2, 0);\n+\n+\treturn TEST_OUTPUT(exp);\n+}\n+\n static int\n connect_to_socket(void)\n {\n@@ -350,13 +470,17 @@ test_telemetry_data(void)\n \n \ttest_case test_cases[] = {test_case_array_string,\n \t\t\ttest_case_array_int, test_case_array_u64,\n+\t\t\ttest_case_array_ptr,\n \t\t\ttest_case_add_dict_int, test_case_add_dict_u64,\n+\t\t\ttest_case_add_dict_ptr,\n \t\t\ttest_case_add_dict_string,\n \t\t\ttest_dict_with_array_int_values,\n \t\t\ttest_dict_with_array_u64_values,\n+\t\t\ttest_dict_with_array_ptr_values,\n \t\t\ttest_dict_with_array_string_values,\n \t\t\ttest_array_with_array_int_values,\n \t\t\ttest_array_with_array_u64_values,\n+\t\t\ttest_array_with_array_ptr_values,\n \t\t\ttest_array_with_array_string_values };\n \n \trte_telemetry_register_cmd(REQUEST_CMD, test_cb, \"Test\");\ndiff --git a/app/test/test_telemetry_json.c b/app/test/test_telemetry_json.c\nindex 790181d316..3e8e60638c 100644\n--- a/app/test/test_telemetry_json.c\n+++ b/app/test/test_telemetry_json.c\n@@ -11,18 +11,22 @@\n static int\n test_basic_array(void)\n {\n-\tconst char *expected = \"[\\\"meaning of life\\\",42]\";\n-\tchar buf[1024];\n-\tint used = 0;\n+\tchar buf[1024], expected[80];\n+\tint used = 0, n = 42, *p;\n \n \tprintf(\"%s: \", __func__);\n \tused = rte_tel_json_empty_array(buf, sizeof(buf), used);\n \tif (used != 2 || strcmp(buf, \"[]\"))\n \t\treturn -1;\n \n+\tp = &n;\n+\tmemset(expected, 0, sizeof(expected));\n+\tsprintf(expected, \"[\\\"meaning of life\\\",42,\\\"%p\\\"]\", p);\n+\n \tused = rte_tel_json_add_array_string(buf, sizeof(buf), used,\n \t\t\"meaning of life\");\n-\tused = rte_tel_json_add_array_int(buf, sizeof(buf), used, 42);\n+\tused = rte_tel_json_add_array_int(buf, sizeof(buf), used, n);\n+\tused = rte_tel_json_add_array_ptr(buf, sizeof(buf), used, p);\n \n \tprintf(\"buf = '%s', expected = '%s'\\n\", buf, expected);\n \tif (used != (int)strlen(expected))\n@@ -33,14 +37,24 @@ test_basic_array(void)\n static int\n test_basic_obj(void)\n {\n-\tconst char *expected = \"{\\\"weddings\\\":4,\\\"funerals\\\":1}\";\n-\tchar buf[1024];\n-\tint used = 0;\n+\tchar buf[1024], expected[80];\n+\tint used = 0, n = 42, *p;\n+\n+\tp = &n;\n+\tmemset(expected, 0, sizeof(expected));\n+\tsprintf(expected,\n+\t\t\t\"{\\\"weddings\\\":4,\\\"funerals\\\":1,\"\n+\t\t\t\"\\\"address\\\":\\\"%p\\\",\\\"reset\\\":\\\"(nil)\\\"}\", p);\n \n \tused = rte_tel_json_add_obj_u64(buf, sizeof(buf), used,\n \t\t\"weddings\", 4);\n \tused = rte_tel_json_add_obj_u64(buf, sizeof(buf), used,\n \t\t\"funerals\", 1);\n+\tused = rte_tel_json_add_obj_ptr(buf, sizeof(buf), used,\n+\t\t\"address\", p);\n+\tp = NULL;\n+\tused = rte_tel_json_add_obj_ptr(buf, sizeof(buf), used,\n+\t\t\"reset\", p);\n \n \tprintf(\"%s: buf = '%s', expected = '%s'\\n\", __func__, buf, expected);\n \tif (used != (int)strlen(expected))\n",
    "prefixes": [
        "v1",
        "2/3"
    ]
}