get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 64063,
    "url": "http://patches.dpdk.org/api/patches/64063/?format=api",
    "web_url": "http://patches.dpdk.org/project/dpdk/patch/20191220044524.32910-15-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": "<20191220044524.32910-15-honnappa.nagarahalli@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20191220044524.32910-15-honnappa.nagarahalli@arm.com",
    "date": "2019-12-20T04:45:21",
    "name": "[v7,14/17] test/ring: modify multi-lcore perf test cases",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "8e992b8f93906940f9b17219d63b26061e5ebb3d",
    "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/20191220044524.32910-15-honnappa.nagarahalli@arm.com/mbox/",
    "series": [
        {
            "id": 7903,
            "url": "http://patches.dpdk.org/api/series/7903/?format=api",
            "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=7903",
            "date": "2019-12-20T04:45:07",
            "name": "lib/ring: APIs to support custom element size",
            "version": 7,
            "mbox": "http://patches.dpdk.org/series/7903/mbox/"
        }
    ],
    "comments": "http://patches.dpdk.org/api/patches/64063/comments/",
    "check": "fail",
    "checks": "http://patches.dpdk.org/api/patches/64063/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 4E9DFA04F3;\n\tFri, 20 Dec 2019 05:48:12 +0100 (CET)",
            "from [92.243.14.124] (localhost [127.0.0.1])\n\tby dpdk.org (Postfix) with ESMTP id 11C701BFCB;\n\tFri, 20 Dec 2019 05:46:27 +0100 (CET)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by dpdk.org (Postfix) with ESMTP id BD6641B9B5\n for <dev@dpdk.org>; Fri, 20 Dec 2019 05:45:59 +0100 (CET)",
            "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 B5E071476;\n Thu, 19 Dec 2019 20:45:57 -0800 (PST)",
            "from qc2400f-1.austin.arm.com (qc2400f-1.austin.arm.com\n [10.118.14.48])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPSA id A07073F86C;\n Thu, 19 Dec 2019 20:45:57 -0800 (PST)"
        ],
        "From": "Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>",
        "To": "olivier.matz@6wind.com, sthemmin@microsoft.com, jerinj@marvell.com,\n bruce.richardson@intel.com, david.marchand@redhat.com,\n pbhagavatula@marvell.com, konstantin.ananyev@intel.com,\n honnappa.nagarahalli@arm.com",
        "Cc": "dev@dpdk.org, dharmik.thakkar@arm.com, ruifeng.wang@arm.com,\n gavin.hu@arm.com, nd@arm.com",
        "Date": "Thu, 19 Dec 2019 22:45:21 -0600",
        "Message-Id": "<20191220044524.32910-15-honnappa.nagarahalli@arm.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20191220044524.32910-1-honnappa.nagarahalli@arm.com>",
        "References": "<20190906190510.11146-1-honnappa.nagarahalli@arm.com>\n <20191220044524.32910-1-honnappa.nagarahalli@arm.com>",
        "Subject": "[dpdk-dev] [PATCH v7 14/17] test/ring: modify multi-lcore perf test\n\tcases",
        "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": "Modify test cases to test the performance of legacy and\nrte_ring_xxx_elem APIs for multi lcore scenarios.\n\nSigned-off-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\nReviewed-by: Gavin Hu <gavin.hu@arm.com>\n---\n app/test/test_ring_perf.c | 175 +++++++++++++++++++++++++-------------\n 1 file changed, 115 insertions(+), 60 deletions(-)",
    "diff": "diff --git a/app/test/test_ring_perf.c b/app/test/test_ring_perf.c\nindex 0f578c9ae..b893b5779 100644\n--- a/app/test/test_ring_perf.c\n+++ b/app/test/test_ring_perf.c\n@@ -178,19 +178,21 @@ struct thread_params {\n };\n \n /*\n- * Function that uses rdtsc to measure timing for ring enqueue. Needs pair\n- * thread running dequeue_bulk function\n+ * Helper function to call bulk SP/MP enqueue functions.\n+ * flag == 0 -> enqueue\n+ * flag == 1 -> dequeue\n  */\n-static int\n-enqueue_bulk(void *p)\n+static __rte_always_inline int\n+enqueue_dequeue_bulk_helper(const unsigned int flag, const int esize,\n+\tstruct thread_params *p)\n {\n-\tconst unsigned iter_shift = 23;\n-\tconst unsigned iterations = 1<<iter_shift;\n-\tstruct thread_params *params = p;\n-\tstruct rte_ring *r = params->r;\n-\tconst unsigned size = params->size;\n-\tunsigned i;\n-\tvoid *burst[MAX_BURST] = {0};\n+\tint ret;\n+\tconst unsigned int iter_shift = 23;\n+\tconst unsigned int iterations = 1 << iter_shift;\n+\tstruct rte_ring *r = p->r;\n+\tunsigned int bsize = p->size;\n+\tunsigned int i;\n+\tvoid *burst = NULL;\n \n #ifdef RTE_USE_C11_MEM_MODEL\n \tif (__atomic_add_fetch(&lcore_count, 1, __ATOMIC_RELAXED) != 2)\n@@ -200,23 +202,55 @@ enqueue_bulk(void *p)\n \t\twhile(lcore_count != 2)\n \t\t\trte_pause();\n \n+\tburst = test_ring_calloc(MAX_BURST, esize);\n+\tif (burst == NULL)\n+\t\treturn -1;\n+\n \tconst uint64_t sp_start = rte_rdtsc();\n \tfor (i = 0; i < iterations; i++)\n-\t\twhile (rte_ring_sp_enqueue_bulk(r, burst, size, NULL) == 0)\n-\t\t\trte_pause();\n+\t\tdo {\n+\t\t\tif (flag == 0)\n+\t\t\t\tTEST_RING_ENQUEUE(r, burst, esize, bsize, ret,\n+\t\t\t\t\t\tTEST_RING_S | TEST_RING_BL);\n+\t\t\telse if (flag == 1)\n+\t\t\t\tTEST_RING_DEQUEUE(r, burst, esize, bsize, ret,\n+\t\t\t\t\t\tTEST_RING_S | TEST_RING_BL);\n+\t\t\tif (ret == 0)\n+\t\t\t\trte_pause();\n+\t\t} while (!ret);\n \tconst uint64_t sp_end = rte_rdtsc();\n \n \tconst uint64_t mp_start = rte_rdtsc();\n \tfor (i = 0; i < iterations; i++)\n-\t\twhile (rte_ring_mp_enqueue_bulk(r, burst, size, NULL) == 0)\n-\t\t\trte_pause();\n+\t\tdo {\n+\t\t\tif (flag == 0)\n+\t\t\t\tTEST_RING_ENQUEUE(r, burst, esize, bsize, ret,\n+\t\t\t\t\t\tTEST_RING_M | TEST_RING_BL);\n+\t\t\telse if (flag == 1)\n+\t\t\t\tTEST_RING_DEQUEUE(r, burst, esize, bsize, ret,\n+\t\t\t\t\t\tTEST_RING_M | TEST_RING_BL);\n+\t\t\tif (ret == 0)\n+\t\t\t\trte_pause();\n+\t\t} while (!ret);\n \tconst uint64_t mp_end = rte_rdtsc();\n \n-\tparams->spsc = ((double)(sp_end - sp_start))/(iterations*size);\n-\tparams->mpmc = ((double)(mp_end - mp_start))/(iterations*size);\n+\tp->spsc = ((double)(sp_end - sp_start))/(iterations * bsize);\n+\tp->mpmc = ((double)(mp_end - mp_start))/(iterations * bsize);\n \treturn 0;\n }\n \n+/*\n+ * Function that uses rdtsc to measure timing for ring enqueue. Needs pair\n+ * thread running dequeue_bulk function\n+ */\n+static int\n+enqueue_bulk(void *p)\n+{\n+\tstruct thread_params *params = p;\n+\n+\treturn enqueue_dequeue_bulk_helper(0, -1, params);\n+}\n+\n /*\n  * Function that uses rdtsc to measure timing for ring dequeue. Needs pair\n  * thread running enqueue_bulk function\n@@ -224,45 +258,41 @@ enqueue_bulk(void *p)\n static int\n dequeue_bulk(void *p)\n {\n-\tconst unsigned iter_shift = 23;\n-\tconst unsigned iterations = 1<<iter_shift;\n \tstruct thread_params *params = p;\n-\tstruct rte_ring *r = params->r;\n-\tconst unsigned size = params->size;\n-\tunsigned i;\n-\tvoid *burst[MAX_BURST] = {0};\n \n-#ifdef RTE_USE_C11_MEM_MODEL\n-\tif (__atomic_add_fetch(&lcore_count, 1, __ATOMIC_RELAXED) != 2)\n-#else\n-\tif (__sync_add_and_fetch(&lcore_count, 1) != 2)\n-#endif\n-\t\twhile(lcore_count != 2)\n-\t\t\trte_pause();\n+\treturn enqueue_dequeue_bulk_helper(1, -1, params);\n+}\n \n-\tconst uint64_t sc_start = rte_rdtsc();\n-\tfor (i = 0; i < iterations; i++)\n-\t\twhile (rte_ring_sc_dequeue_bulk(r, burst, size, NULL) == 0)\n-\t\t\trte_pause();\n-\tconst uint64_t sc_end = rte_rdtsc();\n+/*\n+ * Function that uses rdtsc to measure timing for ring enqueue. Needs pair\n+ * thread running dequeue_bulk function\n+ */\n+static int\n+enqueue_bulk_16B(void *p)\n+{\n+\tstruct thread_params *params = p;\n \n-\tconst uint64_t mc_start = rte_rdtsc();\n-\tfor (i = 0; i < iterations; i++)\n-\t\twhile (rte_ring_mc_dequeue_bulk(r, burst, size, NULL) == 0)\n-\t\t\trte_pause();\n-\tconst uint64_t mc_end = rte_rdtsc();\n+\treturn enqueue_dequeue_bulk_helper(0, 16, params);\n+}\n \n-\tparams->spsc = ((double)(sc_end - sc_start))/(iterations*size);\n-\tparams->mpmc = ((double)(mc_end - mc_start))/(iterations*size);\n-\treturn 0;\n+/*\n+ * Function that uses rdtsc to measure timing for ring dequeue. Needs pair\n+ * thread running enqueue_bulk function\n+ */\n+static int\n+dequeue_bulk_16B(void *p)\n+{\n+\tstruct thread_params *params = p;\n+\n+\treturn enqueue_dequeue_bulk_helper(1, 16, params);\n }\n \n /*\n  * Function that calls the enqueue and dequeue bulk functions on pairs of cores.\n  * used to measure ring perf between hyperthreads, cores and sockets.\n  */\n-static void\n-run_on_core_pair(struct lcore_pair *cores, struct rte_ring *r,\n+static int\n+run_on_core_pair(struct lcore_pair *cores, struct rte_ring *r, int esize,\n \t\tlcore_function_t f1, lcore_function_t f2)\n {\n \tstruct thread_params param1 = {0}, param2 = {0};\n@@ -278,14 +308,20 @@ run_on_core_pair(struct lcore_pair *cores, struct rte_ring *r,\n \t\t} else {\n \t\t\trte_eal_remote_launch(f1, &param1, cores->c1);\n \t\t\trte_eal_remote_launch(f2, &param2, cores->c2);\n-\t\t\trte_eal_wait_lcore(cores->c1);\n-\t\t\trte_eal_wait_lcore(cores->c2);\n+\t\t\tif (rte_eal_wait_lcore(cores->c1) < 0)\n+\t\t\t\treturn -1;\n+\t\t\tif (rte_eal_wait_lcore(cores->c2) < 0)\n+\t\t\t\treturn -1;\n \t\t}\n-\t\tprintf(\"SP/SC bulk enq/dequeue (size: %u): %.2F\\n\", bulk_sizes[i],\n-\t\t\t\tparam1.spsc + param2.spsc);\n-\t\tprintf(\"MP/MC bulk enq/dequeue (size: %u): %.2F\\n\", bulk_sizes[i],\n-\t\t\t\tparam1.mpmc + param2.mpmc);\n+\t\ttest_ring_print_test_string(TEST_RING_S | TEST_RING_BL, esize,\n+\t\t\t\t\t\tbulk_sizes[i],\n+\t\t\t\t\t\tparam1.spsc + param2.spsc);\n+\t\ttest_ring_print_test_string(TEST_RING_M | TEST_RING_BL, esize,\n+\t\t\t\t\t\tbulk_sizes[i],\n+\t\t\t\t\t\tparam1.mpmc + param2.mpmc);\n \t}\n+\n+\treturn 0;\n }\n \n static rte_atomic32_t synchro;\n@@ -466,6 +502,24 @@ test_ring_perf(void)\n \tprintf(\"\\n### Testing empty bulk deq ###\\n\");\n \ttest_empty_dequeue(r, -1, TEST_RING_S | TEST_RING_BL);\n \ttest_empty_dequeue(r, -1, TEST_RING_M | TEST_RING_BL);\n+\tif (get_two_hyperthreads(&cores) == 0) {\n+\t\tprintf(\"\\n### Testing using two hyperthreads ###\\n\");\n+\t\tif (run_on_core_pair(&cores, r, -1, enqueue_bulk,\n+\t\t\t\t\tdequeue_bulk) < 0)\n+\t\t\treturn -1;\n+\t}\n+\tif (get_two_cores(&cores) == 0) {\n+\t\tprintf(\"\\n### Testing using two physical cores ###\\n\");\n+\t\tif (run_on_core_pair(&cores, r, -1, enqueue_bulk,\n+\t\t\t\t\tdequeue_bulk) < 0)\n+\t\t\treturn -1;\n+\t}\n+\tif (get_two_sockets(&cores) == 0) {\n+\t\tprintf(\"\\n### Testing using two NUMA nodes ###\\n\");\n+\t\tif (run_on_core_pair(&cores, r, -1, enqueue_bulk,\n+\t\t\t\t\tdequeue_bulk) < 0)\n+\t\t\treturn -1;\n+\t}\n \trte_ring_free(r);\n \n \tTEST_RING_CREATE(RING_NAME, 16, RING_SIZE, rte_socket_id(), 0, r);\n@@ -494,29 +548,30 @@ test_ring_perf(void)\n \tprintf(\"\\n### Testing empty bulk deq ###\\n\");\n \ttest_empty_dequeue(r, 16, TEST_RING_S | TEST_RING_BL);\n \ttest_empty_dequeue(r, 16, TEST_RING_M | TEST_RING_BL);\n-\trte_ring_free(r);\n-\n-\tr = rte_ring_create(RING_NAME, RING_SIZE, rte_socket_id(), 0);\n-\tif (r == NULL)\n-\t\treturn -1;\n-\n \tif (get_two_hyperthreads(&cores) == 0) {\n \t\tprintf(\"\\n### Testing using two hyperthreads ###\\n\");\n-\t\trun_on_core_pair(&cores, r, enqueue_bulk, dequeue_bulk);\n+\t\tif (run_on_core_pair(&cores, r, 16, enqueue_bulk_16B,\n+\t\t\t\t\tdequeue_bulk_16B) < 0)\n+\t\t\treturn -1;\n \t}\n \tif (get_two_cores(&cores) == 0) {\n \t\tprintf(\"\\n### Testing using two physical cores ###\\n\");\n-\t\trun_on_core_pair(&cores, r, enqueue_bulk, dequeue_bulk);\n+\t\tif (run_on_core_pair(&cores, r, 16, enqueue_bulk_16B,\n+\t\t\t\t\tdequeue_bulk_16B) < 0)\n+\t\t\treturn -1;\n \t}\n \tif (get_two_sockets(&cores) == 0) {\n \t\tprintf(\"\\n### Testing using two NUMA nodes ###\\n\");\n-\t\trun_on_core_pair(&cores, r, enqueue_bulk, dequeue_bulk);\n+\t\tif (run_on_core_pair(&cores, r, 16, enqueue_bulk_16B,\n+\t\t\t\t\tdequeue_bulk_16B) < 0)\n+\t\t\treturn -1;\n \t}\n \n \tprintf(\"\\n### Testing using all slave nodes ###\\n\");\n \trun_on_all_cores(r);\n \n \trte_ring_free(r);\n+\n \treturn 0;\n }\n \n",
    "prefixes": [
        "v7",
        "14/17"
    ]
}