DPDK patches and discussions
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>,
	Tyler Retzlaff <roretzla@linux.microsoft.com>,
	Jerin Jacob <jerinj@marvell.com>,
	Sunil Kumar Kori <skori@marvell.com>,
	Anatoly Burakov <anatoly.burakov@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	Harman Kalra <hkalra@marvell.com>,
	Dmitry Kozlyuk <dmitry.kozliuk@gmail.com>
Subject: [RFC 03/47] eal: use bsd_queue.h
Date: Mon, 18 Aug 2025 16:27:14 -0700	[thread overview]
Message-ID: <20250818233102.180207-4-stephen@networkplumber.org> (raw)
In-Reply-To: <20250818233102.180207-1-stephen@networkplumber.org>

Replace use of sys/queue.h with bsd_queue.h

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 lib/eal/common/eal_common_bus.c    | 2 +-
 lib/eal/common/eal_common_class.c  | 2 +-
 lib/eal/common/eal_common_dev.c    | 2 +-
 lib/eal/common/eal_common_tailqs.c | 2 +-
 lib/eal/common/eal_common_trace.c  | 2 +-
 lib/eal/common/eal_private.h       | 2 +-
 lib/eal/common/malloc_elem.c       | 2 +-
 lib/eal/common/malloc_heap.c       | 2 +-
 lib/eal/common/malloc_heap.h       | 2 +-
 lib/eal/common/rte_malloc.c        | 2 +-
 lib/eal/freebsd/eal.c              | 2 +-
 lib/eal/freebsd/eal_interrupts.c   | 2 +-
 lib/eal/freebsd/eal_thread.c       | 2 +-
 lib/eal/freebsd/include/rte_os.h   | 6 ++++--
 lib/eal/linux/eal_alarm.c          | 2 +-
 lib/eal/linux/eal_interrupts.c     | 2 +-
 lib/eal/linux/include/rte_os.h     | 3 ++-
 lib/eal/windows/eal_alarm.c        | 2 +-
 18 files changed, 22 insertions(+), 19 deletions(-)

diff --git a/lib/eal/common/eal_common_bus.c b/lib/eal/common/eal_common_bus.c
index 0a2311a342..29b69a1bd8 100644
--- a/lib/eal/common/eal_common_bus.c
+++ b/lib/eal/common/eal_common_bus.c
@@ -4,8 +4,8 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <sys/queue.h>
 
+#include <bsd_queue.h>
 #include <bus_driver.h>
 #include <rte_debug.h>
 #include <rte_string_fns.h>
diff --git a/lib/eal/common/eal_common_class.c b/lib/eal/common/eal_common_class.c
index 0f10c6894b..1f10eca5b5 100644
--- a/lib/eal/common/eal_common_class.c
+++ b/lib/eal/common/eal_common_class.c
@@ -4,8 +4,8 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <sys/queue.h>
 
+#include <bsd_queue.h>
 #include <rte_class.h>
 #include <rte_debug.h>
 
diff --git a/lib/eal/common/eal_common_dev.c b/lib/eal/common/eal_common_dev.c
index 7185de0cb9..9bd7d5082d 100644
--- a/lib/eal/common/eal_common_dev.c
+++ b/lib/eal/common/eal_common_dev.c
@@ -6,8 +6,8 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/queue.h>
 
+#include <bsd_queue.h>
 #include <bus_driver.h>
 #include <rte_class.h>
 #include <dev_driver.h>
diff --git a/lib/eal/common/eal_common_tailqs.c b/lib/eal/common/eal_common_tailqs.c
index 47080d75ac..1d4eda8517 100644
--- a/lib/eal/common/eal_common_tailqs.c
+++ b/lib/eal/common/eal_common_tailqs.c
@@ -2,10 +2,10 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <sys/queue.h>
 #include <stdio.h>
 #include <string.h>
 
+#include <bsd_queue.h>
 #include <rte_eal.h>
 #include <rte_eal_memconfig.h>
 #include <rte_log.h>
diff --git a/lib/eal/common/eal_common_trace.c b/lib/eal/common/eal_common_trace.c
index be1f78a68d..2ec2a6532d 100644
--- a/lib/eal/common/eal_common_trace.c
+++ b/lib/eal/common/eal_common_trace.c
@@ -5,9 +5,9 @@
 #include <stdlib.h>
 #include <fnmatch.h>
 #include <pthread.h>
-#include <sys/queue.h>
 #include <regex.h>
 
+#include <bsd_queue.h>
 #include <rte_common.h>
 #include <rte_errno.h>
 #include <rte_lcore.h>
diff --git a/lib/eal/common/eal_private.h b/lib/eal/common/eal_private.h
index 5846917cc5..d7557ea4a8 100644
--- a/lib/eal/common/eal_private.h
+++ b/lib/eal/common/eal_private.h
@@ -8,8 +8,8 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdio.h>
-#include <sys/queue.h>
 
