> From: Stephen Hemminger [mailto:step...@networkplumber.org] > Sent: Monday, 27 January 2025 19.44 > > On Mon, 27 Jan 2025 18:16:18 +0000 > Bruce Richardson <bruce.richard...@intel.com> wrote: > > > 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 > > > > 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