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 A2C8E41EA5; Wed, 15 Mar 2023 22:16:59 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 7921542D42; Wed, 15 Mar 2023 22:16:01 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 75BE8427F5 for ; Wed, 15 Mar 2023 22:15:48 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 6B0F72057023; Wed, 15 Mar 2023 14:15:46 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 6B0F72057023 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1678914947; bh=KKXpezy0RTy1XbTqtcwBZBfX5NMfLLP22hCi67WeG8Y=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=Fk0LJ/tJII1rounhHW7Y5LrfSxgzN/rsHN45NUtvQUjYlAe0mjRvEl8uMRHkb56LJ fbfKhkxWuXoH9cuBo1bKwGjQUBwTEXQIvMV7mt7XQ35qOZAwWUyeeUOxcbvPL5bowe xyIW9uUL+VOi3LIoXTLzHUHz/0C2Ap1nkf2Se2CM= From: Tyler Retzlaff To: dev@dpdk.org Cc: Honnappa.Nagarahalli@arm.com, Ruifeng.Wang@arm.com, thomas@monjalon.net, Tyler Retzlaff Subject: [PATCH v2 14/16] ipsec: use previous value atomic fetch operations Date: Wed, 15 Mar 2023 14:15:43 -0700 Message-Id: <1678914945-10638-15-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1678914945-10638-1-git-send-email-roretzla@linux.microsoft.com> References: <1678486530-20688-1-git-send-email-roretzla@linux.microsoft.com> <1678914945-10638-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 Use __atomic_fetch_{add,and,or,sub,xor} instead of __atomic_{add,and,or,sub,xor}_fetch adding the necessary code to allow consumption of the resulting value. Signed-off-by: Tyler Retzlaff --- lib/ipsec/ipsec_sqn.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/ipsec/ipsec_sqn.h b/lib/ipsec/ipsec_sqn.h index 2636cb1..505950e 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_add_fetch(&sa->sqn.outb, n, __ATOMIC_RELAXED); + sqn = __atomic_fetch_add(&sa->sqn.outb, n, __ATOMIC_RELAXED) + n; else { sqn = sa->sqn.outb + n; sa->sqn.outb = sqn; -- 1.8.3.1