+#include <bsd_queue.h>
 #include <dev_driver.h>
 #include <rte_lcore.h>
 #include <rte_log.h>
diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c
index 452b119c20..cf78395eba 100644
--- a/lib/eal/common/malloc_elem.c
+++ b/lib/eal/common/malloc_elem.c
@@ -6,8 +6,8 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/queue.h>
 
+#include <bsd_queue.h>
 #include <rte_memory.h>
 #include <rte_eal.h>
 #include <rte_common.h>
diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c
index 13a56e490e..9f319cc040 100644
--- a/lib/eal/common/malloc_heap.c
+++ b/lib/eal/common/malloc_heap.c
@@ -6,8 +6,8 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <errno.h>
-#include <sys/queue.h>
 
+#include <bsd_queue.h>
 #include <rte_memory.h>
 #include <rte_errno.h>
 #include <rte_eal.h>
diff --git a/lib/eal/common/malloc_heap.h b/lib/eal/common/malloc_heap.h
index dfc56d4ae3..5c7e6cfad8 100644
--- a/lib/eal/common/malloc_heap.h
+++ b/lib/eal/common/malloc_heap.h
@@ -6,8 +6,8 @@
 #define MALLOC_HEAP_H_
 
 #include <stdbool.h>
-#include <sys/queue.h>
 
+#include <bsd_queue.h>
 #include <rte_malloc.h>
 #include <rte_spinlock.h>
 
diff --git a/lib/eal/common/rte_malloc.c b/lib/eal/common/rte_malloc.c
index 3a86c19490..f30b66fc10 100644
--- a/lib/eal/common/rte_malloc.c
+++ b/lib/eal/common/rte_malloc.c
@@ -6,8 +6,8 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/queue.h>
 
+#include <bsd_queue.h>
 #include <rte_errno.h>
 #include <rte_memcpy.h>
 #include <rte_memory.h>
diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index c1ab8d86d2..64e9922775 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -17,9 +17,9 @@
 #include <errno.h>
 #include <limits.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
 #include <sys/stat.h>
 
+#include <bsd_queue.h>
 #include <rte_common.h>
 #include <rte_debug.h>
 #include <rte_memory.h>
diff --git a/lib/eal/freebsd/eal_interrupts.c b/lib/eal/freebsd/eal_interrupts.c
index 5c3ab6699e..0e3069af8a 100644
--- a/lib/eal/freebsd/eal_interrupts.c
+++ b/lib/eal/freebsd/eal_interrupts.c
@@ -5,9 +5,9 @@
 #include <string.h>
 #include <sys/types.h>
 #include <sys/event.h>
-#include <sys/queue.h>
 #include <unistd.h>
 
+#include <bsd_queue.h>
 #include <eal_export.h>
 #include <eal_trace_internal.h>
 #include <rte_errno.h>
diff --git a/lib/eal/freebsd/eal_thread.c b/lib/eal/freebsd/eal_thread.c
index 7ed76ed796..28335282e7 100644
--- a/lib/eal/freebsd/eal_thread.c
+++ b/lib/eal/freebsd/eal_thread.c
@@ -9,9 +9,9 @@
 #include <unistd.h>
 #include <sched.h>
 #include <pthread_np.h>
-#include <sys/queue.h>
 #include <sys/thr.h>
 
+#include <bsd_queue.h>
 #include <rte_debug.h>
 #include <rte_atomic.h>
 #include <rte_launch.h>
diff --git a/lib/eal/freebsd/include/rte_os.h b/lib/eal/freebsd/include/rte_os.h
index 94b9275beb..874fdd7f03 100644
--- a/lib/eal/freebsd/include/rte_os.h
+++ b/lib/eal/freebsd/include/rte_os.h
@@ -12,9 +12,11 @@
 
 #include <pthread_np.h>
 #include <stdlib.h>            /* Declares alloca() */
-#include <sys/queue.h>
 
-/* These macros are compatible with system's sys/queue.h. */
+/* Alternative to system's sys/queue.h which is missing some macros. */
+#include <bsd_queue.h>
+
+/* These macros are compatible with bsd_queue.h. */
 #define RTE_TAILQ_HEAD(name, type) TAILQ_HEAD(name, type)
 #define RTE_TAILQ_ENTRY(type) TAILQ_ENTRY(type)
 #define RTE_TAILQ_FOREACH(var, head, field) TAILQ_FOREACH(var, head, field)
