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 B2C534613B; Mon, 27 Jan 2025 20:29:57 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 893EC40A72; Mon, 27 Jan 2025 20:29:57 +0100 (CET) Received: from dkmailrelay1.smartsharesystems.com (smartserver.smartsharesystems.com [77.243.40.215]) by mails.dpdk.org (Postfix) with ESMTP id 469094028F for ; Mon, 27 Jan 2025 20:29:56 +0100 (CET) Received: from smartserver.smartsharesystems.com (smartserver.smartsharesys.local [192.168.4.10]) by dkmailrelay1.smartsharesystems.com (Postfix) with ESMTP id 0E4BE2091E; Mon, 27 Jan 2025 20:29:56 +0100 (CET) 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: [RFC 0/7] Introduce FreeBSD macros for SAFE iteration Date: Mon, 27 Jan 2025 20:29:55 +0100 Message-ID: <98CBD80474FA8B44BF855DF32C47DC35E9F9F8@smartserver.smartshare.dk> X-MimeOLE: Produced By Microsoft Exchange V6.5 In-Reply-To: <20250127104341.749f7cff@hermes.local> X-MS-Has-Attach: X-MS-TNEF-Correlator: Thread-Topic: [RFC 0/7] Introduce FreeBSD macros for SAFE iteration Thread-Index: Adtw62huPEvmVjXTQD659DtahtDl6gABDTOw References: <20250127180842.97907-1-stephen@networkplumber.org> <20250127104341.749f7cff@hermes.local> From: =?iso-8859-1?Q?Morten_Br=F8rup?= To: "Stephen Hemminger" , "Bruce Richardson" Cc: 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: Stephen Hemminger [mailto:stephen@networkplumber.org] > Sent: Monday, 27 January 2025 19.44 >=20 > On Mon, 27 Jan 2025 18:16:18 +0000 > Bruce Richardson wrote: >=20 > > On Mon, Jan 27, 2025 at 10:03:54AM -0800, Stephen Hemminger wrote: > > > This series adds common macros for safe iteration over lists. > > > It is a subset copy of the macros from FreeBSD that are > > > missing from the Linux header sys/queue.h > > > > > > Chose this over several other options: > > > - let each driver define their own as needed. > > > One Intel driver got it wrong, others will as well. > > > - rename all the queue macros to RTE_XXX variants. > > > Seems like useless renaming and confusion. > > > - Several distros have libbsd package with the correct macros. > > > But adding yet another dependency to DPDK would be annoying > > > for something this basic. > > > > > > > Actually, I wouldn't be that quick to eliminate the last option. It > may > > give us some additional options for simplification. For example, the > > strlcpy and strlcat functions are in libbsd too, and if we had that > as > > mandatory dependency, perhaps we could remove some extra code there > too? > > > > /Bruce > > >=20 > I would be ok with using libbsd but only if we didn't have to keep a > parallel > copy for all the other compiler and OS variants. And would it be = global > or > a per-driver dependency? +1 to providing our own implementations of relevant libbsd features in = the DPDK EAL, rather than depending on the entire libbsd (and libbsd-dev = for development). Providing these features as part of a "utilities = library" (which is currently integrated into the EAL) is better for = non-Unix environments. Furthermore, libbsd has plenty of stuff we don't need: https://manpages.debian.org/testing/libbsd-dev/index.html