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 0CFC24613C; Tue, 28 Jan 2025 00:15:02 +0100 (CET) Received: from mails.dpdk.org (localhost [127.0.0.1]) by mails.dpdk.org (Postfix) with ESMTP id 1997640150; Tue, 28 Jan 2025 00:15:01 +0100 (CET) Received: from mail-pl1-f180.google.com (mail-pl1-f180.google.com [209.85.214.180]) by mails.dpdk.org (Postfix) with ESMTP id 9F6DD40144 for ; Tue, 28 Jan 2025 00:14:59 +0100 (CET) Received: by mail-pl1-f180.google.com with SMTP id d9443c01a7336-21bc1512a63so96817635ad.1 for ; Mon, 27 Jan 2025 15:14:59 -0800 (PST) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=networkplumber-org.20230601.gappssmtp.com; s=20230601; t=1738019698; x=1738624498; darn=dpdk.org; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:from:to:cc:subject:date :message-id:reply-to; bh=HyEXkQnCibJhR7rAis7DNnc3P5mzJMWxYAAZ6x/N7r8=; b=na+TH3bNVzw2omhOErQJwQfiEYbDaiYs2cTVCubqlivFrnRn7d1axf36yu3Fs1ghyx tuaM7xaWS/6qA5elk9xl6UIeLKnMP8tkJhmOLOJ3AGBl/M7CP0Yt3o17mLMQkGyi4YVi fyiWaj7H60/2gd8p59XKyqdRhTnXoyUoY2iLMyrAW21j5djS0n0Ta/bNb/LKQmo57Baf 3F3NGzbTgmMlrOdsnpk5E7K7CGx4M4Iuf5KsmgoQfBwVssuv9YC2hSVW6iDYnP2n5tob ROddskxMlRXhToskfdVTuAd3xzv6E630IK5MOma7IcvFucwP0Wyf6B+ypr2HZIfQn9ZE qDxw== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20230601; t=1738019698; x=1738624498; h=content-transfer-encoding:mime-version:references:in-reply-to :message-id:subject:cc:to:from:date:x-gm-message-state:from:to:cc :subject:date:message-id:reply-to; bh=HyEXkQnCibJhR7rAis7DNnc3P5mzJMWxYAAZ6x/N7r8=; b=uPNRCkc1gusUBKBTrIdk6sa5B9MCJBU+BXLjVwTmOMGyJlB2jmH8ryXkoNCi1r8KGt b1YK7w6DDmKqgr+FQbDe4yPsEL3EdExG9i2Zu3NoB8bdz9CMSiOwOq2yN7z5qI82E43E sVPfcnMs3p4/0Uphd3WRgSmRrY5F+tXYyoKt2+JSFT9m0gmOSUKKsMgYVlCDiKY1l5v7 kjzQM/RG/FlGlQIbRkw9YAfQqEdrTe00StjaZ4P4IzLWzmVQ4MxVYfKGaFr95NuyNBLu ZKTmePIQzlCI5cUZyGlljBGDWwr9A2bcShqTTjaSDEh69emLkDuWnxfEaiCy6jb/DVRY WD7A== X-Forwarded-Encrypted: i=1; AJvYcCXN5UQf7GRtRfPpXyDY5UcyEjjEQiANyhdK/1/h9EjG82sJ9kB5K6L1vrbQU9RGIDasgj0=@dpdk.org X-Gm-Message-State: AOJu0YzL92JJo7CRfpmDJ1XJhj0e5faYqlNEfilcUmbfEo9/jXZ79idA 12v7EXh6bTkhfBjkp+oU+viGWKN7qLaCgQAuw085QFUHD5BdmKsEDwkTKvuOlbw= X-Gm-Gg: ASbGncvqPQ/g5Go3SatPX2NKcxdWPsrsjeBeKNiINsO0SnwKfmID6L1BLnDQG9Yqnge WPFBdbd2RFbeViCc+aiXE3WIR1VoZwZsk2/+jndBaxxulMqQXVOu/AwyT8HPe+5bcKiR3lJXZtc orPFbby4XzLmJqojBXcQJNJ96qM19dQaOVaZ7nxeTZ12GD5QwoqBCo3gVq4u0yYeCEEawIHpIRh QDcB6Su9Y4VtxMlRGn8Arsu9bbtDQqPM8NwoZbWRYBGiQ4dVcJ4iCgj7WitiM5L/aWHFKymj76u kAPaNLCWHejUVU9hR4jB8a8uOwItiXW0qCDys+OD+meBm0aJTd5ObNqlVg== X-Google-Smtp-Source: AGHT+IFawoWGon5RHswO9aL7MUR9YwvJJ3hne0m5J1GFJ2aTD/k15l9BfeXNDr++qkJuVVPWZBII9Q== X-Received: by 2002:a05:6a21:9991:b0:1e1:f281:8d36 with SMTP id adf61e73a8af0-1eb21486389mr65628330637.10.1738019698446; Mon, 27 Jan 2025 15:14:58 -0800 (PST) Received: from hermes.local (204-195-96-226.wavecable.com. [204.195.96.226]) by smtp.gmail.com with ESMTPSA id d2e1a72fcca58-72f8a69fd40sm7739548b3a.3.2025.01.27.15.14.57 (version=TLS1_3 cipher=TLS_AES_256_GCM_SHA384 bits=256/256); Mon, 27 Jan 2025 15:14:58 -0800 (PST) Date: Mon, 27 Jan 2025 15:14:56 -0800 From: Stephen Hemminger To: Morten =?UTF-8?B?QnLDuHJ1cA==?= Cc: "Bruce Richardson" , Subject: Re: [RFC 0/7] Introduce FreeBSD macros for SAFE iteration Message-ID: <20250127151456.14938f86@hermes.local> In-Reply-To: <98CBD80474FA8B44BF855DF32C47DC35E9F9F8@smartserver.smartshare.dk> References: <20250127180842.97907-1-stephen@networkplumber.org> <20250127104341.749f7cff@hermes.local> <98CBD80474FA8B44BF855DF32C47DC35E9F9F8@smartserver.smartshare.dk> MIME-Version: 1.0 Content-Type: text/plain; charset=UTF-8 Content-Transfer-Encoding: quoted-printable 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 Mon, 27 Jan 2025 20:29:55 +0100 Morten Br=C3=B8rup wrote: > > 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: =20 > > > > 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. > > > > =20 > > > > > > Actually, I wouldn't be that quick to eliminate the last option. It = =20 > > may =20 > > > give us some additional options for simplification. For example, the > > > strlcpy and strlcat functions are in libbsd too, and if we had that = =20 > > as =20 > > > mandatory dependency, perhaps we could remove some extra code there = =20 > > too? =20 > > > > > > /Bruce > > > =20 > >=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? =20 >=20 > +1 to providing our own implementations of relevant libbsd features in th= e DPDK EAL, rather than depending on the entire libbsd (and libbsd-dev for = development). Providing these features as part of a "utilities library" (wh= ich is currently integrated into the EAL) is better for non-Unix environmen= ts. >=20 > Furthermore, libbsd has plenty of stuff we don't need: > https://manpages.debian.org/testing/libbsd-dev/index.html The red-black tries in libbsd are very useful. In one product we used it as= a way to manage LPM rules, since the current DPDK model is O(N^2) and works terri= bly in a router with 3M routes.