get:
Show a patch.

patch:
Update a patch.

put:
Update a patch.

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

{
    "id": 132681,
    "url": "http://patchwork.dpdk.org/api/patches/132681/?format=api",
    "web_url": "http://patchwork.dpdk.org/project/dpdk/patch/1697497745-20664-21-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-21-git-send-email-roretzla@linux.microsoft.com>",
    "list_archive_url": "https://inbox.dpdk.org/dev/1697497745-20664-21-git-send-email-roretzla@linux.microsoft.com",
    "date": "2023-10-16T23:09:04",
    "name": "[20/21] timer: use rte optional stdatomic API",
    "commit_ref": null,
    "pull_url": null,
    "state": "superseded",
    "archived": true,
    "hash": "0ab470157b6fcf1f4a4b3f38e7c7cde87616ca36",
    "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-21-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/132681/comments/",
    "check": "warning",
    "checks": "http://patchwork.dpdk.org/api/patches/132681/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 F263343183;\n\tTue, 17 Oct 2023 01:11:22 +0200 (CEST)",
            "from mails.dpdk.org (localhost [127.0.0.1])\n\tby mails.dpdk.org (Postfix) with ESMTP id E655D42D0B;\n\tTue, 17 Oct 2023 01:09:32 +0200 (CEST)",
            "from linux.microsoft.com (linux.microsoft.com [13.77.154.182])\n by mails.dpdk.org (Postfix) with ESMTP id 60B5E40A7F\n for <dev@dpdk.org>; Tue, 17 Oct 2023 01:09:09 +0200 (CEST)",
            "by linux.microsoft.com (Postfix, from userid 1086)\n id 0703420B74D4; Mon, 16 Oct 2023 16:09:07 -0700 (PDT)"
        ],
        "DKIM-Filter": "OpenDKIM Filter v2.11.0 linux.microsoft.com 0703420B74D4",
        "DKIM-Signature": "v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com;\n s=default; t=1697497748;\n bh=ksPBnGZVkQjfGW3tponcU3SwQmffIB+F16y056Piuzs=;\n h=From:To:Cc:Subject:Date:In-Reply-To:References:From;\n b=XTFWlZzHoijNGMF1lXTzahaCsVRstU4subYWDeO80X/dOiB3/yYTlkBb7nq+kt7wb\n bzYMdEYa5w/eT5df8AE1cHRhmxkh9wxeqWa2xTn042lqAshPm8O0rN0ef+KMF4MbCE\n Fl7ehER5gvExoCFDkI7uOi4pfxfoVCR/axdFlC7U=",
        "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 20/21] timer: use rte optional stdatomic API",
        "Date": "Mon, 16 Oct 2023 16:09:04 -0700",
        "Message-Id": "<1697497745-20664-21-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/timer/rte_timer.c | 50 +++++++++++++++++++++++++-------------------------\n lib/timer/rte_timer.h |  6 +++---\n 2 files changed, 28 insertions(+), 28 deletions(-)",
    "diff": "diff --git a/lib/timer/rte_timer.c b/lib/timer/rte_timer.c\nindex 85d6757..53ed221 100644\n--- a/lib/timer/rte_timer.c\n+++ b/lib/timer/rte_timer.c\n@@ -210,7 +210,7 @@ struct rte_timer_data {\n \n \tstatus.state = RTE_TIMER_STOP;\n \tstatus.owner = RTE_TIMER_NO_OWNER;\n-\t__atomic_store_n(&tim->status.u32, status.u32, __ATOMIC_RELAXED);\n+\trte_atomic_store_explicit(&tim->status.u32, status.u32, rte_memory_order_relaxed);\n }\n \n /*\n@@ -231,7 +231,7 @@ struct rte_timer_data {\n \n \t/* wait that the timer is in correct status before update,\n \t * and mark it as being configured */\n-\tprev_status.u32 = __atomic_load_n(&tim->status.u32, __ATOMIC_RELAXED);\n+\tprev_status.u32 = rte_atomic_load_explicit(&tim->status.u32, rte_memory_order_relaxed);\n \n \twhile (success == 0) {\n \t\t/* timer is running on another core\n@@ -254,11 +254,11 @@ struct rte_timer_data {\n \t\t * timer is in CONFIG state, the state cannot be changed\n \t\t * by other threads. So, we should use ACQUIRE here.\n \t\t */\n-\t\tsuccess = __atomic_compare_exchange_n(&tim->status.u32,\n-\t\t\t\t\t      &prev_status.u32,\n-\t\t\t\t\t      status.u32, 0,\n-\t\t\t\t\t      __ATOMIC_ACQUIRE,\n-\t\t\t\t\t      __ATOMIC_RELAXED);\n+\t\tsuccess = rte_atomic_compare_exchange_strong_explicit(&tim->status.u32,\n+\t\t\t\t\t      (uint32_t *)(uintptr_t)&prev_status.u32,\n+\t\t\t\t\t      status.u32,\n+\t\t\t\t\t      rte_memory_order_acquire,\n+\t\t\t\t\t      rte_memory_order_relaxed);\n \t}\n \n \tret_prev_status->u32 = prev_status.u32;\n@@ -277,7 +277,7 @@ struct rte_timer_data {\n \n \t/* wait that the timer is in correct status before update,\n \t * and mark it as running */\n-\tprev_status.u32 = __atomic_load_n(&tim->status.u32, __ATOMIC_RELAXED);\n+\tprev_status.u32 = rte_atomic_load_explicit(&tim->status.u32, rte_memory_order_relaxed);\n \n \twhile (success == 0) {\n \t\t/* timer is not pending anymore */\n@@ -293,11 +293,11 @@ struct rte_timer_data {\n \t\t * timer is in RUNNING state, the state cannot be changed\n \t\t * by other threads. So, we should use ACQUIRE here.\n \t\t */\n-\t\tsuccess = __atomic_compare_exchange_n(&tim->status.u32,\n-\t\t\t\t\t      &prev_status.u32,\n-\t\t\t\t\t      status.u32, 0,\n-\t\t\t\t\t      __ATOMIC_ACQUIRE,\n-\t\t\t\t\t      __ATOMIC_RELAXED);\n+\t\tsuccess = rte_atomic_compare_exchange_strong_explicit(&tim->status.u32,\n+\t\t\t\t\t      (uint32_t *)(uintptr_t)&prev_status.u32,\n+\t\t\t\t\t      status.u32,\n+\t\t\t\t\t      rte_memory_order_acquire,\n+\t\t\t\t\t      rte_memory_order_relaxed);\n \t}\n \n \treturn 0;\n@@ -530,7 +530,7 @@ struct rte_timer_data {\n \t/* The \"RELEASE\" ordering guarantees the memory operations above\n \t * the status update are observed before the update by all threads\n \t */\n-\t__atomic_store_n(&tim->status.u32, status.u32, __ATOMIC_RELEASE);\n+\trte_atomic_store_explicit(&tim->status.u32, status.u32, rte_memory_order_release);\n \n \tif (tim_lcore != lcore_id || !local_is_locked)\n \t\trte_spinlock_unlock(&priv_timer[tim_lcore].list_lock);\n@@ -612,7 +612,7 @@ struct rte_timer_data {\n \t/* The \"RELEASE\" ordering guarantees the memory operations above\n \t * the status update are observed before the update by all threads\n \t */\n-\t__atomic_store_n(&tim->status.u32, status.u32, __ATOMIC_RELEASE);\n+\trte_atomic_store_explicit(&tim->status.u32, status.u32, rte_memory_order_release);\n \n \treturn 0;\n }\n@@ -646,8 +646,8 @@ struct rte_timer_data {\n int\n rte_timer_pending(struct rte_timer *tim)\n {\n-\treturn __atomic_load_n(&tim->status.state,\n-\t\t\t\t__ATOMIC_RELAXED) == RTE_TIMER_PENDING;\n+\treturn rte_atomic_load_explicit(&tim->status.state,\n+\t\t\t\trte_memory_order_relaxed) == RTE_TIMER_PENDING;\n }\n \n /* must be called periodically, run all timer that expired */\n@@ -753,8 +753,8 @@ struct rte_timer_data {\n \t\t\t * operations above the status update are observed\n \t\t\t * before the update by all threads\n \t\t\t */\n-\t\t\t__atomic_store_n(&tim->status.u32, status.u32,\n-\t\t\t\t__ATOMIC_RELEASE);\n+\t\t\trte_atomic_store_explicit(&tim->status.u32, status.u32,\n+\t\t\t\trte_memory_order_release);\n \t\t}\n \t\telse {\n \t\t\t/* keep it in list and mark timer as pending */\n@@ -766,8 +766,8 @@ struct rte_timer_data {\n \t\t\t * operations above the status update are observed\n \t\t\t * before the update by all threads\n \t\t\t */\n-\t\t\t__atomic_store_n(&tim->status.u32, status.u32,\n-\t\t\t\t__ATOMIC_RELEASE);\n+\t\t\trte_atomic_store_explicit(&tim->status.u32, status.u32,\n+\t\t\t\trte_memory_order_release);\n \t\t\t__rte_timer_reset(tim, tim->expire + tim->period,\n \t\t\t\ttim->period, lcore_id, tim->f, tim->arg, 1,\n \t\t\t\ttimer_data);\n@@ -941,8 +941,8 @@ struct rte_timer_data {\n \t\t\t * operations above the status update are observed\n \t\t\t * before the update by all threads\n \t\t\t */\n-\t\t\t__atomic_store_n(&tim->status.u32, status.u32,\n-\t\t\t\t__ATOMIC_RELEASE);\n+\t\t\trte_atomic_store_explicit(&tim->status.u32, status.u32,\n+\t\t\t\trte_memory_order_release);\n \t\t} else {\n \t\t\t/* keep it in list and mark timer as pending */\n \t\t\trte_spinlock_lock(\n@@ -954,8 +954,8 @@ struct rte_timer_data {\n \t\t\t * operations above the status update are observed\n \t\t\t * before the update by all threads\n \t\t\t */\n-\t\t\t__atomic_store_n(&tim->status.u32, status.u32,\n-\t\t\t\t__ATOMIC_RELEASE);\n+\t\t\trte_atomic_store_explicit(&tim->status.u32, status.u32,\n+\t\t\t\trte_memory_order_release);\n \t\t\t__rte_timer_reset(tim, tim->expire + tim->period,\n \t\t\t\ttim->period, this_lcore, tim->f, tim->arg, 1,\n \t\t\t\tdata);\ndiff --git a/lib/timer/rte_timer.h b/lib/timer/rte_timer.h\nindex d3927d5..a35bc08 100644\n--- a/lib/timer/rte_timer.h\n+++ b/lib/timer/rte_timer.h\n@@ -65,10 +65,10 @@ enum rte_timer_type {\n  */\n union rte_timer_status {\n \tstruct {\n-\t\tuint16_t state;  /**< Stop, pending, running, config. */\n-\t\tint16_t owner;   /**< The lcore that owns the timer. */\n+\t\tRTE_ATOMIC(uint16_t) state;  /**< Stop, pending, running, config. */\n+\t\tRTE_ATOMIC(int16_t) owner;   /**< The lcore that owns the timer. */\n \t};\n-\tuint32_t u32;            /**< To atomic-set status + owner. */\n+\tRTE_ATOMIC(uint32_t) u32;            /**< To atomic-set status + owner. */\n };\n \n #ifdef RTE_LIBRTE_TIMER_DEBUG\n",
    "prefixes": [
        "20/21"
    ]
}