get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 81860,
    "url": "http://patches.dpdk.org/api/patches/81860/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20201023044343.13462-5-honnappa.nagarahalli@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": "<20201023044343.13462-5-honnappa.nagarahalli@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20201023044343.13462-5-honnappa.nagarahalli@arm.com",
    "date": "2020-10-23T04:43:42",
    "name": "[v3,4/5] test/ring: add functional tests for zero copy APIs",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c676d1d16471eeeaf91c52208f5d795c6380523c",
    "submitter": {
        "id": 1045,
        "url": "http://patches.dpdk.org/api/people/1045/?format=api",
        "name": "Honnappa Nagarahalli",
        "email": "honnappa.nagarahalli@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/20201023044343.13462-5-honnappa.nagarahalli@arm.com/mbox/",
    "series": [
        {
            "id": 13245,
            "url": "http://patches.dpdk.org/api/series/13245/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=13245",
            "date": "2020-10-23T04:43:38",
            "name": "lib/ring: add zero copy APIs",
            "version": 3,
            "mbox": "http://patches.dpdk.org/series/13245/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/81860/comments/",
    "check": "success",
    "checks": "http://patches.dpdk.org/api/patches/81860/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 B08E6A04DE;\n\tFri, 23 Oct 2020 06:45:18 +0200 (CEST)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 3A08F72DF;\n\tFri, 23 Oct 2020 06:44:27 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id 735926CAD\n for <dev@dpdk.org>; Fri, 23 Oct 2020 06:44:23 +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 F18C8142F;\n Thu, 22 Oct 2020 21:44:21 -0700 (PDT)",
            "from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com\n [10.118.12.27])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id E66CC3F66B;\n Thu, 22 Oct 2020 21:44:21 -0700 (PDT)"
        ],
        "From": "Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>",
        "To": "dev@dpdk.org, honnappa.nagarahalli@arm.com, konstantin.ananyev@intel.com",
        "Cc": "olivier.matz@6wind.com, david.marchand@redhat.com,\n dharmik.thakkar@arm.com,\n ruifeng.wang@arm.com, nd@arm.com",
        "Date": "Thu, 22 Oct 2020 23:43:42 -0500",
        "Message-Id": "<20201023044343.13462-5-honnappa.nagarahalli@arm.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20201023044343.13462-1-honnappa.nagarahalli@arm.com>",
        "References": "<20200224203931.21256-1-honnappa.nagarahalli@arm.com>\n <20201023044343.13462-1-honnappa.nagarahalli@arm.com>",
        "Subject": "[dpdk-dev] [PATCH v3 4/5] test/ring: add functional tests for zero\n\tcopy APIs",
        "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": "Add functional tests for zero copy APIs. Test enqueue/dequeue\nfunctions are created using the zero copy APIs to fit into\nthe existing testing method.\n\nSigned-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nReviewed-by: Dharmik Thakkar <dharmik.thakkar@arm.com>\n---\n app/test/test_ring.c | 196 +++++++++++++++++++++++++++++++++++++++++++\n app/test/test_ring.h |  42 ++++++++++\n 2 files changed, 238 insertions(+)",
    "diff": "diff --git a/app/test/test_ring.c b/app/test/test_ring.c\nindex 329d538a9..99fe4b46f 100644\n--- a/app/test/test_ring.c\n+++ b/app/test/test_ring.c\n@@ -1,5 +1,6 @@\n /* SPDX-License-Identifier: BSD-3-Clause\n  * Copyright(c) 2010-2014 Intel Corporation\n+ * Copyright(c) 2020 Arm Limited\n  */\n \n #include <string.h>\n@@ -68,6 +69,149 @@\n \n static const int esize[] = {-1, 4, 8, 16, 20};\n \n+/* Wrappers around the zero-copy APIs. The wrappers match\n+ * the normal enqueue/dequeue API declarations.\n+ */\n+static unsigned int\n+test_ring_enqueue_zc_bulk(struct rte_ring *r, void * const *obj_table,\n+\tunsigned int n, unsigned int *free_space)\n+{\n+\tunsigned int ret;\n+\tstruct rte_ring_zc_data zcd;\n+\n+\tret = rte_ring_enqueue_zc_bulk_start(r, n, &zcd, free_space);\n+\tif (ret > 0) {\n+\t\t/* Copy the data to the ring */\n+\t\ttest_ring_copy_to(&zcd, obj_table, sizeof(void *), ret);\n+\t\trte_ring_enqueue_zc_finish(r, ret);\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static unsigned int\n+test_ring_enqueue_zc_bulk_elem(struct rte_ring *r, const void *obj_table,\n+\tunsigned int esize, unsigned int n, unsigned int *free_space)\n+{\n+\tunsigned int ret;\n+\tstruct rte_ring_zc_data zcd;\n+\n+\tret = rte_ring_enqueue_zc_bulk_elem_start(r, esize, n,\n+\t\t\t\t&zcd, free_space);\n+\tif (ret > 0) {\n+\t\t/* Copy the data to the ring */\n+\t\ttest_ring_copy_to(&zcd, obj_table, esize, ret);\n+\t\trte_ring_enqueue_zc_finish(r, ret);\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static unsigned int\n+test_ring_enqueue_zc_burst(struct rte_ring *r, void * const *obj_table,\n+\tunsigned int n, unsigned int *free_space)\n+{\n+\tunsigned int ret;\n+\tstruct rte_ring_zc_data zcd;\n+\n+\tret = rte_ring_enqueue_zc_burst_start(r, n, &zcd, free_space);\n+\tif (ret > 0) {\n+\t\t/* Copy the data to the ring */\n+\t\ttest_ring_copy_to(&zcd, obj_table, sizeof(void *), ret);\n+\t\trte_ring_enqueue_zc_finish(r, ret);\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static unsigned int\n+test_ring_enqueue_zc_burst_elem(struct rte_ring *r, const void *obj_table,\n+\tunsigned int esize, unsigned int n, unsigned int *free_space)\n+{\n+\tunsigned int ret;\n+\tstruct rte_ring_zc_data zcd;\n+\n+\tret = rte_ring_enqueue_zc_burst_elem_start(r, esize, n,\n+\t\t\t\t&zcd, free_space);\n+\tif (ret > 0) {\n+\t\t/* Copy the data to the ring */\n+\t\ttest_ring_copy_to(&zcd, obj_table, esize, ret);\n+\t\trte_ring_enqueue_zc_finish(r, ret);\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static unsigned int\n+test_ring_dequeue_zc_bulk(struct rte_ring *r, void **obj_table,\n+\tunsigned int n, unsigned int *available)\n+{\n+\tunsigned int ret;\n+\tstruct rte_ring_zc_data zcd;\n+\n+\tret = rte_ring_dequeue_zc_bulk_start(r, n, &zcd, available);\n+\tif (ret > 0) {\n+\t\t/* Copy the data from the ring */\n+\t\ttest_ring_copy_from(&zcd, obj_table, sizeof(void *), ret);\n+\t\trte_ring_dequeue_zc_finish(r, ret);\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static unsigned int\n+test_ring_dequeue_zc_bulk_elem(struct rte_ring *r, void *obj_table,\n+\tunsigned int esize, unsigned int n, unsigned int *available)\n+{\n+\tunsigned int ret;\n+\tstruct rte_ring_zc_data zcd;\n+\n+\tret = rte_ring_dequeue_zc_bulk_elem_start(r, esize, n,\n+\t\t\t\t&zcd, available);\n+\tif (ret > 0) {\n+\t\t/* Copy the data from the ring */\n+\t\ttest_ring_copy_from(&zcd, obj_table, esize, ret);\n+\t\trte_ring_dequeue_zc_finish(r, ret);\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static unsigned int\n+test_ring_dequeue_zc_burst(struct rte_ring *r, void **obj_table,\n+\tunsigned int n, unsigned int *available)\n+{\n+\tunsigned int ret;\n+\tstruct rte_ring_zc_data zcd;\n+\n+\tret = rte_ring_dequeue_zc_burst_start(r, n, &zcd, available);\n+\tif (ret > 0) {\n+\t\t/* Copy the data from the ring */\n+\t\ttest_ring_copy_from(&zcd, obj_table, sizeof(void *), ret);\n+\t\trte_ring_dequeue_zc_finish(r, ret);\n+\t}\n+\n+\treturn ret;\n+}\n+\n+static unsigned int\n+test_ring_dequeue_zc_burst_elem(struct rte_ring *r, void *obj_table,\n+\tunsigned int esize, unsigned int n, unsigned int *available)\n+{\n+\tunsigned int ret;\n+\tstruct rte_ring_zc_data zcd;\n+\n+\tret = rte_ring_dequeue_zc_burst_elem_start(r, esize, n,\n+\t\t\t\t&zcd, available);\n+\tif (ret > 0) {\n+\t\t/* Copy the data from the ring */\n+\t\ttest_ring_copy_from(&zcd, obj_table, esize, ret);\n+\t\trte_ring_dequeue_zc_finish(r, ret);\n+\t}\n+\n+\treturn ret;\n+}\n+\n static const struct {\n \tconst char *desc;\n \tuint32_t api_type;\n@@ -219,6 +363,58 @@ static const struct {\n \t\t\t.felem = rte_ring_dequeue_burst_elem,\n \t\t},\n \t},\n+\t{\n+\t\t.desc = \"SP/SC sync mode (ZC)\",\n+\t\t.api_type = TEST_RING_ELEM_BULK | TEST_RING_THREAD_SPSC,\n+\t\t.create_flags = RING_F_SP_ENQ | RING_F_SC_DEQ,\n+\t\t.enq = {\n+\t\t\t.flegacy = test_ring_enqueue_zc_bulk,\n+\t\t\t.felem = test_ring_enqueue_zc_bulk_elem,\n+\t\t},\n+\t\t.deq = {\n+\t\t\t.flegacy = test_ring_dequeue_zc_bulk,\n+\t\t\t.felem = test_ring_dequeue_zc_bulk_elem,\n+\t\t},\n+\t},\n+\t{\n+\t\t.desc = \"MP_HTS/MC_HTS sync mode (ZC)\",\n+\t\t.api_type = TEST_RING_ELEM_BULK | TEST_RING_THREAD_DEF,\n+\t\t.create_flags = RING_F_MP_HTS_ENQ | RING_F_MC_HTS_DEQ,\n+\t\t.enq = {\n+\t\t\t.flegacy = test_ring_enqueue_zc_bulk,\n+\t\t\t.felem = test_ring_enqueue_zc_bulk_elem,\n+\t\t},\n+\t\t.deq = {\n+\t\t\t.flegacy = test_ring_dequeue_zc_bulk,\n+\t\t\t.felem = test_ring_dequeue_zc_bulk_elem,\n+\t\t},\n+\t},\n+\t{\n+\t\t.desc = \"SP/SC sync mode (ZC)\",\n+\t\t.api_type = TEST_RING_ELEM_BURST | TEST_RING_THREAD_SPSC,\n+\t\t.create_flags = RING_F_SP_ENQ | RING_F_SC_DEQ,\n+\t\t.enq = {\n+\t\t\t.flegacy = test_ring_enqueue_zc_burst,\n+\t\t\t.felem = test_ring_enqueue_zc_burst_elem,\n+\t\t},\n+\t\t.deq = {\n+\t\t\t.flegacy = test_ring_dequeue_zc_burst,\n+\t\t\t.felem = test_ring_dequeue_zc_burst_elem,\n+\t\t},\n+\t},\n+\t{\n+\t\t.desc = \"MP_HTS/MC_HTS sync mode (ZC)\",\n+\t\t.api_type = TEST_RING_ELEM_BURST | TEST_RING_THREAD_DEF,\n+\t\t.create_flags = RING_F_MP_HTS_ENQ | RING_F_MC_HTS_DEQ,\n+\t\t.enq = {\n+\t\t\t.flegacy = test_ring_enqueue_zc_burst,\n+\t\t\t.felem = test_ring_enqueue_zc_burst_elem,\n+\t\t},\n+\t\t.deq = {\n+\t\t\t.flegacy = test_ring_dequeue_zc_burst,\n+\t\t\t.felem = test_ring_dequeue_zc_burst_elem,\n+\t\t},\n+\t}\n };\n \n static unsigned int\ndiff --git a/app/test/test_ring.h b/app/test/test_ring.h\nindex 16697ee02..33c8a31fe 100644\n--- a/app/test/test_ring.h\n+++ b/app/test/test_ring.h\n@@ -53,6 +53,48 @@ test_ring_inc_ptr(void **obj, int esize, unsigned int n)\n \t\t\t\t\t(n * esize / sizeof(uint32_t)));\n }\n \n+static inline void\n+test_ring_mem_copy(void *dst, void * const *src, int esize, unsigned int num)\n+{\n+\tsize_t temp_sz;\n+\n+\ttemp_sz = num * sizeof(void *);\n+\tif (esize != -1)\n+\t\ttemp_sz = esize * num;\n+\n+\tmemcpy(dst, src, temp_sz);\n+}\n+\n+/* Copy to the ring memory */\n+static inline void\n+test_ring_copy_to(struct rte_ring_zc_data *zcd, void * const *src, int esize,\n+\tunsigned int num)\n+{\n+\ttest_ring_mem_copy(zcd->ptr1, src, esize, zcd->n1);\n+\tif (zcd->n1 != num) {\n+\t\tif (esize == -1)\n+\t\t\tsrc = src + zcd->n1;\n+\t\telse\n+\t\t\tsrc = (void * const *)(((const uint32_t *)src) +\n+\t\t\t\t\t(zcd->n1 * esize / sizeof(uint32_t)));\n+\t\ttest_ring_mem_copy(zcd->ptr2, src,\n+\t\t\t\t\tesize, num - zcd->n1);\n+\t}\n+}\n+\n+/* Copy from the ring memory */\n+static inline void\n+test_ring_copy_from(struct rte_ring_zc_data *zcd, void *dst, int esize,\n+\tunsigned int num)\n+{\n+\ttest_ring_mem_copy(dst, zcd->ptr1, esize, zcd->n1);\n+\n+\tif (zcd->n1 != num) {\n+\t\tdst = test_ring_inc_ptr(dst, esize, zcd->n1);\n+\t\ttest_ring_mem_copy(dst, zcd->ptr2, esize, num - zcd->n1);\n+\t}\n+}\n+\n static __rte_always_inline unsigned int\n test_ring_enqueue(struct rte_ring *r, void **obj, int esize, unsigned int n,\n \t\t\tunsigned int api_type)\n",
    "prefixes": [
        "v3",
        "4/5"
    ]
}