Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/104446/?format=api
http://patches.dpdk.org/api/patches/104446/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/20211117082200.1029621-10-joyce.kong@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": "<20211117082200.1029621-10-joyce.kong@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20211117082200.1029621-10-joyce.kong@arm.com", "date": "2021-11-17T08:21:57", "name": "[v3,09/12] app/compress: use compiler atomic builtins for display sync", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "ec3b5b1d7b474eb39830201bd2261a22c7c24873", "submitter": { "id": 970, "url": "http://patches.dpdk.org/api/people/970/?format=api", "name": "Joyce Kong", "email": "joyce.kong@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/20211117082200.1029621-10-joyce.kong@arm.com/mbox/", "series": [ { "id": 20609, "url": "http://patches.dpdk.org/api/series/20609/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=20609", "date": "2021-11-17T08:21:48", "name": "use compiler atomic builtins for app modules", "version": 3, "mbox": "http://patches.dpdk.org/series/20609/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/104446/comments/", "check": "warning", "checks": "http://patches.dpdk.org/api/patches/104446/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 1B9F8A0C41;\n\tWed, 17 Nov 2021 09:23:18 +0100 (CET)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 72C504116D;\n\tWed, 17 Nov 2021 09:22:52 +0100 (CET)", "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id 306C64116D\n for <dev@dpdk.org>; Wed, 17 Nov 2021 09:22:51 +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 BAA8E6D;\n Wed, 17 Nov 2021 00:22:50 -0800 (PST)", "from net-arm-n1amp-02.shanghai.arm.com\n (net-arm-n1amp-02.shanghai.arm.com [10.169.210.110])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id E43513F5A1;\n Wed, 17 Nov 2021 00:22:48 -0800 (PST)" ], "From": "Joyce Kong <joyce.kong@arm.com>", "To": "", "Cc": "dev@dpdk.org, honnappa.nagarahalli@arm.com, nd@arm.com,\n Joyce Kong <joyce.kong@arm.com>, Ruifeng Wang <ruifeng.wang@arm.com>", "Subject": "[PATCH v3 09/12] app/compress: use compiler atomic builtins for\n display sync", "Date": "Wed, 17 Nov 2021 08:21:57 +0000", "Message-Id": "<20211117082200.1029621-10-joyce.kong@arm.com>", "X-Mailer": "git-send-email 2.25.1", "In-Reply-To": "<20211117082200.1029621-1-joyce.kong@arm.com>", "References": "<20211116094205.750359-1-joyce.kong@arm.com>\n <20211117082200.1029621-1-joyce.kong@arm.com>", "MIME-Version": "1.0", "Content-Transfer-Encoding": "8bit", "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": "Convert rte_atomic_test_and_set usage to compiler atomic\nCAS operation for display sync.\n\nSigned-off-by: Joyce Kong <joyce.kong@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\nReviewed-by: Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>\n---\n app/test-compress-perf/comp_perf_test_common.h | 2 +-\n .../comp_perf_test_cyclecount.c | 15 +++++++--------\n .../comp_perf_test_throughput.c | 10 +++++++---\n app/test-compress-perf/comp_perf_test_verify.c | 6 ++++--\n 4 files changed, 19 insertions(+), 14 deletions(-)", "diff": "diff --git a/app/test-compress-perf/comp_perf_test_common.h b/app/test-compress-perf/comp_perf_test_common.h\nindex 72705c6a2b..d039e5a29a 100644\n--- a/app/test-compress-perf/comp_perf_test_common.h\n+++ b/app/test-compress-perf/comp_perf_test_common.h\n@@ -14,7 +14,7 @@ struct cperf_mem_resources {\n \tuint16_t qp_id;\n \tuint8_t lcore_id;\n \n-\trte_atomic16_t print_info_once;\n+\tuint16_t print_info_once;\n \n \tuint32_t total_bufs;\n \tuint8_t *compressed_data;\ndiff --git a/app/test-compress-perf/comp_perf_test_cyclecount.c b/app/test-compress-perf/comp_perf_test_cyclecount.c\nindex c875ddbdac..da55b02b74 100644\n--- a/app/test-compress-perf/comp_perf_test_cyclecount.c\n+++ b/app/test-compress-perf/comp_perf_test_cyclecount.c\n@@ -466,7 +466,7 @@ cperf_cyclecount_test_runner(void *test_ctx)\n \tstruct cperf_cyclecount_ctx *ctx = test_ctx;\n \tstruct comp_test_data *test_data = ctx->ver.options;\n \tuint32_t lcore = rte_lcore_id();\n-\tstatic rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);\n+\tstatic uint16_t display_once;\n \tstatic rte_spinlock_t print_spinlock;\n \tint i;\n \n@@ -486,10 +486,12 @@ cperf_cyclecount_test_runner(void *test_ctx)\n \n \tctx->ver.mem.lcore_id = lcore;\n \n+\tuint16_t exp = 0;\n \t/*\n \t * printing information about current compression thread\n \t */\n-\tif (rte_atomic16_test_and_set(&ctx->ver.mem.print_info_once))\n+\tif (__atomic_compare_exchange_n(&ctx->ver.mem.print_info_once, &exp,\n+\t\t\t\t1, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED))\n \t\tprintf(\" lcore: %u,\"\n \t\t\t\t\" driver name: %s,\"\n \t\t\t\t\" device name: %s,\"\n@@ -546,9 +548,10 @@ cperf_cyclecount_test_runner(void *test_ctx)\n \t\t\t(ctx->ver.mem.total_bufs * test_data->num_iter);\n \n \t/* R E P O R T processing */\n-\tif (rte_atomic16_test_and_set(&display_once)) {\n+\trte_spinlock_lock(&print_spinlock);\n \n-\t\trte_spinlock_lock(&print_spinlock);\n+\tif (display_once == 0) {\n+\t\tdisplay_once = 1;\n \n \t\tprintf(\"\\nLegend for the table\\n\"\n \t\t\" - Retries section: number of retries for the following operations:\\n\"\n@@ -576,12 +579,8 @@ cperf_cyclecount_test_runner(void *test_ctx)\n \t\t\t\"setup/op\",\n \t\t\t\"[C-e]\", \"[C-d]\",\n \t\t\t\"[D-e]\", \"[D-d]\");\n-\n-\t\trte_spinlock_unlock(&print_spinlock);\n \t}\n \n-\trte_spinlock_lock(&print_spinlock);\n-\n \tprintf(\"%12u\"\n \t \"%6u\"\n \t \"%12zu\"\ndiff --git a/app/test-compress-perf/comp_perf_test_throughput.c b/app/test-compress-perf/comp_perf_test_throughput.c\nindex 13922b658c..d3dff070b0 100644\n--- a/app/test-compress-perf/comp_perf_test_throughput.c\n+++ b/app/test-compress-perf/comp_perf_test_throughput.c\n@@ -329,15 +329,17 @@ cperf_throughput_test_runner(void *test_ctx)\n \tstruct cperf_benchmark_ctx *ctx = test_ctx;\n \tstruct comp_test_data *test_data = ctx->ver.options;\n \tuint32_t lcore = rte_lcore_id();\n-\tstatic rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);\n+\tstatic uint16_t display_once;\n \tint i, ret = EXIT_SUCCESS;\n \n \tctx->ver.mem.lcore_id = lcore;\n \n+\tuint16_t exp = 0;\n \t/*\n \t * printing information about current compression thread\n \t */\n-\tif (rte_atomic16_test_and_set(&ctx->ver.mem.print_info_once))\n+\tif (__atomic_compare_exchange_n(&ctx->ver.mem.print_info_once, &exp,\n+\t\t\t\t1, 0, __ATOMIC_RELAXED, __ATOMIC_RELAXED))\n \t\tprintf(\" lcore: %u,\"\n \t\t\t\t\" driver name: %s,\"\n \t\t\t\t\" device name: %s,\"\n@@ -391,7 +393,9 @@ cperf_throughput_test_runner(void *test_ctx)\n \tctx->decomp_gbps = rte_get_tsc_hz() / ctx->decomp_tsc_byte * 8 /\n \t\t\t1000000000;\n \n-\tif (rte_atomic16_test_and_set(&display_once)) {\n+\texp = 0;\n+\tif (__atomic_compare_exchange_n(&display_once, &exp, 1, 0,\n+\t\t\t__ATOMIC_RELAXED, __ATOMIC_RELAXED)) {\n \t\tprintf(\"\\n%12s%6s%12s%17s%15s%16s\\n\",\n \t\t\t\"lcore id\", \"Level\", \"Comp size\", \"Comp ratio [%]\",\n \t\t\t\"Comp [Gbps]\", \"Decomp [Gbps]\");\ndiff --git a/app/test-compress-perf/comp_perf_test_verify.c b/app/test-compress-perf/comp_perf_test_verify.c\nindex 5e13257b79..f6e21368e8 100644\n--- a/app/test-compress-perf/comp_perf_test_verify.c\n+++ b/app/test-compress-perf/comp_perf_test_verify.c\n@@ -388,7 +388,7 @@ cperf_verify_test_runner(void *test_ctx)\n \tstruct cperf_verify_ctx *ctx = test_ctx;\n \tstruct comp_test_data *test_data = ctx->options;\n \tint ret = EXIT_SUCCESS;\n-\tstatic rte_atomic16_t display_once = RTE_ATOMIC16_INIT(0);\n+\tstatic uint16_t display_once;\n \tuint32_t lcore = rte_lcore_id();\n \n \tctx->mem.lcore_id = lcore;\n@@ -427,8 +427,10 @@ cperf_verify_test_runner(void *test_ctx)\n \tctx->ratio = (double) ctx->comp_data_sz /\n \t\t\ttest_data->input_data_sz * 100;\n \n+\tuint16_t exp = 0;\n \tif (!ctx->silent) {\n-\t\tif (rte_atomic16_test_and_set(&display_once)) {\n+\t\tif (__atomic_compare_exchange_n(&display_once, &exp, 1, 0,\n+\t\t\t\t__ATOMIC_RELAXED, __ATOMIC_RELAXED)) {\n \t\t\tprintf(\"%12s%6s%12s%17s\\n\",\n \t\t\t \"lcore id\", \"Level\", \"Comp size\", \"Comp ratio [%]\");\n \t\t}\n", "prefixes": [ "v3", "09/12" ] }{ "id": 104446, "url": "