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 AA2FC427E5; Mon, 20 Mar 2023 20:02:38 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F228D42D4B; Mon, 20 Mar 2023 20:01:23 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id B0E92410D0 for ; Mon, 20 Mar 2023 20:01:03 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 9249620FB43F; Mon, 20 Mar 2023 12:01:02 -0700 (PDT) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 9249620FB43F DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1679338862; bh=r9XDr4q7jR8mMosuaoVHBo+mE68sPCTx8WYzCPf8TaE=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=ZbhzhURkKPZqcSyj1Fj9EfBZVKmnLw9i7kSt9v9iNs9mwGFA9lPYuV6JVN920tNRB 21r99Ix4DNjWPr6QVbld1tmSQep5Ex0mhBfdngX/ABN/1L4YmdEEga335oY4PGH4Q4 WUiHKHVG9FZtkyd1KjYCNZh5DEq9OYL0qIxna6Qc= From: Tyler Retzlaff To: dev@dpdk.org Cc: Honnappa.Nagarahalli@arm.com, Ruifeng.Wang@arm.com, thomas@monjalon.net, pbhagavatula@marvell.com, ndabilpuram@marvell.com, Tyler Retzlaff Subject: [PATCH v3 16/16] rcu: use previous value atomic fetch operations Date: Mon, 20 Mar 2023 12:00:36 -0700 Message-Id: <1679338836-21321-17-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> <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 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 Reviewed-by: Ruifeng Wang --- lib/rcu/rte_rcu_qsbr.h | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/lib/rcu/rte_rcu_qsbr.h b/lib/rcu/rte_rcu_qsbr.h index ccae5d5..1aa078e 100644 --- a/lib/rcu/rte_rcu_qsbr.h +++ b/lib/rcu/rte_rcu_qsbr.h @@ -462,7 +462,7 @@ struct rte_rcu_qsbr_dq_parameters { * structure are visible to the workers before the token * update is visible. */ - t = __atomic_add_fetch(&v->token, 1, __ATOMIC_RELEASE); + t = __atomic_fetch_add(&v->token, 1, __ATOMIC_RELEASE) + 1; return t; } -- 1.8.3.1