From patchwork Mon Dec 21 07:38:48 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Joyce Kong X-Patchwork-Id: 85590 X-Patchwork-Delegate: david.marchand@redhat.com Return-Path: X-Original-To: patchwork@inbox.dpdk.org Delivered-To: patchwork@inbox.dpdk.org Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id B0367A09EF; Mon, 21 Dec 2020 08:39:53 +0100 (CET) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 228A2CBB7; Mon, 21 Dec 2020 08:39:52 +0100 (CET) Received: from foss.arm.com (foss.arm.com [217.140.110.172]) by dpdk.org (Postfix) with ESMTP id 44C0FCBB4 for ; Mon, 21 Dec 2020 08:39:50 +0100 (CET) Received: from usa-sjc-imap-foss1.foss.arm.com (unknown [10.121.207.14]) by usa-sjc-mx-foss1.foss.arm.com (Postfix) with ESMTP id A71B5101E; Sun, 20 Dec 2020 23:39:48 -0800 (PST) Received: from net-arm-thunderx2-03.shanghai.arm.com (net-arm-thunderx2-03.shanghai.arm.com [10.169.208.206]) by usa-sjc-imap-foss1.foss.arm.com (Postfix) with ESMTPA id 059C13F66E; Sun, 20 Dec 2020 23:39:46 -0800 (PST) From: Joyce Kong To: honnappa.nagarahalli@arm.com, ruifeng.wang@arm.com Cc: dev@dpdk.org, nd@arm.com Date: Mon, 21 Dec 2020 15:38:48 +0800 Message-Id: <20201221073848.22366-1-joyce.kong@arm.com> X-Mailer: git-send-email 2.29.2 MIME-Version: 1.0 Subject: [dpdk-dev] [PATCH v1] lib/rcu: use rte atomic thread fence wrapper instead X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" Use rte_atomic_thread_fence wrapper which has been provided for __atomic_thread_fence builtins to support optimized code for __ATOMIC_SEQ_CST memory order on x86 platforms. Signed-off-by: Joyce Kong Reviewed-by: Honnappa Nagarahalli --- lib/librte_rcu/rte_rcu_qsbr.h | 7 +------ 1 file changed, 1 insertion(+), 6 deletions(-) diff --git a/lib/librte_rcu/rte_rcu_qsbr.h b/lib/librte_rcu/rte_rcu_qsbr.h index fa2b881bd..18811c1cc 100644 --- a/lib/librte_rcu/rte_rcu_qsbr.h +++ b/lib/librte_rcu/rte_rcu_qsbr.h @@ -329,12 +329,7 @@ rte_rcu_qsbr_thread_online(struct rte_rcu_qsbr *v, unsigned int thread_id) * writer might not see that the reader is online, even though * the reader is referencing the shared data structure. */ -#ifdef RTE_ARCH_X86_64 - /* rte_smp_mb() for x86 is lighter */ - rte_smp_mb(); -#else - __atomic_thread_fence(__ATOMIC_SEQ_CST); -#endif + rte_atomic_thread_fence(__ATOMIC_SEQ_CST); } /**