Re: [PATCH v2 11/43] lib: remove use of sys/queue.h

Andrew Rybchenko
2025-08-25T07:05:29Z

On 8/25/25 06:38, Stephen Hemminger wrote:
> Use the new rte_bsd_queue.h where needed but most files already
> get the needed macros from rte_tailq.h
>
> Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>

...

> diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c
> index 5987c9dee8..9a20033021 100644
> --- a/lib/mbuf/rte_mbuf_dyn.c
> +++ b/lib/mbuf/rte_mbuf_dyn.c
> @@ -3,7 +3,6 @@
> */
>
> #include <stdalign.h>
> -#include <sys/queue.h>

IMHO since rte_tailq.h itself does not provide/implement TAILQ
macros it is not nice to rely on indirect inclusion.
I think it would be better to include rte_bsd_queue.h directly
in the source file (nearby other rte headers).

> #include <stdint.h>
> #include <limits.h>
>
> diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
> index 1021ede0c2..bf8e870151 100644
> --- a/lib/mempool/rte_mempool.c
> +++ b/lib/mempool/rte_mempool.c
> @@ -12,7 +12,6 @@
> #include <unistd.h>
> #include <inttypes.h>
> #include <errno.h>
> -#include <sys/queue.h>

Same here

>
> #include <eal_export.h>
> #include <rte_common.h>