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 0E7BC43060; Mon, 14 Aug 2023 11:04:40 +0200 (CEST) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id F2906410DC; Mon, 14 Aug 2023 11:04:39 +0200 (CEST) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id CB5DB4021F; Mon, 14 Aug 2023 11:04:38 +0200 (CEST) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id A6085205ED; Mon, 14 Aug 2023 11:04:38 +0200 (CEST) Content-class: urn:content-classes:message MIME-Version: 1.0 Content-Type: text/plain; charset="iso-8859-1" Content-Transfer-Encoding: quoted-printable Subject: RE: [PATCH 1/6] eal: provide rte stdatomics optional atomics API Date: Mon, 14 Aug 2023 11:04:32 +0200 X-MimeOLE: Produced By Microsoft Exchange V6.5 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D87AF6@smartserver.smartshare.dk> In-Reply-To: <20230811155441.GB20040@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH 1/6] eal: provide rte stdatomics optional atomics API Thread-Index: AdnMbCYWNk28cwVqRV+ZmmqW7ymQPACIHWmg References: <1691717521-1025-1-git-send-email-roretzla@linux.microsoft.com> <1691717521-1025-2-git-send-email-roretzla@linux.microsoft.com> <98CBD80474FA8B44BF855DF32C47DC35D87AE8@smartserver.smartshare.dk> <20230811155441.GB20040@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Tyler Retzlaff" Cc: , , "Bruce Richardson" , "Honnappa Nagarahalli" , "Ruifeng Wang" , "Jerin Jacob" , "Sunil Kumar Kori" , =?iso-8859-1?Q?Mattias_R=F6nnblom?= , "Joyce Kong" , "David Christensen" , "Konstantin Ananyev" , "David Hunt" , "Thomas Monjalon" , "David Marchand" 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 > From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] > Sent: Friday, 11 August 2023 17.55 >=20 > On Fri, Aug 11, 2023 at 11:42:12AM +0200, Morten Br=F8rup wrote: > > > From: Tyler Retzlaff [mailto:roretzla@linux.microsoft.com] > > > Sent: Friday, 11 August 2023 03.32 > > > > > > Provide API for atomic operations in the rte namespace that may > > > optionally be configured to use C11 atomics with meson > > > option enable_stdatomics=3Dtrue > > > > > > Signed-off-by: Tyler Retzlaff > > > --- [...] > > > > Move the (changed) C11 memory order type definition here: > > > > /* The memory order is an enumerated type in C11. */ > > #define memory_order rte_memory_order No objections to your typedef in v2. [...] > > > +#ifdef __ATOMIC_SEQ_CST > > > +_Static_assert(rte_memory_order_seq_cst =3D=3D __ATOMIC_SEQ_CST, > > > + "rte_memory_order_seq_cst =3D=3D __ATOMIC_SEQ_CST"); > > > +#endif > > > > Excellent idea adding these _Static_asserts! > > > > Have you tested (with the toolchain you are targeting with this > _Static_assert) that e.g. __ATOMIC_RELAXED is actually #defined, so = the > preprocessor can see it? (I guess that being a built-it, it might not = be a > #define, it might be a magic value known by the compiler only.) >=20 > * llvm and gcc both expose it as a built-in #define for test builds i > have run. worst case the assert is lost if it isn't. I only wanted to check that we didn't always hit the "worst case" where = the static_assert is lost, so thank you for the confirmation regarding = GCC/clang. > * since i have to handle non-{clang,gcc} too i still guard with ifdef Agree. > * i do need to switch to using assert.h static_assert macro to > inter-operate with c++ in v2 OK. I reviewed that in v2 too. -Morten