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 AE99342D26; Thu, 22 Jun 2023 20:19:35 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 4770340DDA; Thu, 22 Jun 2023 20:19:35 +0200 (CEST) Received: from mail.lysator.liu.se (mail.lysator.liu.se [130.236.254.3]) by mails.dpdk.org (Postfix) with ESMTP id 00CC9406BA for ; Thu, 22 Jun 2023 20:19:33 +0200 (CEST) Received: from mail.lysator.liu.se (localhost [127.0.0.1]) by mail.lysator.liu.se (Postfix) with ESMTP id 97D04A426 for ; Thu, 22 Jun 2023 20:19:33 +0200 (CEST) Received: by mail.lysator.liu.se (Postfix, from userid 1004) id 96909A5A0; Thu, 22 Jun 2023 20:19:33 +0200 (CEST) X-Spam-Checker-Version: SpamAssassin 3.4.6 (2021-04-09) on hermod.lysator.liu.se X-Spam-Level: X-Spam-Status: No, score=-1.5 required=5.0 tests=ALL_TRUSTED, AWL, NICE_REPLY_A, T_SCC_BODY_TEXT_LINE autolearn=disabled version=3.4.6 X-Spam-Score: -1.5 Received: from [192.168.1.59] (h-62-63-215-114.A163.priv.bahnhof.se [62.63.215.114]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange ECDHE (P-256) server-signature RSA-PSS (2048 bits) server-digest SHA256) (No client certificate requested) by mail.lysator.liu.se (Postfix) with ESMTPSA id 61F3D9EE8; Thu, 22 Jun 2023 20:19:31 +0200 (CEST) Message-ID: <4954a01e-53e3-c070-d737-a60c0042c736@lysator.liu.se> Date: Thu, 22 Jun 2023 20:19:30 +0200 MIME-Version: 1.0 User-Agent: Mozilla/5.0 (X11; Linux x86_64; rv:102.0) Gecko/20100101 Thunderbird/102.11.0 Subject: Re: [PATCH] eal: add notes to SMP memory barrier APIs To: Ruifeng Wang , thomas@monjalon.net, david.marchand@redhat.com Cc: dev@dpdk.org, konstantin.v.ananyev@yandex.ru, honnappa.nagarahalli@arm.com, nd@arm.com References: <20230621064420.163931-1-ruifeng.wang@arm.com> Content-Language: en-US From: =?UTF-8?Q?Mattias_R=c3=b6nnblom?= In-Reply-To: <20230621064420.163931-1-ruifeng.wang@arm.com> Content-Type: text/plain; charset=UTF-8; format=flowed Content-Transfer-Encoding: 7bit X-Virus-Scanned: ClamAV using ClamSMTP 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 On 2023-06-21 08:44, Ruifeng Wang wrote: > The rte_smp_xx() APIs are deprecated. But it is not mentioned > in the function header. > Added notes in function header for clarification. > > Signed-off-by: Ruifeng Wang > --- > lib/eal/include/generic/rte_atomic.h | 15 +++++++++++++++ > 1 file changed, 15 insertions(+) > > diff --git a/lib/eal/include/generic/rte_atomic.h b/lib/eal/include/generic/rte_atomic.h > index 58df843c54..542a2c16ff 100644 > --- a/lib/eal/include/generic/rte_atomic.h > +++ b/lib/eal/include/generic/rte_atomic.h > @@ -55,6 +55,11 @@ static inline void rte_rmb(void); > * Guarantees that the LOAD and STORE operations that precede the > * rte_smp_mb() call are globally visible across the lcores > * before the LOAD and STORE operations that follows it. > + * > + * @note > + * This function is deprecated. It adds complexity to the memory model > + * used by this project. C11 memory model should always be used. > + * rte_atomic_thread_fence() should be used instead. It's somewhat confusing to learn I should use the C11 memory model, and then in the next sentence that I should call a function which is not in C11. I think it would be helpful to say which memory_model parameters should be used to replace the rte_smp_*mb() calls, and if there are any difference in semantics between the Linux kernel-style barriers and their C11 (near-)equivalents. Is there some particular reason these functions aren't marked __rte_deprecated? Too many warnings? > */ > static inline void rte_smp_mb(void); > > @@ -64,6 +69,11 @@ static inline void rte_smp_mb(void); > * Guarantees that the STORE operations that precede the > * rte_smp_wmb() call are globally visible across the lcores > * before the STORE operations that follows it. > + * > + * @note > + * This function is deprecated. It adds complexity to the memory model > + * used by this project. C11 memory model should always be used. > + * rte_atomic_thread_fence() should be used instead. > */ > static inline void rte_smp_wmb(void); > > @@ -73,6 +83,11 @@ static inline void rte_smp_wmb(void); > * Guarantees that the LOAD operations that precede the > * rte_smp_rmb() call are globally visible across the lcores > * before the LOAD operations that follows it. > + * > + * @note > + * This function is deprecated. It adds complexity to the memory model > + * used by this project. C11 memory model should always be used. > + * rte_atomic_thread_fence() should be used instead. > */ > static inline void rte_smp_rmb(void); > ///@}