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 B5B1F41BBD; Fri, 3 Feb 2023 15:25:08 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 434F34067B; Fri, 3 Feb 2023 15:25:08 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 83E794021E for ; Fri, 3 Feb 2023 15:25:07 +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: Fri, 3 Feb 2023 15:25:05 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35D876FA@smartserver.smartshare.dk> In-Reply-To: X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [PATCH] eal: introduce atomics abstraction Thread-Index: Adk312GRhZr/TXmPQku48z1OSp3b0QAAdAdA References: <1673558785-24992-1-git-send-email-roretzla@linux.microsoft.com> <1673558785-24992-2-git-send-email-roretzla@linux.microsoft.com> <1844463.CQOukoFCf9@thomas> <20230201214111.GA30564@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <98CBD80474FA8B44BF855DF32C47DC35D876EE@smartserver.smartshare.dk> <20230202190023.GA32597@linuxonhyperv3.guj3yctzbm1etfxqx2vob5hsef.xx.internal.cloudapp.net> <98CBD80474FA8B44BF855DF32C47DC35D876F7@smartserver.smartshare.dk> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Bruce Richardson" Cc: "Tyler Retzlaff" , "Honnappa Nagarahalli" , , , , , , , "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: Bruce Richardson [mailto:bruce.richardson@intel.com] > Sent: Friday, 3 February 2023 14.57 >=20 > Having read through the whole thread a second time, I am starting to > realise how complex a problem this could be. From what I read, I would > tend > towards the opinion that we shouldn't provide any atomics in DPDK at > all, > and just rely on the C standard ones. Yes, but atomics were only standardized for C with C11. So that is the = problem - and a good reason for pushing for C11. Before C11, there were only compiler specific intrinsics. > The main complication in any > solution > I suspect is going to be the use of atomics in static inline functions > we > have in our header files. Not only that. If we consider atomic variables (and the type of such variables) private = to DPDK, we would need to provide public functions to manipulate those = atomic variables. If not, the application will be unable to interact = with them. And if we expose such functions, why not also make the DPDK atomic type = itself public? In other words, expose a DPDK API for atomics, such as = Tyler's. (And as I mentioned on the techboard meeting, I think atomic operations = should be available in inline code, for performance reasons.) -Morten