get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 77458,
    "url": "http://patches.dpdk.org/api/patches/77458/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20200911161002.19816-6-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": "<20200911161002.19816-6-feifei.wang2@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20200911161002.19816-6-feifei.wang2@arm.com",
    "date": "2020-09-11T16:10:01",
    "name": "[v3,5/6] test/ring: fix wrong size used in memcmp",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "7601f497091449576d6d4b96fa33254972ea48d2",
    "submitter": {
        "id": 1771,
        "url": "http://patches.dpdk.org/api/people/1771/?format=api",
        "name": "Feifei Wang",
        "email": "feifei.wang2@arm.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patches.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patches.dpdk.org/project/dpdk/patch/20200911161002.19816-6-feifei.wang2@arm.com/mbox/",
    "series": [
        {
            "id": 12156,
            "url": "http://patches.dpdk.org/api/series/12156/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=12156",
            "date": "2020-09-11T16:09:56",
            "name": "fix wrong passed pointer and add check",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/12156/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/77458/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/77458/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 dpdk.org (dpdk.org [92.243.14.124])\n\tby inbox.dpdk.org (Postfix) with ESMTP id 3F2E3A04BB;\n\tFri, 11 Sep 2020 18:11:25 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 39F111C120;\n\tFri, 11 Sep 2020 18:10:48 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id 860D3E07;\n Fri, 11 Sep 2020 18:10:47 +0200 (CEST)",
            "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 1D969106F;\n Fri, 11 Sep 2020 09:10:47 -0700 (PDT)",
            "from net-arm-n1sdp.shanghai.arm.com (net-arm-n1sdp.shanghai.arm.com\n [10.169.208.213])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 5CB233F73C;\n Fri, 11 Sep 2020 09:10:44 -0700 (PDT)"
        ],
        "From": "Feifei Wang <feifei.wang2@arm.com>",
        "To": "Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,\n Konstantin Ananyev <konstantin.ananyev@intel.com>,\n Olivier Matz <olivier.matz@6wind.com>, Gavin Hu <gavin.hu@arm.com>",
        "Cc": "dev@dpdk.org, nd@arm.com, Feifei Wang <feifei.wang2@arm.com>,\n stable@dpdk.org",
        "Date": "Fri, 11 Sep 2020 11:10:01 -0500",
        "Message-Id": "<20200911161002.19816-6-feifei.wang2@arm.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20200911161002.19816-1-feifei.wang2@arm.com>",
        "References": "<20200729063105.11299-1-feifei.wang2@arm.com>\n <20200911161002.19816-1-feifei.wang2@arm.com>",
        "Subject": "[dpdk-dev] [PATCH v3 5/6] test/ring: fix wrong size used in memcmp",
        "X-BeenThere": "dev@dpdk.org",
        "X-Mailman-Version": "2.1.15",
        "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": "When using memcmp function to check data, the third param should be the\nsize of all elements, rather than the number of the elements.\n\nFurthermore, do code clean up by moving repeated code inside\n'test_ring_mem_cmp' function to validate data and print information of\nenqueue/dequeue elements if validation fails.\n\nFixes: a9fe152363e2 (\"test/ring: add custom element size functional tests\")\nCc: honnappa.nagarahalli@arm.com\nCc: stable@dpdk.org\n\nSigned-off-by: Feifei Wang <feifei.wang2@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\nReviewed-by: Phil Yang <phil.yang@arm.com>\nReviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>\n---\n app/test/test_ring.c | 59 ++++++++++++++++++++------------------------\n 1 file changed, 27 insertions(+), 32 deletions(-)",
    "diff": "diff --git a/app/test/test_ring.c b/app/test/test_ring.c\nindex 811adc523..4a2bd39fc 100644\n--- a/app/test/test_ring.c\n+++ b/app/test/test_ring.c\n@@ -258,6 +258,21 @@ test_ring_mem_init(void *obj, unsigned int count, int esize)\n \t\t\t((uint32_t *)obj)[i] = i;\n }\n \n+static int\n+test_ring_mem_cmp(void *src, void *dst, unsigned int size)\n+{\n+\tint ret;\n+\n+\tret = memcmp(src, dst, size);\n+\tif (ret) {\n+\t\trte_hexdump(stdout, \"src\", src, size);\n+\t\trte_hexdump(stdout, \"dst\", dst, size);\n+\t\tprintf(\"data after dequeue is not the same\\n\");\n+\t}\n+\n+\treturn ret;\n+}\n+\n static void\n test_ring_print_test_string(const char *istr, unsigned int api_type, int esize)\n {\n@@ -383,7 +398,7 @@ test_ring_burst_bulk_tests1(unsigned int test_idx)\n \tstruct rte_ring *r;\n \tvoid **src = NULL, **cur_src = NULL, **dst = NULL, **cur_dst = NULL;\n \tint ret;\n-\tunsigned int i, j;\n+\tunsigned int i, j, temp_sz;\n \tint rand;\n \tconst unsigned int rsz = RING_SIZE - 1;\n \n@@ -444,7 +459,11 @@ test_ring_burst_bulk_tests1(unsigned int test_idx)\n \t\t\tTEST_RING_VERIFY(rte_ring_empty(r));\n \n \t\t\t/* check data */\n-\t\t\tTEST_RING_VERIFY(memcmp(src, dst, rsz) == 0);\n+\t\t\ttemp_sz = rsz * sizeof(void *);\n+\t\t\tif (esize[i] != -1)\n+\t\t\t\ttemp_sz = rsz * esize[i];\n+\t\t\tTEST_RING_VERIFY(test_ring_mem_cmp(src, dst,\n+\t\t\t\t\t\ttemp_sz) == 0);\n \t\t}\n \n \t\t/* Free memory before test completed */\n@@ -538,12 +557,8 @@ test_ring_burst_bulk_tests2(unsigned int test_idx)\n \t\tcur_dst = test_ring_inc_ptr(cur_dst, esize[i], MAX_BULK);\n \n \t\t/* check data */\n-\t\tif (memcmp(src, dst, cur_dst - dst)) {\n-\t\t\trte_hexdump(stdout, \"src\", src, cur_src - src);\n-\t\t\trte_hexdump(stdout, \"dst\", dst, cur_dst - dst);\n-\t\t\tprintf(\"data after dequeue is not the same\\n\");\n+\t\tif (test_ring_mem_cmp(src, dst, RTE_PTR_DIFF(cur_dst, dst)))\n \t\t\tgoto fail;\n-\t\t}\n \n \t\t/* Free memory before test completed */\n \t\trte_ring_free(r);\n@@ -614,12 +629,8 @@ test_ring_burst_bulk_tests3(unsigned int test_idx)\n \t\t}\n \n \t\t/* check data */\n-\t\tif (memcmp(src, dst, cur_dst - dst)) {\n-\t\t\trte_hexdump(stdout, \"src\", src, cur_src - src);\n-\t\t\trte_hexdump(stdout, \"dst\", dst, cur_dst - dst);\n-\t\t\tprintf(\"data after dequeue is not the same\\n\");\n+\t\tif (test_ring_mem_cmp(src, dst, RTE_PTR_DIFF(cur_dst, dst)))\n \t\t\tgoto fail;\n-\t\t}\n \n \t\t/* Free memory before test completed */\n \t\trte_ring_free(r);\n@@ -747,12 +758,8 @@ test_ring_burst_bulk_tests4(unsigned int test_idx)\n \t\t\tgoto fail;\n \n \t\t/* check data */\n-\t\tif (memcmp(src, dst, cur_dst - dst)) {\n-\t\t\trte_hexdump(stdout, \"src\", src, cur_src - src);\n-\t\t\trte_hexdump(stdout, \"dst\", dst, cur_dst - dst);\n-\t\t\tprintf(\"data after dequeue is not the same\\n\");\n+\t\tif (test_ring_mem_cmp(src, dst, RTE_PTR_DIFF(cur_dst, dst)))\n \t\t\tgoto fail;\n-\t\t}\n \n \t\t/* Free memory before test completed */\n \t\trte_ring_free(r);\n@@ -857,12 +864,8 @@ test_ring_basic_ex(void)\n \t\t}\n \n \t\t/* check data */\n-\t\tif (memcmp(src, dst, cur_src - src)) {\n-\t\t\trte_hexdump(stdout, \"src\", src, cur_src - src);\n-\t\t\trte_hexdump(stdout, \"dst\", dst, cur_dst - dst);\n-\t\t\tprintf(\"data after dequeue is not the same\\n\");\n+\t\tif (test_ring_mem_cmp(src, dst, RTE_PTR_DIFF(cur_src, src)))\n \t\t\tgoto fail_test;\n-\t\t}\n \n \t\t/* Following tests use the configured flags to decide\n \t\t * SP/SC or MP/MC.\n@@ -909,12 +912,8 @@ test_ring_basic_ex(void)\n \t\tcur_dst = test_ring_inc_ptr(cur_dst, esize[i], 2);\n \n \t\t/* check data */\n-\t\tif (memcmp(src, dst, cur_dst - dst)) {\n-\t\t\trte_hexdump(stdout, \"src\", src, cur_src - src);\n-\t\t\trte_hexdump(stdout, \"dst\", dst, cur_dst - dst);\n-\t\t\tprintf(\"data after dequeue is not the same\\n\");\n+\t\tif (test_ring_mem_cmp(src, dst, RTE_PTR_DIFF(cur_dst, dst)))\n \t\t\tgoto fail_test;\n-\t\t}\n \n \t\trte_ring_free(rp);\n \t\trte_free(src);\n@@ -1047,12 +1046,8 @@ test_ring_with_exact_size(void)\n \t\t}\n \n \t\t/* check data */\n-\t\tif (memcmp(src, dst, cur_dst - dst)) {\n-\t\t\trte_hexdump(stdout, \"src\", src, cur_src - src);\n-\t\t\trte_hexdump(stdout, \"dst\", dst, cur_dst - dst);\n-\t\t\tprintf(\"data after dequeue is not the same\\n\");\n+\t\tif (test_ring_mem_cmp(src, dst, RTE_PTR_DIFF(cur_dst, dst)))\n \t\t\tgoto test_fail;\n-\t\t}\n \n \t\trte_free(src_orig);\n \t\trte_free(dst_orig);\n",
    "prefixes": [
        "v3",
        "5/6"
    ]
}