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 6677B41B9B; Wed, 1 Feb 2023 09:09:51 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 027C04113F; Wed, 1 Feb 2023 09:09:51 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id AEBCE4021F for ; Wed, 1 Feb 2023 09:09:49 +0100 (CET) X-MimeOLE: Produced By Microsoft Exchange V6.5 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] eal: introduce atomics abstraction Date: Wed, 1 Feb 2023 09:09:42 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D876E0@smartserver.smartshare.dk> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] eal: introduce atomics abstraction Thread-Index: AQHZNcVOKaGjm++r5EuVscptDtirzq65Kg2ggACNrHA= References: <1673558785-24992-1-git-send-email-roretzla@linux.microsoft.com> <1673558785-24992-2-git-send-email-roretzla@linux.microsoft.com> <1844463.CQOukoFCf9@thomas> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Honnappa Nagarahalli" , Cc: , , "Tyler Retzlaff" , , , , , "nd" , "nd" 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: Honnappa Nagarahalli [mailto:Honnappa.Nagarahalli@arm.com] > Sent: Wednesday, 1 February 2023 02.08 >=20 > > From: Thomas Monjalon > > Sent: Tuesday, January 31, 2023 4:42 PM > > > > Honnappa, please could you give your view on the future of atomics = in > DPDK? > Thanks Thomas, apologies it has taken me a while to get to this > discussion. >=20 > IMO, we do not need DPDK's own abstractions. APIs from stdatomic.h > (stdatomics as is called here) already serve the purpose. These APIs > are well understood and documented. >=20 > For environments where stdatomics are not supported, we could have a > stdatomic.h in DPDK implementing the same APIs (we have to support = only > _explicit APIs). This allows the code to use stdatomics APIs and when > we move to minimum supported standard C11, we just need to get rid of > the file in DPDK repo. I agree with Honnappa. DPDK should include a shim to expose the C11 stdatomic.h API for = environments not already having the C11 stdatomic.h. With this, DPDK steps outside its native rte_ prefixed namespace, but it = should not collide with anyone else's namespace. It could collide with someone else's namespace if the application = implements a similar shim. We cannot prevent this from happening, but if = it does, it should be fixed in the application. >=20 > > > > > > 12/01/2023 22:26, Tyler Retzlaff: > > > Introduce atomics abstraction that permits optional use of = standard > > > C11 atomics when meson is provided the new = enable_stdatomics=3Dtrue > > option. > > > > > > Signed-off-by: Tyler Retzlaff