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 06B9343B06; Thu, 15 Feb 2024 07:51:19 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id C249E433B8; Thu, 15 Feb 2024 07:51:10 +0100 (CET) Received: from linux.microsoft.com (linux.microsoft.com [13.77.154.182]) by mails.dpdk.org (Postfix) with ESMTP id 028AB4338F for ; Thu, 15 Feb 2024 07:51:06 +0100 (CET) Received: by linux.microsoft.com (Postfix, from userid 1086) id 4E995207F22C; Wed, 14 Feb 2024 22:51:06 -0800 (PST) DKIM-Filter: OpenDKIM Filter v2.11.0 linux.microsoft.com 4E995207F22C DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=linux.microsoft.com; s=default; t=1707979866; bh=8Or3MceNI3rLZIP1ozK+sGA5li5/n/rJ+DjZRZQN7js=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=s5+/o6SEP3592nAOS6+6AXgg8sUSe3BgwPfpWiRCeT7BiFGpl9NVPWNMgyP9zXgjI fu1CB+My4KnvFDteTMxLKDwiXBlsvvy1ckEfIndqwhapVrTTOaJOBe4ZJCpmAXT4PD HB4/j3fvb9pdlB5gbnj0qWClGu5IKhTAn/rkZTFk= From: Tyler Retzlaff To: dev@dpdk.org Cc: Bruce Richardson , David Hunt , Honnappa Nagarahalli , Jerin Jacob , Konstantin Ananyev , Sameh Gobriel , Sunil Kumar Kori , Vladimir Medvedkin , Yipeng Wang , mb@smartsharesystems.com, thomas@monjalon.net, Tyler Retzlaff Subject: [PATCH v2 2/6] eal: use rte atomic thread fence Date: Wed, 14 Feb 2024 22:50:55 -0800 Message-Id: <1707979859-3984-3-git-send-email-roretzla@linux.microsoft.com> X-Mailer: git-send-email 1.8.3.1 In-Reply-To: <1707979859-3984-1-git-send-email-roretzla@linux.microsoft.com> References: <1698894265-22963-1-git-send-email-roretzla@linux.microsoft.com> <1707979859-3984-1-git-send-email-roretzla@linux.microsoft.com> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: 8bit 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 rte_atomic_thread_fence instead of directly using __atomic_thread_fence builtin gcc intrinsic Update rte_mcslock.h to use rte_atomic_thread_fence instead of directly using internal __rte_atomic_thread_fence Signed-off-by: Tyler Retzlaff Acked-by: Morten Brørup --- lib/eal/common/eal_common_trace.c | 2 +- lib/eal/include/rte_mcslock.h | 4 ++-- 2 files changed, 3 insertions(+), 3 deletions(-) diff --git a/lib/eal/common/eal_common_trace.c b/lib/eal/common/eal_common_trace.c index 6ad87fc..918f49b 100644 --- a/lib/eal/common/eal_common_trace.c +++ b/lib/eal/common/eal_common_trace.c @@ -526,7 +526,7 @@ rte_trace_mode rte_trace_mode_get(void) /* Add the trace point at tail */ STAILQ_INSERT_TAIL(&tp_list, tp, next); - __atomic_thread_fence(rte_memory_order_release); + rte_atomic_thread_fence(rte_memory_order_release); /* All Good !!! */ return 0; diff --git a/lib/eal/include/rte_mcslock.h b/lib/eal/include/rte_mcslock.h index 2ca967f..0aeb1a0 100644 --- a/lib/eal/include/rte_mcslock.h +++ b/lib/eal/include/rte_mcslock.h @@ -83,7 +83,7 @@ * store to prev->next. Otherwise it will cause a deadlock. Need a * store-load barrier. */ - __rte_atomic_thread_fence(rte_memory_order_acq_rel); + rte_atomic_thread_fence(rte_memory_order_acq_rel); /* If the lock has already been acquired, it first atomically * places the node at the end of the queue and then proceeds * to spin on me->locked until the previous lock holder resets @@ -117,7 +117,7 @@ * while-loop first. This has the potential to cause a * deadlock. Need a load barrier. */ - __rte_atomic_thread_fence(rte_memory_order_acquire); + rte_atomic_thread_fence(rte_memory_order_acquire); /* More nodes added to the queue by other CPUs. * Wait until the next pointer is set. */ -- 1.8.3.1