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 B311043B0F; Wed, 14 Feb 2024 23:40:35 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4169742EAA; Wed, 14 Feb 2024 23:40:35 +0100 (CET) Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by mails.dpdk.org (Postfix) with ESMTP id 7985642E10 for ; Wed, 14 Feb 2024 23:40:34 +0100 (CET) Received: from compute7.internal (compute7.nyi.internal [10.202.2.48]) by mailout.nyi.internal (Postfix) with ESMTP id 395FD5C0079; Wed, 14 Feb 2024 17:40:31 -0500 (EST) Received: from mailfrontend1 ([10.202.2.162]) by compute7.internal (MEProxy); Wed, 14 Feb 2024 17:40:31 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:cc:content-transfer-encoding:content-type:content-type:date :date:from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to; s=fm3; t=1707950431; x=1708036831; bh=YJAuUdxKD/32xf9FhXceKNTHtTCimbjoPlF71V6Enhw=; b= NY2tm38QNGp8QHdWD0HNSnDxaOE74Wk3mXVSLtqnynPOtsPnal5P7djNAN0ny/CA FeFjhM8KmXrSZKrTg2v5UUXHx516JOKPvSEg/wftqR05xk1uOxbfLrWvvi00nvq8 gorAIeeNFoNbEn3Bg80mN6rTMC3SyxMPKfU/oj7++VtWdO1mZK6faeBatvRE4z6l ZxNT2mLh2A/AK1Qc91LN/vAYJHRPfrrCLnd88svVsqRtEUZ97BimlK0h9HzsnNZY BfpqOdx4AIe2Vzlg5c4MvS2him22BmqRQRcQUMOvHTxnP/GJN9VMuxSL1qSxNNsZ nHAQ0jcFilHGpdoRR/vAiQ== DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:cc:content-transfer-encoding :content-type:content-type:date:date:feedback-id:feedback-id :from:from:in-reply-to:in-reply-to:message-id:mime-version :references:reply-to:subject:subject:to:to:x-me-proxy:x-me-proxy :x-me-sender:x-me-sender:x-sasl-enc; s=fm3; t=1707950431; x= 1708036831; bh=YJAuUdxKD/32xf9FhXceKNTHtTCimbjoPlF71V6Enhw=; b=G zUgCw9Haofjj1/Zzw4bJVUgmoYbmm9kEO6D85APQ48RqA8UFbHETYLI5hWgH9/fR JpEcyJHszHRObpcl3ARabnIYVv6lsxSpqIPQCG//uSsUDFXKkXVY4Euiav02/ZZi M5zo+GltI7LZ0Hs6vtdiWioGik8x4xLkCMOIh8hacM86ozuj0pFVNoL8TcioS8BT sqGYqJzRkEA4bJKPG2MkaqpeA0Dj0dDO7USMhl4cjIfg8rduFPEsUczCgTERzAjH DE+KsYD1MP7MnW5Kl5UPj4Ao79q184yD6PnsiTUSJzRpHXdPFK3HPmcEyq2BDnZ5 cXqziHEIzs0vGEnDSqneQ== X-ME-Sender: X-ME-Received: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgedvledrudekucetufdoteggodetrfdotffvucfrrh hofhhilhgvmecuhfgrshhtofgrihhlpdfqfgfvpdfurfetoffkrfgpnffqhgenuceurghi lhhouhhtmecufedttdenucesvcftvggtihhpihgvnhhtshculddquddttddmnecujfgurh ephffvvefufffkjghfggfgtgesthfuredttddtvdenucfhrhhomhepvfhhohhmrghsucfo ohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucggtffrrg htthgvrhhnpedtjeeiieefhedtfffgvdelteeufeefheeujefgueetfedttdeikefgkedu hedtgfenucevlhhushhtvghrufhiiigvpedtnecurfgrrhgrmhepmhgrihhlfhhrohhmpe hthhhomhgrshesmhhonhhjrghlohhnrdhnvght X-ME-Proxy: Feedback-ID: i47234305:Fastmail Received: by mail.messagingengine.com (Postfix) with ESMTPA; Wed, 14 Feb 2024 17:40:29 -0500 (EST) From: Thomas Monjalon To: Tyler Retzlaff Cc: dev@dpdk.org, Bruce Richardson , David Hunt , Honnappa Nagarahalli , Jerin Jacob , Konstantin Ananyev , Sameh Gobriel , Sunil Kumar Kori , Vladimir Medvedkin , Yipeng Wang , david.marchand@redhat.com, Morten =?ISO-8859-1?Q?Br=F8rup?= Subject: Re: [PATCH 0/5] use rte atomic thread fence Date: Wed, 14 Feb 2024 23:40:27 +0100 Message-ID: <15453844.RDIVbhacDa@thomas> In-Reply-To: <20231108184922.GB21615@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> References: <1698894265-22963-1-git-send-email-roretzla@linux.microsoft.com> <2796747.XrmoMso0CX@thomas> <20231108184922.GB21615@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" 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 08/11/2023 19:49, Tyler Retzlaff: > On Wed, Nov 08, 2023 at 06:04:47PM +0100, Thomas Monjalon wrote: > > 02/11/2023 04:04, Tyler Retzlaff: > > > Replace use of __atomic_thread_fence with __rte_atomic_thread_fence. > > > > > > It may be appropriate to use rte_atomic_thread_fence instead but it > > > will be up to maintainers to evaluate and make the change if appropriate. > > > > I don't understand the use of __rte_atomic_thread_fence > > which is supposed to be EAL-internal only, isn't it? > > > > On x86, we have this: > > static __rte_always_inline void > > rte_atomic_thread_fence(rte_memory_order memorder) > > { > > if (memorder == rte_memory_order_seq_cst) > > rte_smp_mb(); > > else > > __rte_atomic_thread_fence(memorder); > > } > > > > This is skipped if you use __rte_atomic_thread_fence() directly. > > correct. that is on purpose because the original code was skipping > condition by using __atomic_thread_fence directly. There is chance that it was not skipping on purpose. > this series intends no functional change which is why the replacements > are __rte_atomic_thread_fence instead of to rte_atomic_thread_fence. We should take this opportunity to simplify the code, I mean we should avoid having 3 functions for the same thing. > i would encourage the maintainers to evaluate whether the code can use > rte_atomic_thread_fence directly without functional regression. Let's do the change so the maintainers can review what is changed. Note it should have no impact if not using rte_memory_order_seq_cst. If we discover later that something is broken, we have time to fix it. Note: lib/eal/include/rte_mcslock.h should not use __rte_atomic_thread_fence() and lib/lpm/rte_lpm.c should not use __atomic_thread_fence(). Can we replace and discourage all occurrences of __atomic_thread_fence() and __rte_atomic_thread_fence()? It would be simpler to recommend only rte_atomic_thread_fence(). Also in another patch, it would be nice to replace __ATOMIC_* with rte_memory_order_*, at least when used in rte_atomic_thread_fence().