Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/97197/?format=api
https://patches.dpdk.org/api/patches/97197/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/patch/20210823054952.15001-3-joyce.kong@arm.com/", "project": { "id": 1, "url": "https://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": "<20210823054952.15001-3-joyce.kong@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210823054952.15001-3-joyce.kong@arm.com", "date": "2021-08-23T05:49:46", "name": "[v2,2/8] examples/multi_process: use compiler atomics for sync", "commit_ref": null, "pull_url": null, "state": "superseded", "archived": true, "hash": "6aa3172f4cbb236878a826d5aec470ad4a61bb47", "submitter": { "id": 970, "url": "https://patches.dpdk.org/api/people/970/?format=api", "name": "Joyce Kong", "email": "joyce.kong@arm.com" }, "delegate": { "id": 1, "url": "https://patches.dpdk.org/api/users/1/?format=api", "username": "tmonjalo", "first_name": "Thomas", "last_name": "Monjalon", "email": "thomas@monjalon.net" }, "mbox": "https://patches.dpdk.org/project/dpdk/patch/20210823054952.15001-3-joyce.kong@arm.com/mbox/", "series": [ { "id": 18395, "url": "https://patches.dpdk.org/api/series/18395/?format=api", "web_url": "https://patches.dpdk.org/project/dpdk/list/?series=18395", "date": "2021-08-23T05:49:44", "name": "use compiler atomic builtins for examples", "version": 2, "mbox": "https://patches.dpdk.org/series/18395/mbox/" } ], "comments": "https://patches.dpdk.org/api/patches/97197/comments/", "check": "warning", "checks": "https://patches.dpdk.org/api/patches/97197/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 F18B7A0C56;\n\tMon, 23 Aug 2021 07:50:28 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id D5D9C41148;\n\tMon, 23 Aug 2021 07:50:21 +0200 (CEST)", "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id 8632741140\n for <dev@dpdk.org>; Mon, 23 Aug 2021 07:50:20 +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 F21741FB;\n Sun, 22 Aug 2021 22:50:19 -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 9EF533F5A1;\n Sun, 22 Aug 2021 22:50:17 -0700 (PDT)" ], "From": "Joyce Kong <joyce.kong@arm.com>", "To": "Anatoly Burakov <anatoly.burakov@intel.com>", "Cc": "dev@dpdk.org, thomas@monjalon.net, david.marchand@redhat.com,\n honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com, nd@arm.com", "Date": "Mon, 23 Aug 2021 00:49:46 -0500", "Message-Id": "<20210823054952.15001-3-joyce.kong@arm.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20210823054952.15001-1-joyce.kong@arm.com>", "References": "<20210823054952.15001-1-joyce.kong@arm.com>", "Subject": "[dpdk-dev] [PATCH v2 2/8] examples/multi_process: use compiler\n atomics for 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_atomic32_test_and_set usage to compiler atomic\nCAS operation for display_stats sync.\n\nSigned-off-by: Joyce Kong <joyce.kong@arm.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\n---\n examples/multi_process/client_server_mp/mp_server/main.c | 7 ++++---\n 1 file changed, 4 insertions(+), 3 deletions(-)", "diff": "diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c\nindex 9bcee460fd..b4761ebc7b 100644\n--- a/examples/multi_process/client_server_mp/mp_server/main.c\n+++ b/examples/multi_process/client_server_mp/mp_server/main.c\n@@ -20,7 +20,6 @@\n #include <rte_per_lcore.h>\n #include <rte_lcore.h>\n #include <rte_branch_prediction.h>\n-#include <rte_atomic.h>\n #include <rte_ring.h>\n #include <rte_log.h>\n #include <rte_debug.h>\n@@ -158,10 +157,12 @@ static int\n sleep_lcore(__rte_unused void *dummy)\n {\n \t/* Used to pick a display thread - static, so zero-initialised */\n-\tstatic rte_atomic32_t display_stats;\n+\tstatic uint32_t display_stats;\n \n+\tuint32_t status = 0;\n \t/* Only one core should display stats */\n-\tif (rte_atomic32_test_and_set(&display_stats)) {\n+\tif (__atomic_compare_exchange_n(&display_stats, &status, 1, 0,\n+\t\t\t__ATOMIC_RELAXED, __ATOMIC_RELAXED)) {\n \t\tconst unsigned sleeptime = 1;\n \t\tprintf(\"Core %u displaying statistics\\n\", rte_lcore_id());\n \n", "prefixes": [ "v2", "2/8" ] }{ "id": 97197, "url": "