From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mails.dpdk.org (mails.dpdk.org [217.70.189.124]) by inbox.dpdk.org (Postfix) with ESMTP id A4DB143190; Tue, 17 Oct 2023 22:31:58 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 2EF2A42E1A; Tue, 17 Oct 2023 22:31:31 +0200 (CEST) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 01053402DE for ; Tue, 17 Oct 2023 22:31:20 +0200 (CEST) Received: by linux.microsoft.com (Postfix, from userid 1086) id BEDC520B74C6; Tue, 17 Oct 2023 13:31:18 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com BEDC520B74C6 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1697574678; bh=ro+lNpCQassdwmiC0qK1AzvRSrCagQ5xsS6DzxNAgvE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=iugMDqrkXv6hoQzxgSljXDHOxAnWJGIvdgQ2sGJS4sgdLjm7OMtXJ3uBcvHWvyfTC VF9TzqEVQ7VCw+ComDzOTYmcbI9KYSMGbVTtX3FAtnTOK0y9o7O7gJO05ZDuf7FPOk IAdmW9LTigxtDuOkSrY4gxyVa1I7CL6S7pIqXzpA= From: Tyler Retzlaff To: dev@dpdk.org Cc: Akhil Goyal , Anatoly Burakov , Andrew Rybchenko , Bruce Richardson , Chenbo Xia , Ciara Power , David Christensen , David Hunt , Dmitry Kozlyuk , Dmitry Malloy , Elena Agostini , Erik Gabriel Carrillo , Fan Zhang , Ferruh Yigit , Harman Kalra , Harry van Haaren , Honnappa Nagarahalli , Jerin Jacob , Konstantin Ananyev , Matan Azrad , Maxime Coquelin , Narcisa Ana Maria Vasile , Nicolas Chautru , Olivier Matz , Ori Kam , Pallavi Kadam , Pavan Nikhilesh , Reshma Pattan , Sameh Gobriel , Shijith Thotton , Sivaprasad Tummala , Stephen Hemminger , Suanming Mou , Sunil Kumar Kori , Thomas Monjalon , Viacheslav Ovsiienko , Vladimir Medvedkin , Yipeng Wang , Tyler Retzlaff Subject: [PATCH v2 06/19] ipsec: use rte optional stdatomic API Date: Tue, 17 Oct 2023 13:31:04 -0700 Message-Id: <1697574677-16578-7-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1697574677-16578-1-git-send-email-roretzla@linux.microsoft.com> References: <1697497745-20664-1-git-send-email-roretzla@linux.microsoft.com> <1697574677-16578-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 List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Replace the use of gcc builtin __atomic_xxx intrinsics with corresponding rte_atomic_xxx optional stdatomic API Signed-off-by: Tyler Retzlaff --- lib/ipsec/ipsec_sqn.h | 2 +- lib/ipsec/sa.h | 2 +- 2 files changed, 2 insertions(+), 2 deletions(-) diff --git a/lib/ipsec/ipsec_sqn.h b/lib/ipsec/ipsec_sqn.h index 505950e..984a9dd 100644 --- a/lib/ipsec/ipsec_sqn.h +++ b/lib/ipsec/ipsec_sqn.h @@ -128,7 +128,7 @@ n = *num; if (SQN_ATOMIC(sa)) - sqn = __atomic_fetch_add(&sa->sqn.outb, n, __ATOMIC_RELAXED) + n; + sqn = rte_atomic_fetch_add_explicit(&sa->sqn.outb, n, rte_memory_order_relaxed) + n; else { sqn = sa->sqn.outb + n; sa->sqn.outb = sqn; diff --git a/lib/ipsec/sa.h b/lib/ipsec/sa.h index ce4af8c..4b30bea 100644 --- a/lib/ipsec/sa.h +++ b/lib/ipsec/sa.h @@ -124,7 +124,7 @@ struct rte_ipsec_sa { * place from other frequently accessed data. */ union { - uint64_t outb; + RTE_ATOMIC(uint64_t) outb; struct { uint32_t rdidx; /* read index */ uint32_t wridx; /* write index */ -- 1.8.3.1