get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 96525,
    "url": "http://patchwork.dpdk.org/api/patches/96525/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210802101847.3462-10-joyce.kong@arm.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": "<20210802101847.3462-10-joyce.kong@arm.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/20210802101847.3462-10-joyce.kong@arm.com",
    "date": "2021-08-02T10:18:44",
    "name": "[v1,09/12] app/compress: use compiler atomic builtins for display sync",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "eca824a312b217d75a1f26b235d4a908f953bc30",
    "submitter": {
        "id": 970,
        "url": "http://patchwork.dpdk.org/api/people/970/?format=api",
        "name": "Joyce Kong",
        "email": "joyce.kong@arm.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/20210802101847.3462-10-joyce.kong@arm.com/mbox/",
    "series": [
        {
            "id": 18128,
            "url": "http://patchwork.dpdk.org/api/series/18128/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=18128",
            "date": "2021-08-02T10:18:35",
            "name": "use compiler atomic builtins for app",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/18128/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/96525/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/96525/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 7A08FA0C41;\n\tMon,  2 Aug 2021 12:21:00 +0200 (CEST)",
            "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 65FD441137;\n\tMon,  2 Aug 2021 12:21:00 +0200 (CEST)",
            "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id 297BB40140\n for <dev@dpdk.org>; Mon,  2 Aug 2021 12:20:59 +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 98C21D6E;\n Mon,  2 Aug 2021 03:20:58 -0700 (PDT)",
            "from net-arm-n1sdp.shanghai.arm.com (net-arm-n1sdp.shanghai.arm.com\n [10.169.208.222])\n by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id DFFBB3F70D;\n Mon,  2 Aug 2021 03:20:51 -0700 (PDT)"
        ],
        "From": "Joyce Kong <joyce.kong@arm.com>",
        "To": "thomas@monjalon.net, david.marchand@redhat.com,\n honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com,\n konstantin.ananyev@intel.com, rsanford@akamai.com,\n erik.g.carrillo@intel.com, olivier.matz@6wind.com, yipeng1.wang@intel.com,\n sameh.gobriel@intel.com, bruce.richardson@intel.com,\n vladimir.medvedkin@intel.com, anatoly.burakov@intel.com,\n andrew.rybchenko@oktetlabs.ru, jerinj@marvell.com,\n declan.doherty@intel.com, ciara.power@intel.com, xiaoyun.li@intel.com,\n nicolas.chautru@intel.com, maryam.tahhan@intel.com,\n reshma.pattan@intel.com, cristian.dumitrescu@intel.com",
        "Cc": "dev@dpdk.org,\n\tnd@arm.com",
        "Date": "Mon,  2 Aug 2021 05:18:44 -0500",
        "Message-Id": "<20210802101847.3462-10-joyce.kong@arm.com>",
        "X-Mailer": "git-send-email 2.17.1",
        "In-Reply-To": "<20210802101847.3462-1-joyce.kong@arm.com>",
        "References": "<20210802101847.3462-1-joyce.kong@arm.com>",
        "Subject": "[dpdk-dev] [PATCH v1 09/12] app/compress: use compiler atomic\n builtins for display sync",
        "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": "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>\n---\n app/test-compress-perf/comp_perf_test_common.h     |  2 +-\n app/test-compress-perf/comp_perf_test_cyclecount.c | 10 +++++++---\n app/test-compress-perf/comp_perf_test_throughput.c | 11 ++++++++---\n app/test-compress-perf/comp_perf_test_verify.c     |  6 ++++--\n 4 files changed, 20 insertions(+), 9 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 55559a7d5a..e002e53bdf 100644\n--- a/app/test-compress-perf/comp_perf_test_cyclecount.c\n+++ b/app/test-compress-perf/comp_perf_test_cyclecount.c\n@@ -468,7 +468,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@@ -488,10 +488,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@@ -547,8 +549,10 @@ cperf_cyclecount_test_runner(void *test_ctx)\n \tduration_setup_per_op = ctx->duration_op /\n \t\t\t(ctx->ver.mem.total_bufs * test_data->num_iter);\n \n+\texp = 0;\n \t/* R E P O R T processing */\n-\tif (rte_atomic16_test_and_set(&display_once)) {\n+\tif (__atomic_compare_exchange_n(&display_once, &exp, 1, 0,\n+\t\t\t__ATOMIC_RELAXED, __ATOMIC_RELAXED)) {\n \n \t\trte_spinlock_lock(&print_spinlock);\n \ndiff --git a/app/test-compress-perf/comp_perf_test_throughput.c b/app/test-compress-perf/comp_perf_test_throughput.c\nindex 13922b658c..f587ad2ec3 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,18 @@ 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+\n \t\tprintf(\"    lcore: %u,\"\n \t\t\t\t\" driver name: %s,\"\n \t\t\t\t\" device name: %s,\"\n@@ -391,7 +394,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\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..6a2497985b 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@@ -428,7 +428,9 @@ cperf_verify_test_runner(void *test_ctx)\n \t\t\ttest_data->input_data_sz * 100;\n \n \tif (!ctx->silent) {\n-\t\tif (rte_atomic16_test_and_set(&display_once)) {\n+\t\tuint16_t exp = 0;\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": [
        "v1",
        "09/12"
    ]
}