get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 132678,
    "url": "http://patchwork.dpdk.org/api/patches/132678/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1697497745-20664-14-git-send-email-roretzla@linux.microsoft.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": "<1697497745-20664-14-git-send-email-roretzla@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1697497745-20664-14-git-send-email-roretzla@linux.microsoft.com",
    "date": "2023-10-16T23:08:57",
    "name": "[13/21] stack: use rte optional stdatomic API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "c951f4de6ad48f83f3e5a328961ff76a4b094790",
    "submitter": {
        "id": 2077,
        "url": "http://patchwork.dpdk.org/api/people/2077/?format=api",
        "name": "Tyler Retzlaff",
        "email": "roretzla@linux.microsoft.com"
    },
    "delegate": {
        "id": 24651,
        "url": "http://patchwork.dpdk.org/api/users/24651/?format=api",
        "username": "dmarchand",
        "first_name": "David",
        "last_name": "Marchand",
        "email": "david.marchand@redhat.com"
    },
    "mbox": "http://patchwork.dpdk.org/project/dpdk/patch/1697497745-20664-14-git-send-email-roretzla@linux.microsoft.com/mbox/",
    "series": [
        {
            "id": 29858,
            "url": "http://patchwork.dpdk.org/api/series/29858/?format=api",
            "web_url": "http://patchwork.dpdk.org/project/dpdk/list/?series=29858",
            "date": "2023-10-16T23:08:44",
            "name": "use rte optional stdatomic API",
            "version": 1,
            "mbox": "http://patchwork.dpdk.org/series/29858/mbox/"
        }
    ],
    "comments": "http://patchwork.dpdk.org/api/patches/132678/comments/",
    "check": "success",
    "checks": "http://patchwork.dpdk.org/api/patches/132678/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 9CF5343183;\n\tTue, 17 Oct 2023 01:11:03 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id 2D05C427DF;\n\tTue, 17 Oct 2023 01:09:29 +0200 (CEST)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id D25CF40E0F\n for <dev@dpdk.org>; Tue, 17 Oct 2023 01:09:08 +0200 (CEST)",
            "by linux.microsoft.com (Postfix, from userid 1086)\n id 8928520B74CD; Mon, 16 Oct 2023 16:09:07 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 8928520B74CD",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1697497747;\n bh=pEFbJZzyaIqLKkUDwBHn2JsUK4YWeGp0ZMPJCXKNSt0=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=XXEGYwE18J37ZDlOU6g6lr3oAdetct0ca7MKvSD5TyzSXgJofhSigPAKjfV2+YvP0\n wnYejkKNdY1ihX8cICKf6wVPzC45VtwFUN3I30zTZXgVtJgpjn0XNahR99V9n2tUgE\n hS9V2KWukd7jaKStfgL102uiwBSGTk7f0Qo9tZZQ=",
        "From": "Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "To": "dev@dpdk.org",
        "Cc": "Akhil Goyal <gakhil@marvell.com>,\n Anatoly Burakov <anatoly.burakov@intel.com>,\n Andrew Rybchenko <andrew.rybchenko@oktetlabs.ru>,\n Bruce Richardson <bruce.richardson@intel.com>,\n Chenbo Xia <chenbo.xia@intel.com>, Ciara Power <ciara.power@intel.com>,\n David Christensen <drc@linux.vnet.ibm.com>,\n David Hunt <david.hunt@intel.com>,\n Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>,\n Dmitry Malloy <dmitrym@microsoft.com>,\n Elena Agostini <eagostini@nvidia.com>,\n Erik Gabriel Carrillo <erik.g.carrillo@intel.com>,\n Fan Zhang <fanzhang.oss@gmail.com>, Ferruh Yigit <ferruh.yigit@amd.com>,\n Harman Kalra <hkalra@marvell.com>,\n Harry van Haaren <harry.van.haaren@intel.com>,\n Honnappa Nagarahalli <honnappa.nagarahalli@arm.com>,\n Jerin Jacob <jerinj@marvell.com>,\n Konstantin Ananyev <konstantin.v.ananyev@yandex.ru>,\n Matan Azrad <matan@nvidia.com>,\n Maxime Coquelin <maxime.coquelin@redhat.com>,\n Narcisa Ana Maria Vasile <navasile@linux.microsoft.com>,\n Nicolas Chautru <nicolas.chautru@intel.com>,\n Olivier Matz <olivier.matz@6wind.com>, Ori Kam <orika@nvidia.com>,\n Pallavi Kadam <pallavi.kadam@intel.com>,\n Pavan Nikhilesh <pbhagavatula@marvell.com>,\n Reshma Pattan <reshma.pattan@intel.com>,\n Sameh Gobriel <sameh.gobriel@intel.com>,\n Shijith Thotton <sthotton@marvell.com>,\n Sivaprasad Tummala <sivaprasad.tummala@amd.com>,\n Stephen Hemminger <stephen@networkplumber.org>,\n Suanming Mou <suanmingm@nvidia.com>, Sunil Kumar Kori <skori@marvell.com>,\n Thomas Monjalon <thomas@monjalon.net>,\n Viacheslav Ovsiienko <viacheslavo@nvidia.com>,\n Vladimir Medvedkin <vladimir.medvedkin@intel.com>,\n Yipeng Wang <yipeng1.wang@intel.com>,\n Tyler Retzlaff <roretzla@linux.microsoft.com>",
        "Subject": "[PATCH 13/21] stack: use rte optional stdatomic API",
        "Date": "Mon, 16 Oct 2023 16:08:57 -0700",
        "Message-Id": "<1697497745-20664-14-git-send-email-roretzla@linux.microsoft.com>",
        "X-Mailer": "git-send-email 1.8.3.1",
        "In-Reply-To": "<1697497745-20664-1-git-send-email-roretzla@linux.microsoft.com>",
        "References": "<1697497745-20664-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": "Replace the use of gcc builtin __atomic_xxx intrinsics with\ncorresponding rte_atomic_xxx optional stdatomic API\n\nSigned-off-by: Tyler Retzlaff <roretzla@linux.microsoft.com>\n---\n lib/stack/rte_stack.h            |  2 +-\n lib/stack/rte_stack_lf_c11.h     | 24 ++++++++++++------------\n lib/stack/rte_stack_lf_generic.h | 18 +++++++++---------\n 3 files changed, 22 insertions(+), 22 deletions(-)",
    "diff": "diff --git a/lib/stack/rte_stack.h b/lib/stack/rte_stack.h\nindex 921d29a..a379300 100644\n--- a/lib/stack/rte_stack.h\n+++ b/lib/stack/rte_stack.h\n@@ -44,7 +44,7 @@ struct rte_stack_lf_list {\n \t/** List head */\n \tstruct rte_stack_lf_head head __rte_aligned(16);\n \t/** List len */\n-\tuint64_t len;\n+\tRTE_ATOMIC(uint64_t) len;\n };\n \n /* Structure containing two lock-free LIFO lists: the stack itself and a list\ndiff --git a/lib/stack/rte_stack_lf_c11.h b/lib/stack/rte_stack_lf_c11.h\nindex 687a6f6..9cb6998 100644\n--- a/lib/stack/rte_stack_lf_c11.h\n+++ b/lib/stack/rte_stack_lf_c11.h\n@@ -26,8 +26,8 @@\n \t * elements. If the mempool is near-empty to the point that this is a\n \t * concern, the user should consider increasing the mempool size.\n \t */\n-\treturn (unsigned int)__atomic_load_n(&s->stack_lf.used.len,\n-\t\t\t\t\t     __ATOMIC_RELAXED);\n+\treturn (unsigned int)rte_atomic_load_explicit(&s->stack_lf.used.len,\n+\t\t\t\t\t     rte_memory_order_relaxed);\n }\n \n static __rte_always_inline void\n@@ -59,14 +59,14 @@\n \t\t\t\t(rte_int128_t *)&list->head,\n \t\t\t\t(rte_int128_t *)&old_head,\n \t\t\t\t(rte_int128_t *)&new_head,\n-\t\t\t\t1, __ATOMIC_RELEASE,\n-\t\t\t\t__ATOMIC_RELAXED);\n+\t\t\t\t1, rte_memory_order_release,\n+\t\t\t\trte_memory_order_relaxed);\n \t} while (success == 0);\n \n \t/* Ensure the stack modifications are not reordered with respect\n \t * to the LIFO len update.\n \t */\n-\t__atomic_fetch_add(&list->len, num, __ATOMIC_RELEASE);\n+\trte_atomic_fetch_add_explicit(&list->len, num, rte_memory_order_release);\n }\n \n static __rte_always_inline struct rte_stack_lf_elem *\n@@ -80,7 +80,7 @@\n \tint success;\n \n \t/* Reserve num elements, if available */\n-\tlen = __atomic_load_n(&list->len, __ATOMIC_RELAXED);\n+\tlen = rte_atomic_load_explicit(&list->len, rte_memory_order_relaxed);\n \n \twhile (1) {\n \t\t/* Does the list contain enough elements? */\n@@ -88,10 +88,10 @@\n \t\t\treturn NULL;\n \n \t\t/* len is updated on failure */\n-\t\tif (__atomic_compare_exchange_n(&list->len,\n+\t\tif (rte_atomic_compare_exchange_weak_explicit(&list->len,\n \t\t\t\t\t\t&len, len - num,\n-\t\t\t\t\t\t1, __ATOMIC_ACQUIRE,\n-\t\t\t\t\t\t__ATOMIC_RELAXED))\n+\t\t\t\t\t\trte_memory_order_acquire,\n+\t\t\t\t\t\trte_memory_order_relaxed))\n \t\t\tbreak;\n \t}\n \n@@ -110,7 +110,7 @@\n \t\t * elements are properly ordered with respect to the head\n \t\t * pointer read.\n \t\t */\n-\t\t__atomic_thread_fence(__ATOMIC_ACQUIRE);\n+\t\t__atomic_thread_fence(rte_memory_order_acquire);\n \n \t\trte_prefetch0(old_head.top);\n \n@@ -159,8 +159,8 @@\n \t\t\t\t(rte_int128_t *)&list->head,\n \t\t\t\t(rte_int128_t *)&old_head,\n \t\t\t\t(rte_int128_t *)&new_head,\n-\t\t\t\t0, __ATOMIC_RELAXED,\n-\t\t\t\t__ATOMIC_RELAXED);\n+\t\t\t\t0, rte_memory_order_relaxed,\n+\t\t\t\trte_memory_order_relaxed);\n \t} while (success == 0);\n \n \treturn old_head.top;\ndiff --git a/lib/stack/rte_stack_lf_generic.h b/lib/stack/rte_stack_lf_generic.h\nindex 39f7ff3..cc69e4d 100644\n--- a/lib/stack/rte_stack_lf_generic.h\n+++ b/lib/stack/rte_stack_lf_generic.h\n@@ -27,7 +27,7 @@\n \t * concern, the user should consider increasing the mempool size.\n \t */\n \t/* NOTE: review for potential ordering optimization */\n-\treturn __atomic_load_n(&s->stack_lf.used.len, __ATOMIC_SEQ_CST);\n+\treturn rte_atomic_load_explicit(&s->stack_lf.used.len, rte_memory_order_seq_cst);\n }\n \n static __rte_always_inline void\n@@ -64,11 +64,11 @@\n \t\t\t\t(rte_int128_t *)&list->head,\n \t\t\t\t(rte_int128_t *)&old_head,\n \t\t\t\t(rte_int128_t *)&new_head,\n-\t\t\t\t1, __ATOMIC_RELEASE,\n-\t\t\t\t__ATOMIC_RELAXED);\n+\t\t\t\t1, rte_memory_order_release,\n+\t\t\t\trte_memory_order_relaxed);\n \t} while (success == 0);\n \t/* NOTE: review for potential ordering optimization */\n-\t__atomic_fetch_add(&list->len, num, __ATOMIC_SEQ_CST);\n+\trte_atomic_fetch_add_explicit(&list->len, num, rte_memory_order_seq_cst);\n }\n \n static __rte_always_inline struct rte_stack_lf_elem *\n@@ -83,15 +83,15 @@\n \t/* Reserve num elements, if available */\n \twhile (1) {\n \t\t/* NOTE: review for potential ordering optimization */\n-\t\tuint64_t len = __atomic_load_n(&list->len, __ATOMIC_SEQ_CST);\n+\t\tuint64_t len = rte_atomic_load_explicit(&list->len, rte_memory_order_seq_cst);\n \n \t\t/* Does the list contain enough elements? */\n \t\tif (unlikely(len < num))\n \t\t\treturn NULL;\n \n \t\t/* NOTE: review for potential ordering optimization */\n-\t\tif (__atomic_compare_exchange_n(&list->len, &len, len - num,\n-\t\t\t\t0, __ATOMIC_SEQ_CST, __ATOMIC_SEQ_CST))\n+\t\tif (rte_atomic_compare_exchange_strong_explicit(&list->len, &len, len - num,\n+\t\t\t\trte_memory_order_seq_cst, rte_memory_order_seq_cst))\n \t\t\tbreak;\n \t}\n \n@@ -143,8 +143,8 @@\n \t\t\t\t(rte_int128_t *)&list->head,\n \t\t\t\t(rte_int128_t *)&old_head,\n \t\t\t\t(rte_int128_t *)&new_head,\n-\t\t\t\t1, __ATOMIC_RELEASE,\n-\t\t\t\t__ATOMIC_RELAXED);\n+\t\t\t\t1, rte_memory_order_release,\n+\t\t\t\trte_memory_order_relaxed);\n \t} while (success == 0);\n \n \treturn old_head.top;\n",
    "prefixes": [
        "13/21"
    ]
}