Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-16.7 required=3.0 tests=BAYES_00, HEADER_FROM_DIFFERENT_DOMAINS,INCLUDES_CR_TRAILER,INCLUDES_PATCH, MAILING_LIST_MULTI,SPF_HELO_NONE,SPF_PASS,URIBL_BLOCKED,USER_AGENT_GIT autolearn=ham autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id E7B4AC433E0 for ; Mon, 21 Dec 2020 07:39:54 +0000 (UTC) Received: from dpdk.org (dpdk.org [92.243.14.124]) by mail.kernel.org (Postfix) with ESMTP id 61B7A22C7B for ; Mon, 21 Dec 2020 07:39:54 +0000 (UTC) DMARC-Filter: OpenDMARC Filter v1.3.2 mail.kernel.org 61B7A22C7B Authentication-Results: mail.kernel.org; dmarc=fail (p=none dis=none) header.from=arm.com Authentication-Results: mail.kernel.org; spf=pass smtp.mailfrom=dev-bounces@dpdk.org 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 Content-Transfer-Encoding: 8bit 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); } /** -- 2.29.2