Patch Detail
get:
Show a patch.
patch:
Update a patch.
put:
Update a patch.
GET /api/patches/125343/?format=api
http://patches.dpdk.org/api/patches/125343/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/patch/1679338836-21321-14-git-send-email-roretzla@linux.microsoft.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": "<1679338836-21321-14-git-send-email-roretzla@linux.microsoft.com>", "list_archive_url": "https://inbox.dpdk.org/dev/1679338836-21321-14-git-send-email-roretzla@linux.microsoft.com", "date": "2023-03-20T19:00:33", "name": "[v3,13/16] eal: use previous value atomic fetch operations", "commit_ref": null, "pull_url": null, "state": "accepted", "archived": true, "hash": "25249b47f1ff1b0d03dd37b54641683907def117", "submitter": { "id": 2077, "url": "http://patches.dpdk.org/api/people/2077/?format=api", "name": "Tyler Retzlaff", "email": "roretzla@linux.microsoft.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/1679338836-21321-14-git-send-email-roretzla@linux.microsoft.com/mbox/", "series": [ { "id": 27471, "url": "http://patches.dpdk.org/api/series/27471/?format=api", "web_url": "http://patches.dpdk.org/project/dpdk/list/?series=27471", "date": "2023-03-20T19:00:21", "name": "replace __atomic operations returning new value", "version": 3, "mbox": "http://patches.dpdk.org/series/27471/mbox/" } ], "comments": "http://patches.dpdk.org/api/patches/125343/comments/", "check": "success", "checks": "http://patches.dpdk.org/api/patches/125343/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 B5EDD427E5;\n\tMon, 20 Mar 2023 20:02:32 +0100 (CET)", "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 77B0642D4F;\n\tMon, 20 Mar 2023 20:01:22 +0100 (CET)", "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 84C204282D\n for <dev@dpdk.org>; Mon, 20 Mar 2023 20:01:03 +0100 (CET)", "by linux.microsoft.com (Postfix, from userid 1086)\n id 6B81520FB424; Mon, 20 Mar 2023 12:01:02 -0700 (PDT)" ], "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 6B81520FB424", "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1679338862;\n bh=HrucMDVryp7Qcr9Q25BIN6le8KqS4zPyFfv+t38BGe8=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=MMV8QWYareM9tNu2ww4r2axTFuldwBmYXW+ILIomEuLl7TpstUtp8SFS4tCSYzezj\n dEh3Nj5FTOSdtEsjFJ0B4cPCljKhtxBi0Prugo59IjWBnizti3NJnffdehVa3mR5d+\n zgC2LXCG5kiy6Ebi8dBi1AYTc8O9SLJeRMLbpYmc=", "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>", "To": "dev@dpdk.org", "Cc": "Honnappa.Nagarahalli@arm.com, Ruifeng.Wang@arm.com, thomas@monjalon.net,\n pbhagavatula@marvell.com, ndabilpuram@marvell.com,\n Tyler Retzlaff <roretzla@linux.microsoft.com>", "Subject": "[PATCH v3 13/16] eal: use previous value atomic fetch operations", "Date": "Mon, 20 Mar 2023 12:00:33 -0700", "Message-Id": "<1679338836-21321-14-git-send-email-roretzla@linux.microsoft.com>", "X-Mailer": "git-send-email 1.8.3.1", "In-Reply-To": "<1679338836-21321-1-git-send-email-roretzla@linux.microsoft.com>", "References": "<1678486530-20688-1-git-send-email-roretzla@linux.microsoft.com>\n <1679338836-21321-1-git-send-email-roretzla@linux.microsoft.com>", "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": "Use __atomic_fetch_{add,and,or,sub,xor} instead of\n__atomic_{add,and,or,sub,xor}_fetch adding the necessary code to\nallow consumption of the resulting value.\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\nReviewed-by: Ruifeng Wang <ruifeng.wang@arm.com>\n---\n lib/eal/include/generic/rte_rwlock.h | 8 ++++----\n lib/eal/ppc/include/rte_atomic.h | 16 ++++++++--------\n 2 files changed, 12 insertions(+), 12 deletions(-)", "diff": "diff --git a/lib/eal/include/generic/rte_rwlock.h b/lib/eal/include/generic/rte_rwlock.h\nindex d45c22c..71e2d8d 100644\n--- a/lib/eal/include/generic/rte_rwlock.h\n+++ b/lib/eal/include/generic/rte_rwlock.h\n@@ -97,8 +97,8 @@\n \t\t\trte_pause();\n \n \t\t/* Try to get read lock */\n-\t\tx = __atomic_add_fetch(&rwl->cnt, RTE_RWLOCK_READ,\n-\t\t\t\t __ATOMIC_ACQUIRE);\n+\t\tx = __atomic_fetch_add(&rwl->cnt, RTE_RWLOCK_READ,\n+\t\t\t\t __ATOMIC_ACQUIRE) + RTE_RWLOCK_READ;\n \n \t\t/* If no writer, then acquire was successful */\n \t\tif (likely(!(x & RTE_RWLOCK_MASK)))\n@@ -134,8 +134,8 @@\n \t\treturn -EBUSY;\n \n \t/* Try to get read lock */\n-\tx = __atomic_add_fetch(&rwl->cnt, RTE_RWLOCK_READ,\n-\t\t\t __ATOMIC_ACQUIRE);\n+\tx = __atomic_fetch_add(&rwl->cnt, RTE_RWLOCK_READ,\n+\t\t\t __ATOMIC_ACQUIRE) + RTE_RWLOCK_READ;\n \n \t/* Back out if writer raced in */\n \tif (unlikely(x & RTE_RWLOCK_MASK)) {\ndiff --git a/lib/eal/ppc/include/rte_atomic.h b/lib/eal/ppc/include/rte_atomic.h\nindex 663b4d3..ffabd98 100644\n--- a/lib/eal/ppc/include/rte_atomic.h\n+++ b/lib/eal/ppc/include/rte_atomic.h\n@@ -71,12 +71,12 @@ static inline int rte_atomic16_test_and_set(rte_atomic16_t *v)\n \n static inline int rte_atomic16_inc_and_test(rte_atomic16_t *v)\n {\n-\treturn __atomic_add_fetch(&v->cnt, 1, __ATOMIC_ACQUIRE) == 0;\n+\treturn __atomic_fetch_add(&v->cnt, 1, __ATOMIC_ACQUIRE) + 1 == 0;\n }\n \n static inline int rte_atomic16_dec_and_test(rte_atomic16_t *v)\n {\n-\treturn __atomic_sub_fetch(&v->cnt, 1, __ATOMIC_ACQUIRE) == 0;\n+\treturn __atomic_fetch_sub(&v->cnt, 1, __ATOMIC_ACQUIRE) - 1 == 0;\n }\n \n static inline uint16_t\n@@ -113,12 +113,12 @@ static inline int rte_atomic32_test_and_set(rte_atomic32_t *v)\n \n static inline int rte_atomic32_inc_and_test(rte_atomic32_t *v)\n {\n-\treturn __atomic_add_fetch(&v->cnt, 1, __ATOMIC_ACQUIRE) == 0;\n+\treturn __atomic_fetch_add(&v->cnt, 1, __ATOMIC_ACQUIRE) + 1 == 0;\n }\n \n static inline int rte_atomic32_dec_and_test(rte_atomic32_t *v)\n {\n-\treturn __atomic_sub_fetch(&v->cnt, 1, __ATOMIC_ACQUIRE) == 0;\n+\treturn __atomic_fetch_sub(&v->cnt, 1, __ATOMIC_ACQUIRE) - 1 == 0;\n }\n \n static inline uint32_t\n@@ -181,23 +181,23 @@ static inline int rte_atomic32_dec_and_test(rte_atomic32_t *v)\n static inline int64_t\n rte_atomic64_add_return(rte_atomic64_t *v, int64_t inc)\n {\n-\treturn __atomic_add_fetch(&v->cnt, inc, __ATOMIC_ACQUIRE);\n+\treturn __atomic_fetch_add(&v->cnt, inc, __ATOMIC_ACQUIRE) + inc;\n }\n \n static inline int64_t\n rte_atomic64_sub_return(rte_atomic64_t *v, int64_t dec)\n {\n-\treturn __atomic_sub_fetch(&v->cnt, dec, __ATOMIC_ACQUIRE);\n+\treturn __atomic_fetch_sub(&v->cnt, dec, __ATOMIC_ACQUIRE) - dec;\n }\n \n static inline int rte_atomic64_inc_and_test(rte_atomic64_t *v)\n {\n-\treturn __atomic_add_fetch(&v->cnt, 1, __ATOMIC_ACQUIRE) == 0;\n+\treturn __atomic_fetch_add(&v->cnt, 1, __ATOMIC_ACQUIRE) + 1 == 0;\n }\n \n static inline int rte_atomic64_dec_and_test(rte_atomic64_t *v)\n {\n-\treturn __atomic_sub_fetch(&v->cnt, 1, __ATOMIC_ACQUIRE) == 0;\n+\treturn __atomic_fetch_sub(&v->cnt, 1, __ATOMIC_ACQUIRE) - 1 == 0;\n }\n \n static inline int rte_atomic64_test_and_set(rte_atomic64_t *v)\n", "prefixes": [ "v3", "13/16" ] }{ "id": 125343, "url": "