diff --git a/lib/eal/linux/eal_alarm.c b/lib/eal/linux/eal_alarm.c
index eb6a21d4f0..150e502437 100644
--- a/lib/eal/linux/eal_alarm.c
+++ b/lib/eal/linux/eal_alarm.c
@@ -6,10 +6,10 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <pthread.h>
-#include <sys/queue.h>
 #include <sys/time.h>
 #include <sys/timerfd.h>
 
+#include <bsd_queue.h>
 #include <eal_export.h>
 #include <eal_trace_internal.h>
 #include <rte_interrupts.h>
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index 4ec78de82c..0d26cd9ce0 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -5,7 +5,6 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
-#include <sys/queue.h>
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
@@ -15,6 +14,7 @@
 #include <assert.h>
 #include <stdbool.h>
 
+#include <bsd_queue.h>
 #include <eal_export.h>
 #include <eal_trace_internal.h>
 #include <rte_common.h>
diff --git a/lib/eal/linux/include/rte_os.h b/lib/eal/linux/include/rte_os.h
index 20eff0409a..bfb9447586 100644
--- a/lib/eal/linux/include/rte_os.h
+++ b/lib/eal/linux/include/rte_os.h
@@ -12,7 +12,8 @@
 
 #include <alloca.h>
 #include <sched.h>
-#include <sys/queue.h>
+
+#include <bsd_queue.h>
 
 /* These macros are compatible with system's sys/queue.h. */
 #define RTE_TAILQ_HEAD(name, type) TAILQ_HEAD(name, type)
diff --git a/lib/eal/windows/eal_alarm.c b/lib/eal/windows/eal_alarm.c
index 0b11d331dc..757d4efc4f 100644
--- a/lib/eal/windows/eal_alarm.c
+++ b/lib/eal/windows/eal_alarm.c
@@ -4,8 +4,8 @@
 
 #include <stdatomic.h>
 #include <stdbool.h>
-#include <sys/queue.h>
 
+#include <bsd_queue.h>
 #include <eal_export.h>
 #include <rte_alarm.h>
 #include <rte_spinlock.h>
-- 
2.47.2


  parent reply	other threads:[~2025-08-18 23:32 UTC|newest]

Thread overview: 48+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-18 23:27 [RFC 00/47] resolve issues with sys/queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 01/47] eal: add BSD version of queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 02/47] net/nfp: fix use after free Stephen Hemminger
2025-08-18 23:27 ` Stephen Hemminger [this message]
2025-08-18 23:27 ` [RFC 04/47] test: remove unnecessary inclusion of sys/queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 05/47] testpmd: use bsd_queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 06/47] dumpcap: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 07/47] proc-info: remove unnecessary sys/queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 08/47] doc: suggest bsd_queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 09/47] test-pipeline: remove unnecessary use of sys/queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 10/47] test-eventdev: use bsd_queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 11/47] test-bbdev, test-cmdline, test-mldev: don't use sys/queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 12/47] examples: replace use of sys/queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 13/47] hash: do not include sys/queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 14/47] lpm: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 15/47] log: replace use of sys/queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 16/47] ethdev: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 17/47] bpf: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 18/47] mempool: do not need sys/queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 19/47] lib: remove use of sys/queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 20/47] bus/fslmc: use rte_tailq.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 21/47] drivers/bus: replace use of sys/queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 22/47] net/qede: use bsd_queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 23/47] net/bnxt: remove use of sys/queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 24/47] net/intel: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 25/47] net/mlx5: remove unnecessary include " Stephen Hemminger
2025-08-18 23:27 ` [RFC 26/47] net/tap: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 27/47] net/axgbe: replace use " Stephen Hemminger
2025-08-18 23:27 ` [RFC 28/47] net/bnx2x: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 29/47] net/bonding: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 30/47] net/cxgbe: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 31/47] net/enic: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 32/47] net/failsafe: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 33/47] net/memif: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 34/47] net/mlx4: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 35/47] net/ngbe: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 36/47] net/ntnic: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 37/47] net/sfc: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 38/47] net/softnic: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 39/47] net/thunderx: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 40/47] net/txgbe: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 41/47] net/vdev_netvsc: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 42/47] net/vmxnet3: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 43/47] net/zxdh: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 44/47] net/dpaa2: " Stephen Hemminger
2025-08-18 23:27 ` [RFC 45/47] eal: remove no longer used windows version of queue.h Stephen Hemminger
2025-08-18 23:27 ` [RFC 46/47] net/mvpp2: replace local definition of FOREACH_SAFE Stephen Hemminger
2025-08-18 23:27 ` [RFC 47/47] drivers/raw: replace with TAILQ_FOREACH_SAFE Stephen Hemminger

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=20250818233102.180207-4-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=dmitry.kozliuk@gmail.com \
    --cc=hkalra@marvell.com \
    --cc=jerinj@marvell.com \
    --cc=roretzla@linux.microsoft.com \
    --cc=skori@marvell.com \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).