Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/97101/?format=api
http://patchwork.dpdk.org/api/patches/97101/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/20210819070908.25773-3-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": "<20210819070908.25773-3-joyce.kong@arm.com>", "list_archive_url": "https://inbox.dpdk.org/dev/20210819070908.25773-3-joyce.kong@arm.com", "date": "2021-08-19T07:09:02", "name": "[v1,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": "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/20210819070908.25773-3-joyce.kong@arm.com/mbox/", "series": [ { "id": 18348, "url": "http://patchwork.dpdk.org/api/series/18348/?format=api", "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=18348", "date": "2021-08-19T07:09:00", "name": "use compiler atomic builtins for examples", "version": 1, "mbox": "http://patchwork.dpdk.org/series/18348/mbox/" } ], "comments": "http://patchwork.dpdk.org/api/patches/97101/comments/", "check": "warning", "checks": "http://patchwork.dpdk.org/api/patches/97101/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 14C80A0C47;\n\tThu, 19 Aug 2021 09:09:48 +0200 (CEST)", "from [217.70.189.124] (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 57FEF41215;\n\tThu, 19 Aug 2021 09:09:33 +0200 (CEST)", "from foss.arm.com (foss.arm.com [217.140.110.172])\n by mails.dpdk.org (Postfix) with ESMTP id F0EEA41210\n for <dev@dpdk.org>; Thu, 19 Aug 2021 09:09:31 +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 7A2991063;\n Thu, 19 Aug 2021 00:09:31 -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 233293F40C;\n Thu, 19 Aug 2021 00:09:28 -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": "Thu, 19 Aug 2021 02:09:02 -0500", "Message-Id": "<20210819070908.25773-3-joyce.kong@arm.com>", "X-Mailer": "git-send-email 2.17.1", "In-Reply-To": "<20210819070908.25773-1-joyce.kong@arm.com>", "References": "<20210819070908.25773-1-joyce.kong@arm.com>", "Subject": "[dpdk-dev] [PATCH v1 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": [ "v1", "2/8" ] }{ "id": 97101, "url": "