DPDK-dev Archive on lore.kernel.org
 help / color / mirror / Atom feed
* [PATCH 0/6] provide a complete set of BSD list macros
@ 2026-09-17 17:19 Stephen Hemminger
  2026-09-17 17:19 ` [PATCH 1/6] net/bnxt: fix use after free when freeing filters Stephen Hemminger
                   ` (6 more replies)
  0 siblings, 7 replies; 9+ messages in thread
From: Stephen Hemminger @ 2026-09-17 17:19 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger

DPDK uses the BSD <sys/queue.h> macros everywhere, but what you get
depends on the platform: FreeBSD has the full set, glibc has a subset,
musl and Windows have no such header.

The big gap is _FOREACH_SAFE, which glibc lacks. So it can't be used in
common code, and workarounds have spread: RTE_TAILQ_FOREACH_SAFE in
rte_tailq.h, plus ten files with private copies of LIST_, SLIST_,
STAILQ_ or TAILQ_FOREACH_SAFE. The RTE_TAILQ_*/RTE_STAILQ_* wrappers
exist only because Windows had no <sys/queue.h> to alias to.

Windows already carries a copy of the FreeBSD header. Move it to
lib/eal/include/rte_queue.h, use it on all platforms, and drop the
workarounds.

Patch 3 has to be one step. rte_queue.h deliberately uses the same
include guard as <sys/queue.h> so that the two suppress each other
instead of redefining macros. That means a single leftover include of
<sys/queue.h>, direct or via another header, turns rte_queue.h into a
no-op for that translation unit. Patch 6 adds a checkpatch test to keep
them from coming back.

Patch 1 is an unrelated use after free, found when the macros became
visible to the compiler and it reported -Wuse-after-free. Marked for
stable, independent of the rest.

Patch 5 converts the RTE_TAILQ_*/RTE_STAILQ_* wrappers to the plain
names but keeps them as deprecated aliases, scheduled for removal in
27.11: out of tree code on Windows had no alternative until now.

Stephen Hemminger (6):
  net/bnxt: fix use after free when freeing filters
  eal: add rte_queue.h with full set of list macros
  build: use rte_queue.h instead of sys/queue.h
  build: remove private FOREACH_SAFE definitions
  eal: deprecate RTE_TAILQ and RTE_STAILQ macro wrappers
  devtools: forbid direct use of sys/queue.h

 app/dumpcap/main.c                            |   2 +-
 app/proc-info/main.c                          |   2 +-
 app/test-bbdev/main.h                         |   2 +-
 app/test-cmdline/cmdline_test.c               |   2 +-
 app/test-eventdev/evt_test.c                  |   2 +-
 app/test-eventdev/evt_test.h                  |   2 +-
 app/test-mldev/ml_test.h                      |   2 +-
 app/test-pipeline/config.c                    |   2 +-
 app/test-pipeline/init.c                      |   2 +-
 app/test-pipeline/main.c                      |   2 +-
 app/test-pipeline/runtime.c                   |   2 +-
 app/test-pmd/5tswap.c                         |   2 +-
 app/test-pmd/cmdline.c                        |   2 +-
 app/test-pmd/config.c                         |   2 +-
 app/test-pmd/csumonly.c                       |   2 +-
 app/test-pmd/flowgen.c                        |   2 +-
 app/test-pmd/hairpin.c                        |   2 +-
 app/test-pmd/icmpecho.c                       |   2 +-
 app/test-pmd/iofwd.c                          |   2 +-
 app/test-pmd/macfwd.c                         |   2 +-
 app/test-pmd/macswap.c                        |   2 +-
 app/test-pmd/noisy_vnf.c                      |   2 +-
 app/test-pmd/parameters.c                     |   2 +-
 app/test-pmd/rxonly.c                         |   2 +-
 app/test-pmd/testpmd.c                        |   2 +-
 app/test-pmd/testpmd.h                        |   2 +-
 app/test-pmd/txonly.c                         |   2 +-
 app/test/commands.c                           |   2 +-
 app/test/test.c                               |   2 +-
 app/test/test.h                               |   2 +-
 app/test/test_atomic.c                        |   2 +-
 app/test/test_cmdline_lib.c                   |   2 +-
 app/test/test_func_reentrancy.c               |   2 +-
 app/test/test_hash.c                          |   2 +-
 app/test/test_hash_functions.c                |   2 +-
 app/test/test_link_bonding.c                  |   2 +-
 app/test/test_link_bonding_mode4.c            |   2 +-
 app/test/test_link_bonding_rssconf.c          |   2 +-
 app/test/test_logs.c                          |   2 +-
 app/test/test_malloc.c                        |   2 +-
 app/test/test_mbuf.c                          |   2 +-
 app/test/test_mcslock.c                       |   2 +-
 app/test/test_mempool.c                       |   2 +-
 app/test/test_mempool_perf.c                  |   2 +-
 app/test/test_memzone.c                       |   2 +-
 app/test/test_mp_secondary.c                  |   2 +-
 app/test/test_per_lcore.c                     |   2 +-
 app/test/test_pflock.c                        |   2 +-
 app/test/test_ring.c                          |   2 +-
 app/test/test_rwlock.c                        |   2 +-
 app/test/test_soring.c                        |   2 +-
 app/test/test_spinlock.c                      |   2 +-
 app/test/test_tailq.c                         |   2 +-
 app/test/test_ticketlock.c                    |   2 +-
 app/test/test_timer.c                         |   2 +-
 devtools/checkpatches.sh                      |   9 +
 doc/guides/contributing/coding_style.rst      |   5 +-
 doc/guides/rel_notes/deprecation.rst          |   8 +
 doc/guides/rel_notes/release_26_11.rst        |  15 ++
 drivers/bus/auxiliary/auxiliary_common.c      |   2 +-
 drivers/bus/auxiliary/private.h               |   2 +-
 drivers/bus/fslmc/bus_fslmc_driver.h          |   2 +-
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c      |   9 +-
 drivers/bus/ifpga/ifpga_bus.c                 |   2 +-
 drivers/bus/pci/bsd/pci.c                     |   2 +-
 drivers/bus/pci/pci_common.c                  |   2 +-
 drivers/bus/pci/pci_params.c                  |   2 +-
 drivers/bus/pci/windows/pci.c                 |   2 +-
 drivers/bus/pci/windows/pci_netuio.c          |   2 +-
 drivers/bus/platform/platform.c               |   2 +-
 drivers/bus/vdev/vdev.c                       |   4 +-
 drivers/bus/vmbus/vmbus_common.c              |   2 +-
 drivers/common/cnxk/roc_bphy_irq.c            |   1 -
 drivers/common/cnxk/roc_npc.h                 |   2 -
 drivers/common/cnxk/roc_platform.h            |   3 +-
 drivers/common/mlx5/mlx5_common_mr.h          |   2 +-
 drivers/common/sxe2/sxe2_osal.h               |   8 +-
 drivers/crypto/bcmfs/bcmfs_device.c           |   2 +-
 drivers/crypto/bcmfs/bcmfs_device.h           |   2 +-
 drivers/crypto/ccp/ccp_crypto.c               |   2 +-
 drivers/crypto/ccp/ccp_dev.c                  |   2 +-
 drivers/event/dlb2/dlb2_selftest.c            |   2 +-
 drivers/event/opdl/opdl_test.c                |   2 +-
 drivers/event/sw/sw_evdev_selftest.c          |   2 +-
 drivers/net/axgbe/axgbe_common.h              |   2 +-
 drivers/net/bnx2x/bnx2x_ethdev.h              |   2 +-
 drivers/net/bnxt/bnxt.h                       |   2 +-
 drivers/net/bnxt/bnxt_filter.c                |   9 +-
 drivers/net/bnxt/bnxt_flow.c                  |   2 +-
 drivers/net/bnxt/bnxt_vnic.h                  |   2 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c            |   4 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h            |   2 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c      |   2 +-
 drivers/net/bonding/eth_bond_private.h        |   2 +-
 drivers/net/bonding/rte_eth_bond_flow.c       |   4 +-
 drivers/net/cnxk/cnxk_eswitch_flow.c          |   2 +-
 drivers/net/cnxk/cnxk_ethdev.c                |   6 +-
 drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c  |   8 +-
 drivers/net/cxgbe/cxgbe_ethdev.c              |   2 +-
 drivers/net/cxgbe/cxgbe_main.c                |   2 +-
 drivers/net/cxgbe/sge.c                       |   2 +-
 drivers/net/dpaa2/dpaa2_flow.c                |   2 +-
 drivers/net/dpaa2/dpaa2_mux.c                 |   2 +-
 drivers/net/dpaa2/dpaa2_ptp.c                 |   2 +-
 drivers/net/enic/enic.h                       |   2 +-
 drivers/net/failsafe/failsafe_flow.c          |   4 +-
 drivers/net/failsafe/failsafe_private.h       |   2 +-
 drivers/net/intel/cpfl/cpfl_flow.c            |   8 +-
 drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c |   2 +-
 drivers/net/intel/e1000/e1000_ethdev.h        |   2 +-
 drivers/net/intel/e1000/em_ethdev.c           |   2 +-
 drivers/net/intel/e1000/em_rxtx.c             |   2 +-
 drivers/net/intel/e1000/igb_ethdev.c          |   2 +-
 drivers/net/intel/e1000/igb_flow.c            |   2 +-
 drivers/net/intel/e1000/igb_rxtx.c            |   2 +-
 drivers/net/intel/i40e/i40e_ethdev.c          |  10 +-
 drivers/net/intel/i40e/i40e_ethdev.h          |   2 +-
 drivers/net/intel/i40e/i40e_fdir.c            |   2 +-
 drivers/net/intel/i40e/i40e_flow.c            |   8 +-
 drivers/net/intel/i40e/i40e_hash.c            |   4 +-
 drivers/net/intel/i40e/i40e_pf.c              |   2 +-
 drivers/net/intel/i40e/i40e_rxtx.c            |   2 +-
 drivers/net/intel/i40e/rte_pmd_i40e.c         |   6 +-
 drivers/net/intel/iavf/iavf.h                 |   2 +-
 drivers/net/intel/iavf/iavf_ethdev.c          |   2 +-
 drivers/net/intel/iavf/iavf_fdir.c            |   2 +-
 drivers/net/intel/iavf/iavf_fsub.c            |   2 +-
 drivers/net/intel/iavf/iavf_generic_flow.c    |  18 +-
 drivers/net/intel/iavf/iavf_hash.c            |   2 +-
 drivers/net/intel/iavf/iavf_rxtx.c            |   2 +-
 drivers/net/intel/iavf/iavf_vchnl.c           |   8 +-
 drivers/net/intel/ice/base/ice_osdep.h        |   2 +-
 drivers/net/intel/ice/ice_acl_filter.c        |   2 +-
 drivers/net/intel/ice/ice_dcf.c               |   2 +-
 drivers/net/intel/ice/ice_dcf_ethdev.c        |   2 +-
 drivers/net/intel/ice/ice_ethdev.c            |   4 +-
 drivers/net/intel/ice/ice_generic_flow.c      |  10 +-
 drivers/net/intel/ice/ice_hash.c              |   2 +-
 drivers/net/intel/ice/ice_switch_filter.c     |   2 +-
 drivers/net/intel/idpf/base/idpf_osdep.h      |   9 +-
 drivers/net/intel/ipn3ke/ipn3ke_ethdev.h      |   2 +-
 drivers/net/intel/ipn3ke/ipn3ke_flow.c        |   4 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.c        |   2 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.h        |   2 +-
 drivers/net/intel/ixgbe/ixgbe_fdir.c          |   2 +-
 drivers/net/intel/ixgbe/ixgbe_flow.c          |   4 +-
 drivers/net/intel/ixgbe/ixgbe_rxtx.c          |   2 +-
 drivers/net/memif/memif_socket.h              |   2 +-
 drivers/net/memif/rte_eth_memif.h             |   2 +-
 drivers/net/mlx4/mlx4.h                       |   2 +-
 drivers/net/mlx4/mlx4_flow.c                  |   2 +-
 drivers/net/mlx4/mlx4_flow.h                  |   2 +-
 drivers/net/mlx4/mlx4_mr.h                    |   2 +-
 drivers/net/mlx4/mlx4_rxtx.h                  |   2 +-
 drivers/net/mlx5/hws/mlx5dr_internal.h        |   2 +-
 drivers/net/mlx5/linux/mlx5_verbs.c           |   2 +-
 drivers/net/mlx5/mlx5.h                       |   2 +-
 drivers/net/mlx5/mlx5_devx.c                  |   2 +-
 drivers/net/mlx5/mlx5_driver_event.c          |   2 +-
 drivers/net/mlx5/mlx5_flow.c                  |   2 +-
 drivers/net/mlx5/mlx5_flow.h                  |   2 +-
 drivers/net/mlx5/mlx5_flow_dv.c               |   4 +-
 drivers/net/mlx5/mlx5_flow_meter.c            |   2 +-
 drivers/net/mlx5/mlx5_flow_verbs.c            |   2 +-
 drivers/net/mlx5/mlx5_rx.h                    |   2 +-
 drivers/net/mlx5/mlx5_rxq.c                   |   2 +-
 drivers/net/mlx5/mlx5_rxtx.h                  |   2 +-
 drivers/net/mlx5/mlx5_tx.h                    |   2 +-
 drivers/net/nbl/nbl_common/nbl_userdev.c      |   4 +-
 drivers/net/netvsc/hn_ethdev.c                |   8 +-
 drivers/net/nfb/nfb_ethdev.c                  |   4 +-
 drivers/net/nfp/nfp_mtr.c                     |   8 +-
 drivers/net/ngbe/ngbe_ethdev_vf.c             |   2 +-
 drivers/net/ngbe/ngbe_rxtx.c                  |   2 +-
 drivers/net/ntnic/ntnic_ethdev.c              |   2 +-
 drivers/net/qede/qede_ethdev.h                |   2 +-
 drivers/net/qede/qede_filter.c                |   8 +-
 drivers/net/sfc/sfc_dp.c                      |   2 +-
 drivers/net/sfc/sfc_dp.h                      |   2 +-
 drivers/net/sfc/sfc_flow.c                    |   4 +-
 .../net/softnic/rte_eth_softnic_internals.h   |   2 +-
 drivers/net/softnic/rte_eth_softnic_swq.c     |   2 +-
 drivers/net/sxe2/sxe2_dump.c                  |   6 +-
 drivers/net/sxe2/sxe2_filter.c                |  22 +-
 drivers/net/sxe2/sxe2_flow.c                  |   2 +-
 drivers/net/sxe2/sxe2_vsi.c                   |   2 +-
 drivers/net/tap/rte_eth_tap.h                 |   2 +-
 drivers/net/tap/tap_flow.c                    |   2 +-
 drivers/net/thunderx/base/nicvf_bsvf.h        |   2 +-
 drivers/net/thunderx/nicvf_ethdev.c           |   2 +-
 drivers/net/txgbe/txgbe_ethdev_vf.c           |   2 +-
 drivers/net/txgbe/txgbe_fdir.c                |   2 +-
 drivers/net/txgbe/txgbe_flow.c                |   2 +-
 drivers/net/txgbe/txgbe_rxtx.c                |   2 +-
 drivers/net/vdev_netvsc/vdev_netvsc.c         |   2 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c          |   2 +-
 drivers/net/vmxnet3/vmxnet3_rxtx.c            |   2 +-
 drivers/net/zxdh/zxdh_flow.c                  |   4 +-
 drivers/net/zxdh/zxdh_flow.h                  |   2 +-
 drivers/net/zxdh/zxdh_mtr.c                   |   6 +-
 drivers/net/zxdh/zxdh_mtr.h                   |   2 +-
 drivers/raw/ifpga/base/opae_hw_api.h          |   2 +-
 drivers/raw/ifpga/base/opae_intel_max10.c     |   8 +-
 drivers/vdpa/mlx5/mlx5_vdpa.h                 |   2 +-
 drivers/vdpa/sfc/sfc_vdpa.c                   |   2 +-
 drivers/vdpa/sfc/sfc_vdpa.h                   |   2 +-
 examples/bbdev_app/main.c                     |   2 +-
 examples/bond/main.c                          |   2 +-
 examples/cmdline/main.c                       |   2 +-
 examples/cmdline/parse_obj_list.h             |   2 +-
 examples/flow_filtering/main.c                |   2 +-
 examples/helloworld/main.c                    |   2 +-
 examples/ip_fragmentation/main.c              |   2 +-
 examples/ip_pipeline/action.h                 |   2 +-
 examples/ip_pipeline/cryptodev.h              |   2 +-
 examples/ip_pipeline/link.h                   |   2 +-
 examples/ip_pipeline/mempool.h                |   2 +-
 examples/ip_pipeline/pipeline.h               |   2 +-
 examples/ip_pipeline/swq.h                    |   2 +-
 examples/ip_pipeline/tap.h                    |   2 +-
 examples/ip_pipeline/tmgr.h                   |   2 +-
 examples/ip_reassembly/main.c                 |   2 +-
 examples/ipsec-secgw/ipsec-secgw.c            |   2 +-
 examples/ipv4_multicast/main.c                |   2 +-
 examples/l2fwd-crypto/main.c                  |   2 +-
 examples/l2fwd-event/l2fwd_common.h           |   2 +-
 examples/l2fwd-keepalive/ka-agent/main.c      |   2 +-
 examples/l2fwd-keepalive/main.c               |   2 +-
 examples/l2fwd-macsec/main.c                  |   2 +-
 examples/l2fwd/main.c                         |   2 +-
 examples/l3fwd-graph/main.c                   |   2 +-
 examples/l3fwd-power/main.c                   |   2 +-
 examples/l3fwd/l3fwd_em.c                     |   2 +-
 examples/l3fwd/l3fwd_lpm.c                    |   2 +-
 examples/l3fwd/main.c                         |   2 +-
 examples/link_status_interrupt/main.c         |   2 +-
 .../client_server_mp/mp_client/client.c       |   2 +-
 .../client_server_mp/mp_server/init.c         |   2 +-
 .../client_server_mp/mp_server/main.c         |   2 +-
 examples/multi_process/hotplug_mp/main.c      |   2 +-
 examples/multi_process/simple_mp/main.c       |   2 +-
 examples/multi_process/symmetric_mp/main.c    |   2 +-
 examples/server_node_efd/efd_node/node.c      |   2 +-
 examples/server_node_efd/efd_server/init.c    |   2 +-
 examples/server_node_efd/efd_server/main.c    |   2 +-
 examples/service_cores/main.c                 |   2 +-
 examples/timer/main.c                         |   2 +-
 examples/vhost/main.h                         |   2 +-
 examples/vm_power_manager/channel_manager.c   |  10 +-
 examples/vm_power_manager/channel_monitor.c   |   2 +-
 examples/vm_power_manager/main.c              |   2 +-
 examples/vmdq/main.c                          |   2 +-
 examples/vmdq_dcb/main.c                      |   2 +-
 lib/acl/rte_acl_osdep.h                       |   2 +-
 lib/bbdev/rte_bbdev.c                         |   2 +-
 lib/bbdev/rte_bbdev.h                         |   2 +-
 lib/bpf/bpf_load_elf.c                        |   2 +-
 lib/bpf/bpf_pkt.c                             |   2 +-
 lib/bpf/bpf_validate_debug.c                  |   9 +-
 lib/cryptodev/cryptodev_pmd.c                 |   2 +-
 lib/cryptodev/cryptodev_pmd.h                 |   2 +-
 lib/cryptodev/rte_cryptodev.c                 |   2 +-
 lib/cryptodev/rte_cryptodev.h                 |   2 +-
 lib/distributor/rte_distributor.c             |   2 +-
 lib/distributor/rte_distributor_single.c      |   2 +-
 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_devargs.c           |   4 +-
 lib/eal/common/eal_common_options.c           |   4 +-
 lib/eal/common/eal_common_proc.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              |  14 +-
 lib/eal/include/bus_driver.h                  |   8 +-
 lib/eal/include/dev_driver.h                  |   4 +-
 lib/eal/include/meson.build                   |   1 +
 lib/eal/include/rte_class.h                   |   4 +-
 lib/eal/include/rte_devargs.h                 |   2 +-
 .../sys/queue.h => include/rte_queue.h}       | 235 ++++--------------
 lib/eal/include/rte_tailq.h                   |  35 ++-
 lib/eal/linux/eal_alarm.c                     |   2 +-
 lib/eal/linux/eal_interrupts.c                |   2 +-
 lib/eal/linux/include/rte_os.h                |  14 +-
 lib/eal/windows/eal_alarm.c                   |   2 +-
 lib/eal/windows/include/rte_os.h              |  31 +--
 lib/efd/rte_efd.c                             |   4 +-
 lib/ethdev/ethdev_private.h                   |   2 +-
 lib/ethdev/rte_ethdev.c                       |   2 +-
 lib/ethdev/rte_ethdev_core.h                  |   2 +-
 lib/eventdev/rte_event_vector_adapter.c       |   2 +-
 lib/fib/rte_fib.c                             |   2 +-
 lib/fib/rte_fib6.c                            |   2 +-
 lib/gpudev/gpudev.c                           |   6 +-
 lib/gpudev/gpudev_driver.h                    |   2 +-
 lib/graph/graph_private.h                     |   2 +-
 lib/hash/rte_cuckoo_hash.c                    |   2 +-
 lib/hash/rte_fbk_hash.c                       |   2 +-
 lib/hash/rte_thash.c                          |   2 +-
 lib/ip_frag/ip_frag_common.h                  |   2 +-
 lib/ip_frag/ip_reassembly.h                   |   4 +-
 lib/ip_frag/rte_ip_frag_common.c              |   2 +-
 lib/log/log.c                                 |   2 +-
 lib/lpm/rte_lpm.c                             |   2 +-
 lib/lpm/rte_lpm6.c                            |   2 +-
 lib/mbuf/rte_mbuf_dyn.c                       |   2 +-
 lib/mempool/rte_mempool.c                     |   6 +-
 lib/mempool/rte_mempool.h                     |   8 +-
 lib/pipeline/rte_swx_ctl.c                    |   2 +-
 lib/pipeline/rte_swx_pipeline_internal.h      |   2 +-
 lib/pmu/pmu.c                                 |   4 +-
 lib/power/power_cpufreq.h                     |   2 +-
 lib/power/power_uncore_ops.h                  |   2 +-
 lib/power/rte_power_cpufreq.c                 |   8 +-
 lib/power/rte_power_uncore.c                  |   6 +-
 lib/reorder/rte_reorder.c                     |   2 +-
 lib/rib/rte_rib.c                             |   2 +-
 lib/rib/rte_rib6.c                            |   2 +-
 lib/ring/rte_ring.c                           |   2 +-
 lib/stack/rte_stack.c                         |   2 +-
 lib/table/rte_swx_table.h                     |   4 +-
 lib/table/rte_swx_table_selector.h            |   4 +-
 lib/vhost/fd_man.h                            |   2 +-
 lib/vhost/iotlb.c                             |  14 +-
 lib/vhost/socket.c                            |   2 +-
 lib/vhost/vdpa.c                              |   4 +-
 lib/vhost/vdpa_driver.h                       |   2 +-
 lib/vhost/vhost.h                             |   2 +-
 336 files changed, 540 insertions(+), 725 deletions(-)
 rename lib/eal/{windows/include/sys/queue.h => include/rte_queue.h} (76%)

-- 
2.53.0


^ permalink raw reply	[flat|nested] 9+ messages in thread

* [PATCH 1/6] net/bnxt: fix use after free when freeing filters
  2026-09-17 17:19 [PATCH 0/6] provide a complete set of BSD list macros Stephen Hemminger
@ 2026-09-17 17:19 ` Stephen Hemminger
  2026-09-17 17:19 ` [PATCH 2/6] eal: add rte_queue.h with full set of list macros Stephen Hemminger
                   ` (5 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2026-09-17 17:19 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, stable, Kishore Padmanabha, Ajit Khaparde

bnxt_free_filter_mem() freed each filter and then passed the freed
pointer to STAILQ_REMOVE, which walks the list to unlink it.
STAILQ_FOREACH also read the next pointer out of the freed element.

Remove the entry from the list before freeing it, and use
STAILQ_FOREACH_SAFE so that the iteration does not depend on the
element that was just freed. glibc does not provide the _SAFE
variants, so define it locally the same way several other drivers
already do.

Found while moving the list macros into a DPDK header, where the
compiler could see them and report -Wuse-after-free. The fix does
not depend on that work.

Fixes: f11fd694a84a ("net/bnxt: free memory allocated for VF filters")
Cc: stable@dpdk.org

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/net/bnxt/bnxt_filter.c | 14 +++++++++++---
 1 file changed, 11 insertions(+), 3 deletions(-)

diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index 7b90ba651f..0225215dae 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -18,6 +18,13 @@
 #include "bnxt_vnic.h"
 #include "hsi_struct_def_dpdk.h"
 
+#ifndef STAILQ_FOREACH_SAFE
+#define	STAILQ_FOREACH_SAFE(var, head, field, tvar)			\
+	for ((var) = STAILQ_FIRST((head));				\
+	    (var) && ((tvar) = STAILQ_NEXT((var), field), 1);		\
+	    (var) = (tvar))
+#endif
+
 /*
  * Filter Functions
  */
@@ -110,7 +117,7 @@ void bnxt_free_all_filters(struct bnxt *bp)
 
 void bnxt_free_filter_mem(struct bnxt *bp)
 {
-	struct bnxt_filter_info *filter;
+	struct bnxt_filter_info *filter, *temp_filter;
 	uint16_t max_filters, i;
 	int rc = 0;
 
@@ -151,10 +158,11 @@ void bnxt_free_filter_mem(struct bnxt *bp)
 	bp->filter_info = NULL;
 
 	for (i = 0; i < bp->pf->max_vfs; i++) {
-		STAILQ_FOREACH(filter, &bp->pf->vf_info[i].filter, next) {
-			rte_free(filter);
+		STAILQ_FOREACH_SAFE(filter, &bp->pf->vf_info[i].filter, next,
+				    temp_filter) {
 			STAILQ_REMOVE(&bp->pf->vf_info[i].filter, filter,
 				      bnxt_filter_info, next);
+			rte_free(filter);
 		}
 	}
 }
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 2/6] eal: add rte_queue.h with full set of list macros
  2026-09-17 17:19 [PATCH 0/6] provide a complete set of BSD list macros Stephen Hemminger
  2026-09-17 17:19 ` [PATCH 1/6] net/bnxt: fix use after free when freeing filters Stephen Hemminger
@ 2026-09-17 17:19 ` Stephen Hemminger
  2026-09-17 17:19 ` [PATCH 3/6] build: use rte_queue.h instead of sys/queue.h Stephen Hemminger
                   ` (4 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2026-09-17 17:19 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Dmitry Kozlyuk

DPDK code uses the BSD <sys/queue.h> macros, but the available set
differs per platform. FreeBSD has the complete set, glibc provides only
a subset (notably none of the _FOREACH_SAFE variants), and musl has no
such header at all, nor does Windows.

The result is that the _SAFE variants cannot be used in common code.
RTE_TAILQ_FOREACH_SAFE was added to rte_tailq.h to work around this for
tail queues, and nine other files carry their own private copy of
LIST_FOREACH_SAFE, SLIST_FOREACH_SAFE or TAILQ_FOREACH_SAFE.

Windows already bundles a copy of the FreeBSD header for its own use.
Move it to lib/eal/include/rte_queue.h and use it on all platforms, so
that the same complete set of macros is available everywhere.

The FreeBSD queue macro debugging support (QUEUE_MACRO_DEBUG and the
_KERNEL INVARIANTS checks) is dropped: it is there to debug the list
macros themselves, which is not something DPDK does.

Leave a stub at the old Windows path that includes the new header, so
that the existing <sys/queue.h> includes keep building on Windows until
they are converted. It is removed in the next commit.

Define __containerof when the platform does not provide it (it is a
FreeBSD extension used by STAILQ_LAST, LIST_PREV, TAILQ_LAST_FAST and
TAILQ_PREV_FAST) and include <stddef.h> for offsetof and NULL, so that
the full set really is usable everywhere.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/rel_notes/release_26_11.rst |   7 +
 lib/eal/include/meson.build            |   1 +
 lib/eal/include/rte_queue.h            | 684 ++++++++++++++++++++
 lib/eal/windows/include/sys/queue.h    | 839 +------------------------
 4 files changed, 697 insertions(+), 834 deletions(-)
 create mode 100644 lib/eal/include/rte_queue.h

diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/rel_notes/release_26_11.rst
index 4b3e5d995c..0701fbee8d 100644
--- a/doc/guides/rel_notes/release_26_11.rst
+++ b/doc/guides/rel_notes/release_26_11.rst
@@ -55,6 +55,13 @@ New Features
      Also, make sure to start the actual text at the margin.
      =======================================================
 
+* **Added rte_queue.h with the full set of list macros.**
+
+  Added ``rte_queue.h``, providing the complete set of BSD queue(3) list
+  macros on all platforms, including the ``_FOREACH_SAFE`` variants which
+  are not available in the system header on Linux.
+  Use it instead of ``<sys/queue.h>``.
+
 
 Removed Items
 -------------
diff --git a/lib/eal/include/meson.build b/lib/eal/include/meson.build
index aef5824e5f..7752c1d766 100644
--- a/lib/eal/include/meson.build
+++ b/lib/eal/include/meson.build
@@ -38,6 +38,7 @@ headers += files(
         'rte_pci_dev_features.h',
         'rte_per_lcore.h',
         'rte_pflock.h',
+        'rte_queue.h',
         'rte_random.h',
         'rte_reciprocal.h',
         'rte_seqcount.h',
diff --git a/lib/eal/include/rte_queue.h b/lib/eal/include/rte_queue.h
new file mode 100644
index 0000000000..a847670470
--- /dev/null
+++ b/lib/eal/include/rte_queue.h
@@ -0,0 +1,684 @@
+/* SPDX-License-Identifier: BSD-3-Clause
+ *
+ * Copyright (c) 1991, 1993
+ *	The Regents of the University of California.  All rights reserved.
+ */
+
+/*
+ * This is a copy of the FreeBSD <sys/queue.h> used by DPDK on all platforms,
+ * so that the same set of macros is available everywhere. The system header
+ * cannot be used directly: glibc provides only a subset (notably no
+ * _FOREACH_SAFE), musl has no such header at all and on Alpine it comes from
+ * the bsd-compat-headers package, and Windows provides none either.
+ *
+ * Include <rte_queue.h> rather than <sys/queue.h>; direct use of the system
+ * header is rejected by devtools/checkpatches.sh.
+ *
+ * The multiple inclusion guard is intentionally the one used by the system
+ * header. If an application or third-party header pulls in <sys/queue.h> as
+ * well, the two suppress each other instead of defining the same macros
+ * twice. All these implementations share a common origin and the structure
+ * layouts are identical, so the list types are interchangeable either way.
+ *
+ * Which header wins does matter for the set of macros defined. If a system
+ * <sys/queue.h> is included first, this header expands to nothing and only
+ * the macros that platform provides are available: on glibc that means no
+ * _FOREACH_SAFE, _FOREACH_FROM or _SWAP. Conversely, when this header wins,
+ * the glibc-only CIRCLEQ_ and SIMPLEQ_ families are not defined.
+ *
+ * The FreeBSD QUEUE_MACRO_DEBUG and INVARIANTS facilities are omitted: they
+ * are there to debug the macros themselves, which is not something DPDK does.
+ */
+
+#ifndef _SYS_QUEUE_H_
+#define	_SYS_QUEUE_H_
+
+/*
+ * This file defines four types of data structures: singly-linked lists,
+ * singly-linked tail queues, lists and tail queues.
+ *
+ * A singly-linked list is headed by a single forward pointer. The elements
+ * are singly linked for minimum space and pointer manipulation overhead at
+ * the expense of O(n) removal for arbitrary elements. New elements can be
+ * added to the list after an existing element or at the head of the list.
+ * Elements being removed from the head of the list should use the explicit
+ * macro for this purpose for optimum efficiency. A singly-linked list may
+ * only be traversed in the forward direction.  Singly-linked lists are ideal
+ * for applications with large datasets and few or no removals or for
+ * implementing a LIFO queue.
+ *
+ * A singly-linked tail queue is headed by a pair of pointers, one to the
+ * head of the list and the other to the tail of the list. The elements are
+ * singly linked for minimum space and pointer manipulation overhead at the
+ * expense of O(n) removal for arbitrary elements. New elements can be added
+ * to the list after an existing element, at the head of the list, or at the
+ * end of the list. Elements being removed from the head of the tail queue
+ * should use the explicit macro for this purpose for optimum efficiency.
+ * A singly-linked tail queue may only be traversed in the forward direction.
+ * Singly-linked tail queues are ideal for applications with large datasets
+ * and few or no removals or for implementing a FIFO queue.
+ *
+ * A list is headed by a single forward pointer (or an array of forward
+ * pointers for a hash table header). The elements are doubly linked
+ * so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before
+ * or after an existing element or at the head of the list. A list
+ * may be traversed in either direction.
+ *
+ * A tail queue is headed by a pair of pointers, one to the head of the
+ * list and the other to the tail of the list. The elements are doubly
+ * linked so that an arbitrary element can be removed without a need to
+ * traverse the list. New elements can be added to the list before or
+ * after an existing element, at the head of the list, or at the end of
+ * the list. A tail queue may be traversed in either direction.
+ *
+ * For details on the use of these macros, see the queue(3) manual page.
+ *
+ * Below is a summary of implemented functions where:
+ *  +  means the macro is available
+ *  -  means the macro is not available
+ *  s  means the macro is available but is slow (runs in O(n) time)
+ *
+ *				SLIST	LIST	STAILQ	TAILQ
+ * _HEAD			+	+	+	+
+ * _CLASS_HEAD			+	+	+	+
+ * _HEAD_INITIALIZER		+	+	+	+
+ * _ENTRY			+	+	+	+
+ * _CLASS_ENTRY			+	+	+	+
+ * _INIT			+	+	+	+
+ * _EMPTY			+	+	+	+
+ * _FIRST			+	+	+	+
+ * _NEXT			+	+	+	+
+ * _PREV			-	+	-	+
+ * _LAST			-	-	+	+
+ * _LAST_FAST			-	-	-	+
+ * _FOREACH			+	+	+	+
+ * _FOREACH_FROM		+	+	+	+
+ * _FOREACH_SAFE		+	+	+	+
+ * _FOREACH_FROM_SAFE		+	+	+	+
+ * _FOREACH_REVERSE		-	-	-	+
+ * _FOREACH_REVERSE_FROM	-	-	-	+
+ * _FOREACH_REVERSE_SAFE	-	-	-	+
+ * _FOREACH_REVERSE_FROM_SAFE	-	-	-	+
+ * _INSERT_HEAD			+	+	+	+
+ * _INSERT_BEFORE		-	+	-	+
+ * _INSERT_AFTER		+	+	+	+
+ * _INSERT_TAIL			-	-	+	+
+ * _CONCAT			s	s	+	+
+ * _REMOVE_AFTER		+	-	+	-
+ * _REMOVE_HEAD			+	-	+	-
+ * _REMOVE			s	+	s	+
+ * _SWAP			+	+	+	+
+ */
+
+#include <stddef.h>
+
+/*
+ * FreeBSD provides __containerof in <sys/cdefs.h>, other platforms do not.
+ * Used by STAILQ_LAST, LIST_PREV, TAILQ_LAST_FAST and TAILQ_PREV_FAST.
+ */
+#ifndef __containerof
+#define	__containerof(ptr, type, member)				\
+	((type *)(void *)((char *)(ptr) - offsetof(type, member)))
+#endif
+
+#ifdef __cplusplus
+/*
+ * In C++ there can be structure lists and class lists:
+ */
+#define	QUEUE_TYPEOF(type) type
+#else
+#define	QUEUE_TYPEOF(type) struct type
+#endif
+
+/*
+ * Singly-linked List declarations.
+ */
+#define	SLIST_HEAD(name, type)						\
+struct name {								\
+	struct type *slh_first;	/* first element */			\
+}
+
+#define	SLIST_CLASS_HEAD(name, type)					\
+struct name {								\
+	class type *slh_first;	/* first element */			\
+}
+
+#define	SLIST_HEAD_INITIALIZER(head)					\
+	{ NULL }
+
+#define	SLIST_ENTRY(type)						\
+struct {								\
+	struct type *sle_next;	/* next element */			\
+}
+
+#define	SLIST_CLASS_ENTRY(type)						\
+struct {								\
+	class type *sle_next;		/* next element */		\
+}
+
+/*
+ * Singly-linked List functions.
+ */
+
+#define SLIST_CONCAT(head1, head2, type, field) do {			\
+	QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head1);		\
+	if (curelm == NULL) {						\
+		if ((SLIST_FIRST(head1) = SLIST_FIRST(head2)) != NULL)	\
+			SLIST_INIT(head2);				\
+	} else if (SLIST_FIRST(head2) != NULL) {			\
+		while (SLIST_NEXT(curelm, field) != NULL)		\
+			curelm = SLIST_NEXT(curelm, field);		\
+		SLIST_NEXT(curelm, field) = SLIST_FIRST(head2);		\
+		SLIST_INIT(head2);					\
+	}								\
+} while (0)
+
+#define	SLIST_EMPTY(head)	((head)->slh_first == NULL)
+
+#define	SLIST_FIRST(head)	((head)->slh_first)
+
+#define	SLIST_FOREACH(var, head, field)					\
+	for ((var) = SLIST_FIRST((head));				\
+	    (var);							\
+	    (var) = SLIST_NEXT((var), field))
+
+#define	SLIST_FOREACH_FROM(var, head, field)				\
+	for ((var) = ((var) ? (var) : SLIST_FIRST((head)));		\
+	    (var);							\
+	    (var) = SLIST_NEXT((var), field))
+
+#define	SLIST_FOREACH_SAFE(var, head, field, tvar)			\
+	for ((var) = SLIST_FIRST((head));				\
+	    (var) && ((tvar) = SLIST_NEXT((var), field), 1);		\
+	    (var) = (tvar))
+
+#define	SLIST_FOREACH_FROM_SAFE(var, head, field, tvar)			\
+	for ((var) = ((var) ? (var) : SLIST_FIRST((head)));		\
+	    (var) && ((tvar) = SLIST_NEXT((var), field), 1);		\
+	    (var) = (tvar))
+
+#define	SLIST_FOREACH_PREVPTR(var, varp, head, field)			\
+	for ((varp) = &SLIST_FIRST((head));				\
+	    ((var) = *(varp)) != NULL;					\
+	    (varp) = &SLIST_NEXT((var), field))
+
+#define	SLIST_INIT(head) do {						\
+	SLIST_FIRST((head)) = NULL;					\
+} while (0)
+
+#define	SLIST_INSERT_AFTER(slistelm, elm, field) do {			\
+	SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field);	\
+	SLIST_NEXT((slistelm), field) = (elm);				\
+} while (0)
+
+#define	SLIST_INSERT_HEAD(head, elm, field) do {			\
+	SLIST_NEXT((elm), field) = SLIST_FIRST((head));			\
+	SLIST_FIRST((head)) = (elm);					\
+} while (0)
+
+#define	SLIST_NEXT(elm, field)	((elm)->field.sle_next)
+
+#define	SLIST_REMOVE(head, elm, type, field) do {			\
+	if (SLIST_FIRST((head)) == (elm)) {				\
+		SLIST_REMOVE_HEAD((head), field);			\
+	}								\
+	else {								\
+		QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head);		\
+		while (SLIST_NEXT(curelm, field) != (elm))		\
+			curelm = SLIST_NEXT(curelm, field);		\
+		SLIST_REMOVE_AFTER(curelm, field);			\
+	}								\
+} while (0)
+
+#define SLIST_REMOVE_AFTER(elm, field) do {				\
+	SLIST_NEXT(elm, field) =					\
+	    SLIST_NEXT(SLIST_NEXT(elm, field), field);			\
+} while (0)
+
+#define	SLIST_REMOVE_HEAD(head, field) do {				\
+	SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field);	\
+} while (0)
+
+#define	SLIST_REMOVE_PREVPTR(prevp, elm, field) do {			\
+	*(prevp) = SLIST_NEXT(elm, field);				\
+} while (0)
+
+#define SLIST_SWAP(head1, head2, type) do {				\
+	QUEUE_TYPEOF(type) *swap_first = SLIST_FIRST(head1);		\
+	SLIST_FIRST(head1) = SLIST_FIRST(head2);			\
+	SLIST_FIRST(head2) = swap_first;				\
+} while (0)
+
+/*
+ * Singly-linked Tail queue declarations.
+ */
+#define	STAILQ_HEAD(name, type)						\
+struct name {								\
+	struct type *stqh_first;/* first element */			\
+	struct type **stqh_last;/* addr of last next element */		\
+}
+
+#define	STAILQ_CLASS_HEAD(name, type)					\
+struct name {								\
+	class type *stqh_first;	/* first element */			\
+	class type **stqh_last;	/* addr of last next element */		\
+}
+
+#define	STAILQ_HEAD_INITIALIZER(head)					\
+	{ NULL, &(head).stqh_first }
+
+#define	STAILQ_ENTRY(type)						\
+struct {								\
+	struct type *stqe_next;	/* next element */			\
+}
+
+#define	STAILQ_CLASS_ENTRY(type)					\
+struct {								\
+	class type *stqe_next;	/* next element */			\
+}
+
+/*
+ * Singly-linked Tail queue functions.
+ */
+#define	STAILQ_CONCAT(head1, head2) do {				\
+	if (!STAILQ_EMPTY((head2))) {					\
+		*(head1)->stqh_last = (head2)->stqh_first;		\
+		(head1)->stqh_last = (head2)->stqh_last;		\
+		STAILQ_INIT((head2));					\
+	}								\
+} while (0)
+
+#define	STAILQ_EMPTY(head)	((head)->stqh_first == NULL)
+
+#define	STAILQ_FIRST(head)	((head)->stqh_first)
+
+#define	STAILQ_FOREACH(var, head, field)				\
+	for((var) = STAILQ_FIRST((head));				\
+	   (var);							\
+	   (var) = STAILQ_NEXT((var), field))
+
+#define	STAILQ_FOREACH_FROM(var, head, field)				\
+	for ((var) = ((var) ? (var) : STAILQ_FIRST((head)));		\
+	   (var);							\
+	   (var) = STAILQ_NEXT((var), field))
+
+#define	STAILQ_FOREACH_SAFE(var, head, field, tvar)			\
+	for ((var) = STAILQ_FIRST((head));				\
+	    (var) && ((tvar) = STAILQ_NEXT((var), field), 1);		\
+	    (var) = (tvar))
+
+#define	STAILQ_FOREACH_FROM_SAFE(var, head, field, tvar)		\
+	for ((var) = ((var) ? (var) : STAILQ_FIRST((head)));		\
+	    (var) && ((tvar) = STAILQ_NEXT((var), field), 1);		\
+	    (var) = (tvar))
+
+#define	STAILQ_INIT(head) do {						\
+	STAILQ_FIRST((head)) = NULL;					\
+	(head)->stqh_last = &STAILQ_FIRST((head));			\
+} while (0)
+
+#define	STAILQ_INSERT_AFTER(head, tqelm, elm, field) do {		\
+	if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
+		(head)->stqh_last = &STAILQ_NEXT((elm), field);		\
+	STAILQ_NEXT((tqelm), field) = (elm);				\
+} while (0)
+
+#define	STAILQ_INSERT_HEAD(head, elm, field) do {			\
+	if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL)	\
+		(head)->stqh_last = &STAILQ_NEXT((elm), field);		\
+	STAILQ_FIRST((head)) = (elm);					\
+} while (0)
+
+#define	STAILQ_INSERT_TAIL(head, elm, field) do {			\
+	STAILQ_NEXT((elm), field) = NULL;				\
+	*(head)->stqh_last = (elm);					\
+	(head)->stqh_last = &STAILQ_NEXT((elm), field);			\
+} while (0)
+
+#define	STAILQ_LAST(head, type, field)				\
+	(STAILQ_EMPTY((head)) ? NULL :				\
+	    __containerof((head)->stqh_last,			\
+	    QUEUE_TYPEOF(type), field.stqe_next))
+
+#define	STAILQ_NEXT(elm, field)	((elm)->field.stqe_next)
+
+#define	STAILQ_REMOVE(head, elm, type, field) do {			\
+	if (STAILQ_FIRST((head)) == (elm)) {				\
+		STAILQ_REMOVE_HEAD((head), field);			\
+	}								\
+	else {								\
+		QUEUE_TYPEOF(type) *curelm = STAILQ_FIRST(head);	\
+		while (STAILQ_NEXT(curelm, field) != (elm))		\
+			curelm = STAILQ_NEXT(curelm, field);		\
+		STAILQ_REMOVE_AFTER(head, curelm, field);		\
+	}								\
+} while (0)
+
+#define STAILQ_REMOVE_AFTER(head, elm, field) do {			\
+	if ((STAILQ_NEXT(elm, field) =					\
+	     STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL)	\
+		(head)->stqh_last = &STAILQ_NEXT((elm), field);		\
+} while (0)
+
+#define	STAILQ_REMOVE_HEAD(head, field) do {				\
+	if ((STAILQ_FIRST((head)) =					\
+	     STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL)		\
+		(head)->stqh_last = &STAILQ_FIRST((head));		\
+} while (0)
+
+#define STAILQ_SWAP(head1, head2, type) do {				\
+	QUEUE_TYPEOF(type) *swap_first = STAILQ_FIRST(head1);		\
+	QUEUE_TYPEOF(type) **swap_last = (head1)->stqh_last;		\
+	STAILQ_FIRST(head1) = STAILQ_FIRST(head2);			\
+	(head1)->stqh_last = (head2)->stqh_last;			\
+	STAILQ_FIRST(head2) = swap_first;				\
+	(head2)->stqh_last = swap_last;					\
+	if (STAILQ_EMPTY(head1))					\
+		(head1)->stqh_last = &STAILQ_FIRST(head1);		\
+	if (STAILQ_EMPTY(head2))					\
+		(head2)->stqh_last = &STAILQ_FIRST(head2);		\
+} while (0)
+
+
+/*
+ * List declarations.
+ */
+#define	LIST_HEAD(name, type)						\
+struct name {								\
+	struct type *lh_first;	/* first element */			\
+}
+
+#define	LIST_CLASS_HEAD(name, type)					\
+struct name {								\
+	class type *lh_first;	/* first element */			\
+}
+
+#define	LIST_HEAD_INITIALIZER(head)					\
+	{ NULL }
+
+#define	LIST_ENTRY(type)						\
+struct {								\
+	struct type *le_next;	/* next element */			\
+	struct type **le_prev;	/* address of previous next element */	\
+}
+
+#define	LIST_CLASS_ENTRY(type)						\
+struct {								\
+	class type *le_next;	/* next element */			\
+	class type **le_prev;	/* address of previous next element */	\
+}
+
+/*
+ * List functions.
+ */
+
+
+#define LIST_CONCAT(head1, head2, type, field) do {			      \
+	QUEUE_TYPEOF(type) *curelm = LIST_FIRST(head1);			      \
+	if (curelm == NULL) {						      \
+		if ((LIST_FIRST(head1) = LIST_FIRST(head2)) != NULL) {	      \
+			LIST_FIRST(head2)->field.le_prev =		      \
+			    &LIST_FIRST((head1));			      \
+			LIST_INIT(head2);				      \
+		}							      \
+	} else if (LIST_FIRST(head2) != NULL) {				      \
+		while (LIST_NEXT(curelm, field) != NULL)		      \
+			curelm = LIST_NEXT(curelm, field);		      \
+		LIST_NEXT(curelm, field) = LIST_FIRST(head2);		      \
+		LIST_FIRST(head2)->field.le_prev = &LIST_NEXT(curelm, field); \
+		LIST_INIT(head2);					      \
+	}								      \
+} while (0)
+
+#define	LIST_EMPTY(head)	((head)->lh_first == NULL)
+
+#define	LIST_FIRST(head)	((head)->lh_first)
+
+#define	LIST_FOREACH(var, head, field)					\
+	for ((var) = LIST_FIRST((head));				\
+	    (var);							\
+	    (var) = LIST_NEXT((var), field))
+
+#define	LIST_FOREACH_FROM(var, head, field)				\
+	for ((var) = ((var) ? (var) : LIST_FIRST((head)));		\
+	    (var);							\
+	    (var) = LIST_NEXT((var), field))
+
+#define	LIST_FOREACH_SAFE(var, head, field, tvar)			\
+	for ((var) = LIST_FIRST((head));				\
+	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
+	    (var) = (tvar))
+
+#define	LIST_FOREACH_FROM_SAFE(var, head, field, tvar)			\
+	for ((var) = ((var) ? (var) : LIST_FIRST((head)));		\
+	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
+	    (var) = (tvar))
+
+#define	LIST_INIT(head) do {						\
+	LIST_FIRST((head)) = NULL;					\
+} while (0)
+
+#define	LIST_INSERT_AFTER(listelm, elm, field) do {			\
+	if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
+		LIST_NEXT((listelm), field)->field.le_prev =		\
+		    &LIST_NEXT((elm), field);				\
+	LIST_NEXT((listelm), field) = (elm);				\
+	(elm)->field.le_prev = &LIST_NEXT((listelm), field);		\
+} while (0)
+
+#define	LIST_INSERT_BEFORE(listelm, elm, field) do {			\
+	(elm)->field.le_prev = (listelm)->field.le_prev;		\
+	LIST_NEXT((elm), field) = (listelm);				\
+	*(listelm)->field.le_prev = (elm);				\
+	(listelm)->field.le_prev = &LIST_NEXT((elm), field);		\
+} while (0)
+
+#define	LIST_INSERT_HEAD(head, elm, field) do {				\
+	if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL)	\
+		LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
+	LIST_FIRST((head)) = (elm);					\
+	(elm)->field.le_prev = &LIST_FIRST((head));			\
+} while (0)
+
+#define	LIST_NEXT(elm, field)	((elm)->field.le_next)
+
+#define	LIST_PREV(elm, head, type, field)			\
+	((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL :	\
+	    __containerof((elm)->field.le_prev,			\
+	    QUEUE_TYPEOF(type), field.le_next))
+
+#define	LIST_REMOVE(elm, field) do {					\
+	if (LIST_NEXT((elm), field) != NULL)				\
+		LIST_NEXT((elm), field)->field.le_prev = 		\
+		    (elm)->field.le_prev;				\
+	*(elm)->field.le_prev = LIST_NEXT((elm), field);		\
+} while (0)
+
+#define LIST_SWAP(head1, head2, type, field) do {			\
+	QUEUE_TYPEOF(type) *swap_tmp = LIST_FIRST(head1);		\
+	LIST_FIRST((head1)) = LIST_FIRST((head2));			\
+	LIST_FIRST((head2)) = swap_tmp;					\
+	if ((swap_tmp = LIST_FIRST((head1))) != NULL)			\
+		swap_tmp->field.le_prev = &LIST_FIRST((head1));		\
+	if ((swap_tmp = LIST_FIRST((head2))) != NULL)			\
+		swap_tmp->field.le_prev = &LIST_FIRST((head2));		\
+} while (0)
+
+/*
+ * Tail queue declarations.
+ */
+#define	TAILQ_HEAD(name, type)						\
+struct name {								\
+	struct type *tqh_first;	/* first element */			\
+	struct type **tqh_last;	/* addr of last next element */		\
+}
+
+#define	TAILQ_CLASS_HEAD(name, type)					\
+struct name {								\
+	class type *tqh_first;	/* first element */			\
+	class type **tqh_last;	/* addr of last next element */		\
+}
+
+#define	TAILQ_HEAD_INITIALIZER(head)					\
+	{ NULL, &(head).tqh_first }
+
+#define	TAILQ_ENTRY(type)						\
+struct {								\
+	struct type *tqe_next;	/* next element */			\
+	struct type **tqe_prev;	/* address of previous next element */	\
+}
+
+#define	TAILQ_CLASS_ENTRY(type)						\
+struct {								\
+	class type *tqe_next;	/* next element */			\
+	class type **tqe_prev;	/* address of previous next element */	\
+}
+
+/*
+ * Tail queue functions.
+ */
+
+#define	TAILQ_CONCAT(head1, head2, field) do {				\
+	if (!TAILQ_EMPTY(head2)) {					\
+		*(head1)->tqh_last = (head2)->tqh_first;		\
+		(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;	\
+		(head1)->tqh_last = (head2)->tqh_last;			\
+		TAILQ_INIT((head2));					\
+	}								\
+} while (0)
+
+#define	TAILQ_EMPTY(head)	((head)->tqh_first == NULL)
+
+#define	TAILQ_FIRST(head)	((head)->tqh_first)
+
+#define	TAILQ_FOREACH(var, head, field)					\
+	for ((var) = TAILQ_FIRST((head));				\
+	    (var);							\
+	    (var) = TAILQ_NEXT((var), field))
+
+#define	TAILQ_FOREACH_FROM(var, head, field)				\
+	for ((var) = ((var) ? (var) : TAILQ_FIRST((head)));		\
+	    (var);							\
+	    (var) = TAILQ_NEXT((var), field))
+
+#define	TAILQ_FOREACH_SAFE(var, head, field, tvar)			\
+	for ((var) = TAILQ_FIRST((head));				\
+	    (var) && ((tvar) = TAILQ_NEXT((var), field), 1);		\
+	    (var) = (tvar))
+
+#define	TAILQ_FOREACH_FROM_SAFE(var, head, field, tvar)			\
+	for ((var) = ((var) ? (var) : TAILQ_FIRST((head)));		\
+	    (var) && ((tvar) = TAILQ_NEXT((var), field), 1);		\
+	    (var) = (tvar))
+
+#define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
+	for ((var) = TAILQ_LAST((head), headname);			\
+	    (var);							\
+	    (var) = TAILQ_PREV((var), headname, field))
+
+#define	TAILQ_FOREACH_REVERSE_FROM(var, head, headname, field)		\
+	for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname));	\
+	    (var);							\
+	    (var) = TAILQ_PREV((var), headname, field))
+
+#define	TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar)	\
+	for ((var) = TAILQ_LAST((head), headname);			\
+	    (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1);	\
+	    (var) = (tvar))
+
+#define	TAILQ_FOREACH_REVERSE_FROM_SAFE(var, head, headname, field, tvar) \
+	for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname));	\
+	    (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1);	\
+	    (var) = (tvar))
+
+#define	TAILQ_INIT(head) do {						\
+	TAILQ_FIRST((head)) = NULL;					\
+	(head)->tqh_last = &TAILQ_FIRST((head));			\
+} while (0)
+
+#define	TAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
+	if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
+		TAILQ_NEXT((elm), field)->field.tqe_prev = 		\
+		    &TAILQ_NEXT((elm), field);				\
+	else {								\
+		(head)->tqh_last = &TAILQ_NEXT((elm), field);		\
+	}								\
+	TAILQ_NEXT((listelm), field) = (elm);				\
+	(elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field);		\
+} while (0)
+
+#define	TAILQ_INSERT_BEFORE(listelm, elm, field) do {			\
+	(elm)->field.tqe_prev = (listelm)->field.tqe_prev;		\
+	TAILQ_NEXT((elm), field) = (listelm);				\
+	*(listelm)->field.tqe_prev = (elm);				\
+	(listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field);		\
+} while (0)
+
+#define	TAILQ_INSERT_HEAD(head, elm, field) do {			\
+	if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL)	\
+		TAILQ_FIRST((head))->field.tqe_prev =			\
+		    &TAILQ_NEXT((elm), field);				\
+	else								\
+		(head)->tqh_last = &TAILQ_NEXT((elm), field);		\
+	TAILQ_FIRST((head)) = (elm);					\
+	(elm)->field.tqe_prev = &TAILQ_FIRST((head));			\
+} while (0)
+
+#define	TAILQ_INSERT_TAIL(head, elm, field) do {			\
+	TAILQ_NEXT((elm), field) = NULL;				\
+	(elm)->field.tqe_prev = (head)->tqh_last;			\
+	*(head)->tqh_last = (elm);					\
+	(head)->tqh_last = &TAILQ_NEXT((elm), field);			\
+} while (0)
+
+#define	TAILQ_LAST(head, headname)					\
+	(*(((struct headname *)((head)->tqh_last))->tqh_last))
+
+/*
+ * The FAST function is fast in that it causes no data access other
+ * then the access to the head. The standard LAST function above
+ * will cause a data access of both the element you want and
+ * the previous element. FAST is very useful for instances when
+ * you may want to prefetch the last data element.
+ */
+#define	TAILQ_LAST_FAST(head, type, field)			\
+    (TAILQ_EMPTY(head) ? NULL : __containerof((head)->tqh_last, QUEUE_TYPEOF(type), field.tqe_next))
+
+#define	TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
+
+#define	TAILQ_PREV(elm, headname, field)				\
+	(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
+
+#define	TAILQ_PREV_FAST(elm, head, type, field)				\
+    ((elm)->field.tqe_prev == &(head)->tqh_first ? NULL :		\
+     __containerof((elm)->field.tqe_prev, QUEUE_TYPEOF(type), field.tqe_next))
+
+#define	TAILQ_REMOVE(head, elm, field) do {				\
+	if ((TAILQ_NEXT((elm), field)) != NULL)				\
+		TAILQ_NEXT((elm), field)->field.tqe_prev = 		\
+		    (elm)->field.tqe_prev;				\
+	else {								\
+		(head)->tqh_last = (elm)->field.tqe_prev;		\
+	}								\
+	*(elm)->field.tqe_prev = TAILQ_NEXT((elm), field);		\
+} while (0)
+
+#define TAILQ_SWAP(head1, head2, type, field) do {			\
+	QUEUE_TYPEOF(type) *swap_first = (head1)->tqh_first;		\
+	QUEUE_TYPEOF(type) **swap_last = (head1)->tqh_last;		\
+	(head1)->tqh_first = (head2)->tqh_first;			\
+	(head1)->tqh_last = (head2)->tqh_last;				\
+	(head2)->tqh_first = swap_first;				\
+	(head2)->tqh_last = swap_last;					\
+	if ((swap_first = (head1)->tqh_first) != NULL)			\
+		swap_first->field.tqe_prev = &(head1)->tqh_first;	\
+	else								\
+		(head1)->tqh_last = &(head1)->tqh_first;		\
+	if ((swap_first = (head2)->tqh_first) != NULL)			\
+		swap_first->field.tqe_prev = &(head2)->tqh_first;	\
+	else								\
+		(head2)->tqh_last = &(head2)->tqh_first;		\
+} while (0)
+
+#endif /* !_SYS_QUEUE_H_ */
diff --git a/lib/eal/windows/include/sys/queue.h b/lib/eal/windows/include/sys/queue.h
index 917526531b..0da00d46d7 100644
--- a/lib/eal/windows/include/sys/queue.h
+++ b/lib/eal/windows/include/sys/queue.h
@@ -1,840 +1,11 @@
 /* SPDX-License-Identifier: BSD-3-Clause
- *
- * Copyright (c) 1991, 1993
- *	The Regents of the University of California.  All rights reserved.
+ * Copyright(c) 2026 Stephen Hemminger
  */
 
-#ifndef _SYS_QUEUE_H_
-#define	_SYS_QUEUE_H_
-
-/*
- * This file defines four types of data structures: singly-linked lists,
- * singly-linked tail queues, lists and tail queues.
- *
- * A singly-linked list is headed by a single forward pointer. The elements
- * are singly linked for minimum space and pointer manipulation overhead at
- * the expense of O(n) removal for arbitrary elements. New elements can be
- * added to the list after an existing element or at the head of the list.
- * Elements being removed from the head of the list should use the explicit
- * macro for this purpose for optimum efficiency. A singly-linked list may
- * only be traversed in the forward direction.  Singly-linked lists are ideal
- * for applications with large datasets and few or no removals or for
- * implementing a LIFO queue.
- *
- * A singly-linked tail queue is headed by a pair of pointers, one to the
- * head of the list and the other to the tail of the list. The elements are
- * singly linked for minimum space and pointer manipulation overhead at the
- * expense of O(n) removal for arbitrary elements. New elements can be added
- * to the list after an existing element, at the head of the list, or at the
- * end of the list. Elements being removed from the head of the tail queue
- * should use the explicit macro for this purpose for optimum efficiency.
- * A singly-linked tail queue may only be traversed in the forward direction.
- * Singly-linked tail queues are ideal for applications with large datasets
- * and few or no removals or for implementing a FIFO queue.
- *
- * A list is headed by a single forward pointer (or an array of forward
- * pointers for a hash table header). The elements are doubly linked
- * so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before
- * or after an existing element or at the head of the list. A list
- * may be traversed in either direction.
- *
- * A tail queue is headed by a pair of pointers, one to the head of the
- * list and the other to the tail of the list. The elements are doubly
- * linked so that an arbitrary element can be removed without a need to
- * traverse the list. New elements can be added to the list before or
- * after an existing element, at the head of the list, or at the end of
- * the list. A tail queue may be traversed in either direction.
- *
- * For details on the use of these macros, see the queue(3) manual page.
- *
- * Below is a summary of implemented functions where:
- *  +  means the macro is available
- *  -  means the macro is not available
- *  s  means the macro is available but is slow (runs in O(n) time)
- *
- *				SLIST	LIST	STAILQ	TAILQ
- * _HEAD			+	+	+	+
- * _CLASS_HEAD			+	+	+	+
- * _HEAD_INITIALIZER		+	+	+	+
- * _ENTRY			+	+	+	+
- * _CLASS_ENTRY			+	+	+	+
- * _INIT			+	+	+	+
- * _EMPTY			+	+	+	+
- * _FIRST			+	+	+	+
- * _NEXT			+	+	+	+
- * _PREV			-	+	-	+
- * _LAST			-	-	+	+
- * _LAST_FAST			-	-	-	+
- * _FOREACH			+	+	+	+
- * _FOREACH_FROM		+	+	+	+
- * _FOREACH_SAFE		+	+	+	+
- * _FOREACH_FROM_SAFE		+	+	+	+
- * _FOREACH_REVERSE		-	-	-	+
- * _FOREACH_REVERSE_FROM	-	-	-	+
- * _FOREACH_REVERSE_SAFE	-	-	-	+
- * _FOREACH_REVERSE_FROM_SAFE	-	-	-	+
- * _INSERT_HEAD			+	+	+	+
- * _INSERT_BEFORE		-	+	-	+
- * _INSERT_AFTER		+	+	+	+
- * _INSERT_TAIL			-	-	+	+
- * _CONCAT			s	s	+	+
- * _REMOVE_AFTER		+	-	+	-
- * _REMOVE_HEAD			+	-	+	-
- * _REMOVE			s	+	s	+
- * _SWAP			+	+	+	+
- */
-#ifdef QUEUE_MACRO_DEBUG
-#warn Use QUEUE_MACRO_DEBUG_TRACE and/or QUEUE_MACRO_DEBUG_TRASH
-#define	QUEUE_MACRO_DEBUG_TRACE
-#define	QUEUE_MACRO_DEBUG_TRASH
-#endif
-
-#ifdef QUEUE_MACRO_DEBUG_TRACE
-/* Store the last 2 places the queue element or head was altered */
-struct qm_trace {
-	unsigned long	 lastline;
-	unsigned long	 prevline;
-	const char	*lastfile;
-	const char	*prevfile;
-};
-
-#define	TRACEBUF	struct qm_trace trace;
-#define	TRACEBUF_INITIALIZER	{ __LINE__, 0, __FILE__, NULL } ,
-
-#define	QMD_TRACE_HEAD(head) do {					\
-	(head)->trace.prevline = (head)->trace.lastline;		\
-	(head)->trace.prevfile = (head)->trace.lastfile;		\
-	(head)->trace.lastline = __LINE__;				\
-	(head)->trace.lastfile = __FILE__;				\
-} while (0)
-
-#define	QMD_TRACE_ELEM(elem) do {					\
-	(elem)->trace.prevline = (elem)->trace.lastline;		\
-	(elem)->trace.prevfile = (elem)->trace.lastfile;		\
-	(elem)->trace.lastline = __LINE__;				\
-	(elem)->trace.lastfile = __FILE__;				\
-} while (0)
-
-#else	/* !QUEUE_MACRO_DEBUG_TRACE */
-#define	QMD_TRACE_ELEM(elem)
-#define	QMD_TRACE_HEAD(head)
-#define	TRACEBUF
-#define	TRACEBUF_INITIALIZER
-#endif	/* QUEUE_MACRO_DEBUG_TRACE */
-
-#ifdef QUEUE_MACRO_DEBUG_TRASH
-#define	QMD_SAVELINK(name, link)	void **name = (void *)&(link)
-#define	TRASHIT(x)		do {(x) = (void *)-1;} while (0)
-#define	QMD_IS_TRASHED(x)	((x) == (void *)(intptr_t)-1)
-#else	/* !QUEUE_MACRO_DEBUG_TRASH */
-#define	QMD_SAVELINK(name, link)
-#define	TRASHIT(x)
-#define	QMD_IS_TRASHED(x)	0
-#endif	/* QUEUE_MACRO_DEBUG_TRASH */
-
-#ifdef __cplusplus
-/*
- * In C++ there can be structure lists and class lists:
- */
-#define	QUEUE_TYPEOF(type) type
-#else
-#define	QUEUE_TYPEOF(type) struct type
-#endif
-
-/*
- * Singly-linked List declarations.
- */
-#define	SLIST_HEAD(name, type)						\
-struct name {								\
-	struct type *slh_first;	/* first element */			\
-}
-
-#define	SLIST_CLASS_HEAD(name, type)					\
-struct name {								\
-	class type *slh_first;	/* first element */			\
-}
-
-#define	SLIST_HEAD_INITIALIZER(head)					\
-	{ NULL }
-
-#define	SLIST_ENTRY(type)						\
-struct {								\
-	struct type *sle_next;	/* next element */			\
-}
-
-#define	SLIST_CLASS_ENTRY(type)						\
-struct {								\
-	class type *sle_next;		/* next element */		\
-}
-
-/*
- * Singly-linked List functions.
- */
-#if (defined(_KERNEL) && defined(INVARIANTS))
-#define	QMD_SLIST_CHECK_PREVPTR(prevp, elm) do {			\
-	if (*(prevp) != (elm))						\
-		panic("Bad prevptr *(%p) == %p != %p",			\
-		    (prevp), *(prevp), (elm));				\
-} while (0)
-#else
-#define	QMD_SLIST_CHECK_PREVPTR(prevp, elm)
-#endif
-
-#define SLIST_CONCAT(head1, head2, type, field) do {			\
-	QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head1);		\
-	if (curelm == NULL) {						\
-		if ((SLIST_FIRST(head1) = SLIST_FIRST(head2)) != NULL)	\
-			SLIST_INIT(head2);				\
-	} else if (SLIST_FIRST(head2) != NULL) {			\
-		while (SLIST_NEXT(curelm, field) != NULL)		\
-			curelm = SLIST_NEXT(curelm, field);		\
-		SLIST_NEXT(curelm, field) = SLIST_FIRST(head2);		\
-		SLIST_INIT(head2);					\
-	}								\
-} while (0)
-
-#define	SLIST_EMPTY(head)	((head)->slh_first == NULL)
-
-#define	SLIST_FIRST(head)	((head)->slh_first)
-
-#define	SLIST_FOREACH(var, head, field)					\
-	for ((var) = SLIST_FIRST((head));				\
-	    (var);							\
-	    (var) = SLIST_NEXT((var), field))
-
-#define	SLIST_FOREACH_FROM(var, head, field)				\
-	for ((var) = ((var) ? (var) : SLIST_FIRST((head)));		\
-	    (var);							\
-	    (var) = SLIST_NEXT((var), field))
-
-#define	SLIST_FOREACH_SAFE(var, head, field, tvar)			\
-	for ((var) = SLIST_FIRST((head));				\
-	    (var) && ((tvar) = SLIST_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-
-#define	SLIST_FOREACH_FROM_SAFE(var, head, field, tvar)			\
-	for ((var) = ((var) ? (var) : SLIST_FIRST((head)));		\
-	    (var) && ((tvar) = SLIST_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-
-#define	SLIST_FOREACH_PREVPTR(var, varp, head, field)			\
-	for ((varp) = &SLIST_FIRST((head));				\
-	    ((var) = *(varp)) != NULL;					\
-	    (varp) = &SLIST_NEXT((var), field))
-
-#define	SLIST_INIT(head) do {						\
-	SLIST_FIRST((head)) = NULL;					\
-} while (0)
-
-#define	SLIST_INSERT_AFTER(slistelm, elm, field) do {			\
-	SLIST_NEXT((elm), field) = SLIST_NEXT((slistelm), field);	\
-	SLIST_NEXT((slistelm), field) = (elm);				\
-} while (0)
-
-#define	SLIST_INSERT_HEAD(head, elm, field) do {			\
-	SLIST_NEXT((elm), field) = SLIST_FIRST((head));			\
-	SLIST_FIRST((head)) = (elm);					\
-} while (0)
-
-#define	SLIST_NEXT(elm, field)	((elm)->field.sle_next)
-
-#define	SLIST_REMOVE(head, elm, type, field) do {			\
-	QMD_SAVELINK(oldnext, (elm)->field.sle_next);			\
-	if (SLIST_FIRST((head)) == (elm)) {				\
-		SLIST_REMOVE_HEAD((head), field);			\
-	}								\
-	else {								\
-		QUEUE_TYPEOF(type) *curelm = SLIST_FIRST(head);		\
-		while (SLIST_NEXT(curelm, field) != (elm))		\
-			curelm = SLIST_NEXT(curelm, field);		\
-		SLIST_REMOVE_AFTER(curelm, field);			\
-	}								\
-	TRASHIT(*oldnext);						\
-} while (0)
-
-#define SLIST_REMOVE_AFTER(elm, field) do {				\
-	SLIST_NEXT(elm, field) =					\
-	    SLIST_NEXT(SLIST_NEXT(elm, field), field);			\
-} while (0)
-
-#define	SLIST_REMOVE_HEAD(head, field) do {				\
-	SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field);	\
-} while (0)
-
-#define	SLIST_REMOVE_PREVPTR(prevp, elm, field) do {			\
-	QMD_SLIST_CHECK_PREVPTR(prevp, elm);				\
-	*(prevp) = SLIST_NEXT(elm, field);				\
-	TRASHIT((elm)->field.sle_next);					\
-} while (0)
-
-#define SLIST_SWAP(head1, head2, type) do {				\
-	QUEUE_TYPEOF(type) *swap_first = SLIST_FIRST(head1);		\
-	SLIST_FIRST(head1) = SLIST_FIRST(head2);			\
-	SLIST_FIRST(head2) = swap_first;				\
-} while (0)
-
-/*
- * Singly-linked Tail queue declarations.
- */
-#define	STAILQ_HEAD(name, type)						\
-struct name {								\
-	struct type *stqh_first;/* first element */			\
-	struct type **stqh_last;/* addr of last next element */		\
-}
-
-#define	STAILQ_CLASS_HEAD(name, type)					\
-struct name {								\
-	class type *stqh_first;	/* first element */			\
-	class type **stqh_last;	/* addr of last next element */		\
-}
-
-#define	STAILQ_HEAD_INITIALIZER(head)					\
-	{ NULL, &(head).stqh_first }
-
-#define	STAILQ_ENTRY(type)						\
-struct {								\
-	struct type *stqe_next;	/* next element */			\
-}
-
-#define	STAILQ_CLASS_ENTRY(type)					\
-struct {								\
-	class type *stqe_next;	/* next element */			\
-}
-
-/*
- * Singly-linked Tail queue functions.
- */
-#define	STAILQ_CONCAT(head1, head2) do {				\
-	if (!STAILQ_EMPTY((head2))) {					\
-		*(head1)->stqh_last = (head2)->stqh_first;		\
-		(head1)->stqh_last = (head2)->stqh_last;		\
-		STAILQ_INIT((head2));					\
-	}								\
-} while (0)
-
-#define	STAILQ_EMPTY(head)	((head)->stqh_first == NULL)
-
-#define	STAILQ_FIRST(head)	((head)->stqh_first)
-
-#define	STAILQ_FOREACH(var, head, field)				\
-	for((var) = STAILQ_FIRST((head));				\
-	   (var);							\
-	   (var) = STAILQ_NEXT((var), field))
-
-#define	STAILQ_FOREACH_FROM(var, head, field)				\
-	for ((var) = ((var) ? (var) : STAILQ_FIRST((head)));		\
-	   (var);							\
-	   (var) = STAILQ_NEXT((var), field))
-
-#define	STAILQ_FOREACH_SAFE(var, head, field, tvar)			\
-	for ((var) = STAILQ_FIRST((head));				\
-	    (var) && ((tvar) = STAILQ_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-
-#define	STAILQ_FOREACH_FROM_SAFE(var, head, field, tvar)		\
-	for ((var) = ((var) ? (var) : STAILQ_FIRST((head)));		\
-	    (var) && ((tvar) = STAILQ_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-
-#define	STAILQ_INIT(head) do {						\
-	STAILQ_FIRST((head)) = NULL;					\
-	(head)->stqh_last = &STAILQ_FIRST((head));			\
-} while (0)
-
-#define	STAILQ_INSERT_AFTER(head, tqelm, elm, field) do {		\
-	if ((STAILQ_NEXT((elm), field) = STAILQ_NEXT((tqelm), field)) == NULL)\
-		(head)->stqh_last = &STAILQ_NEXT((elm), field);		\
-	STAILQ_NEXT((tqelm), field) = (elm);				\
-} while (0)
-
-#define	STAILQ_INSERT_HEAD(head, elm, field) do {			\
-	if ((STAILQ_NEXT((elm), field) = STAILQ_FIRST((head))) == NULL)	\
-		(head)->stqh_last = &STAILQ_NEXT((elm), field);		\
-	STAILQ_FIRST((head)) = (elm);					\
-} while (0)
-
-#define	STAILQ_INSERT_TAIL(head, elm, field) do {			\
-	STAILQ_NEXT((elm), field) = NULL;				\
-	*(head)->stqh_last = (elm);					\
-	(head)->stqh_last = &STAILQ_NEXT((elm), field);			\
-} while (0)
-
-#define	STAILQ_LAST(head, type, field)				\
-	(STAILQ_EMPTY((head)) ? NULL :				\
-	    __containerof((head)->stqh_last,			\
-	    QUEUE_TYPEOF(type), field.stqe_next))
-
-#define	STAILQ_NEXT(elm, field)	((elm)->field.stqe_next)
-
-#define	STAILQ_REMOVE(head, elm, type, field) do {			\
-	QMD_SAVELINK(oldnext, (elm)->field.stqe_next);			\
-	if (STAILQ_FIRST((head)) == (elm)) {				\
-		STAILQ_REMOVE_HEAD((head), field);			\
-	}								\
-	else {								\
-		QUEUE_TYPEOF(type) *curelm = STAILQ_FIRST(head);	\
-		while (STAILQ_NEXT(curelm, field) != (elm))		\
-			curelm = STAILQ_NEXT(curelm, field);		\
-		STAILQ_REMOVE_AFTER(head, curelm, field);		\
-	}								\
-	TRASHIT(*oldnext);						\
-} while (0)
-
-#define STAILQ_REMOVE_AFTER(head, elm, field) do {			\
-	if ((STAILQ_NEXT(elm, field) =					\
-	     STAILQ_NEXT(STAILQ_NEXT(elm, field), field)) == NULL)	\
-		(head)->stqh_last = &STAILQ_NEXT((elm), field);		\
-} while (0)
-
-#define	STAILQ_REMOVE_HEAD(head, field) do {				\
-	if ((STAILQ_FIRST((head)) =					\
-	     STAILQ_NEXT(STAILQ_FIRST((head)), field)) == NULL)		\
-		(head)->stqh_last = &STAILQ_FIRST((head));		\
-} while (0)
-
-#define STAILQ_SWAP(head1, head2, type) do {				\
-	QUEUE_TYPEOF(type) *swap_first = STAILQ_FIRST(head1);		\
-	QUEUE_TYPEOF(type) **swap_last = (head1)->stqh_last;		\
-	STAILQ_FIRST(head1) = STAILQ_FIRST(head2);			\
-	(head1)->stqh_last = (head2)->stqh_last;			\
-	STAILQ_FIRST(head2) = swap_first;				\
-	(head2)->stqh_last = swap_last;					\
-	if (STAILQ_EMPTY(head1))					\
-		(head1)->stqh_last = &STAILQ_FIRST(head1);		\
-	if (STAILQ_EMPTY(head2))					\
-		(head2)->stqh_last = &STAILQ_FIRST(head2);		\
-} while (0)
-
-
-/*
- * List declarations.
- */
-#define	LIST_HEAD(name, type)						\
-struct name {								\
-	struct type *lh_first;	/* first element */			\
-}
-
-#define	LIST_CLASS_HEAD(name, type)					\
-struct name {								\
-	class type *lh_first;	/* first element */			\
-}
-
-#define	LIST_HEAD_INITIALIZER(head)					\
-	{ NULL }
-
-#define	LIST_ENTRY(type)						\
-struct {								\
-	struct type *le_next;	/* next element */			\
-	struct type **le_prev;	/* address of previous next element */	\
-}
-
-#define	LIST_CLASS_ENTRY(type)						\
-struct {								\
-	class type *le_next;	/* next element */			\
-	class type **le_prev;	/* address of previous next element */	\
-}
-
-/*
- * List functions.
- */
-
-#if (defined(_KERNEL) && defined(INVARIANTS))
-/*
- * QMD_LIST_CHECK_HEAD(LIST_HEAD *head, LIST_ENTRY NAME)
- *
- * If the list is non-empty, validates that the first element of the list
- * points back at 'head.'
- */
-#define	QMD_LIST_CHECK_HEAD(head, field) do {				\
-	if (LIST_FIRST((head)) != NULL &&				\
-	    LIST_FIRST((head))->field.le_prev !=			\
-	     &LIST_FIRST((head)))					\
-		panic("Bad list head %p first->prev != head", (head));	\
-} while (0)
-
-/*
- * QMD_LIST_CHECK_NEXT(TYPE *elm, LIST_ENTRY NAME)
- *
- * If an element follows 'elm' in the list, validates that the next element
- * points back at 'elm.'
- */
-#define	QMD_LIST_CHECK_NEXT(elm, field) do {				\
-	if (LIST_NEXT((elm), field) != NULL &&				\
-	    LIST_NEXT((elm), field)->field.le_prev !=			\
-	     &((elm)->field.le_next))					\
-	     	panic("Bad link elm %p next->prev != elm", (elm));	\
-} while (0)
-
-/*
- * QMD_LIST_CHECK_PREV(TYPE *elm, LIST_ENTRY NAME)
- *
- * Validates that the previous element (or head of the list) points to 'elm.'
- */
-#define	QMD_LIST_CHECK_PREV(elm, field) do {				\
-	if (*(elm)->field.le_prev != (elm))				\
-		panic("Bad link elm %p prev->next != elm", (elm));	\
-} while (0)
-#else
-#define	QMD_LIST_CHECK_HEAD(head, field)
-#define	QMD_LIST_CHECK_NEXT(elm, field)
-#define	QMD_LIST_CHECK_PREV(elm, field)
-#endif /* (_KERNEL && INVARIANTS) */
-
-#define LIST_CONCAT(head1, head2, type, field) do {			      \
-	QUEUE_TYPEOF(type) *curelm = LIST_FIRST(head1);			      \
-	if (curelm == NULL) {						      \
-		if ((LIST_FIRST(head1) = LIST_FIRST(head2)) != NULL) {	      \
-			LIST_FIRST(head2)->field.le_prev =		      \
-			    &LIST_FIRST((head1));			      \
-			LIST_INIT(head2);				      \
-		}							      \
-	} else if (LIST_FIRST(head2) != NULL) {				      \
-		while (LIST_NEXT(curelm, field) != NULL)		      \
-			curelm = LIST_NEXT(curelm, field);		      \
-		LIST_NEXT(curelm, field) = LIST_FIRST(head2);		      \
-		LIST_FIRST(head2)->field.le_prev = &LIST_NEXT(curelm, field); \
-		LIST_INIT(head2);					      \
-	}								      \
-} while (0)
-
-#define	LIST_EMPTY(head)	((head)->lh_first == NULL)
-
-#define	LIST_FIRST(head)	((head)->lh_first)
-
-#define	LIST_FOREACH(var, head, field)					\
-	for ((var) = LIST_FIRST((head));				\
-	    (var);							\
-	    (var) = LIST_NEXT((var), field))
-
-#define	LIST_FOREACH_FROM(var, head, field)				\
-	for ((var) = ((var) ? (var) : LIST_FIRST((head)));		\
-	    (var);							\
-	    (var) = LIST_NEXT((var), field))
-
-#define	LIST_FOREACH_SAFE(var, head, field, tvar)			\
-	for ((var) = LIST_FIRST((head));				\
-	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-
-#define	LIST_FOREACH_FROM_SAFE(var, head, field, tvar)			\
-	for ((var) = ((var) ? (var) : LIST_FIRST((head)));		\
-	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-
-#define	LIST_INIT(head) do {						\
-	LIST_FIRST((head)) = NULL;					\
-} while (0)
-
-#define	LIST_INSERT_AFTER(listelm, elm, field) do {			\
-	QMD_LIST_CHECK_NEXT(listelm, field);				\
-	if ((LIST_NEXT((elm), field) = LIST_NEXT((listelm), field)) != NULL)\
-		LIST_NEXT((listelm), field)->field.le_prev =		\
-		    &LIST_NEXT((elm), field);				\
-	LIST_NEXT((listelm), field) = (elm);				\
-	(elm)->field.le_prev = &LIST_NEXT((listelm), field);		\
-} while (0)
-
-#define	LIST_INSERT_BEFORE(listelm, elm, field) do {			\
-	QMD_LIST_CHECK_PREV(listelm, field);				\
-	(elm)->field.le_prev = (listelm)->field.le_prev;		\
-	LIST_NEXT((elm), field) = (listelm);				\
-	*(listelm)->field.le_prev = (elm);				\
-	(listelm)->field.le_prev = &LIST_NEXT((elm), field);		\
-} while (0)
-
-#define	LIST_INSERT_HEAD(head, elm, field) do {				\
-	QMD_LIST_CHECK_HEAD((head), field);				\
-	if ((LIST_NEXT((elm), field) = LIST_FIRST((head))) != NULL)	\
-		LIST_FIRST((head))->field.le_prev = &LIST_NEXT((elm), field);\
-	LIST_FIRST((head)) = (elm);					\
-	(elm)->field.le_prev = &LIST_FIRST((head));			\
-} while (0)
-
-#define	LIST_NEXT(elm, field)	((elm)->field.le_next)
-
-#define	LIST_PREV(elm, head, type, field)			\
-	((elm)->field.le_prev == &LIST_FIRST((head)) ? NULL :	\
-	    __containerof((elm)->field.le_prev,			\
-	    QUEUE_TYPEOF(type), field.le_next))
-
-#define	LIST_REMOVE(elm, field) do {					\
-	QMD_SAVELINK(oldnext, (elm)->field.le_next);			\
-	QMD_SAVELINK(oldprev, (elm)->field.le_prev);			\
-	QMD_LIST_CHECK_NEXT(elm, field);				\
-	QMD_LIST_CHECK_PREV(elm, field);				\
-	if (LIST_NEXT((elm), field) != NULL)				\
-		LIST_NEXT((elm), field)->field.le_prev = 		\
-		    (elm)->field.le_prev;				\
-	*(elm)->field.le_prev = LIST_NEXT((elm), field);		\
-	TRASHIT(*oldnext);						\
-	TRASHIT(*oldprev);						\
-} while (0)
-
-#define LIST_SWAP(head1, head2, type, field) do {			\
-	QUEUE_TYPEOF(type) *swap_tmp = LIST_FIRST(head1);		\
-	LIST_FIRST((head1)) = LIST_FIRST((head2));			\
-	LIST_FIRST((head2)) = swap_tmp;					\
-	if ((swap_tmp = LIST_FIRST((head1))) != NULL)			\
-		swap_tmp->field.le_prev = &LIST_FIRST((head1));		\
-	if ((swap_tmp = LIST_FIRST((head2))) != NULL)			\
-		swap_tmp->field.le_prev = &LIST_FIRST((head2));		\
-} while (0)
-
-/*
- * Tail queue declarations.
- */
-#define	TAILQ_HEAD(name, type)						\
-struct name {								\
-	struct type *tqh_first;	/* first element */			\
-	struct type **tqh_last;	/* addr of last next element */		\
-	TRACEBUF							\
-}
-
-#define	TAILQ_CLASS_HEAD(name, type)					\
-struct name {								\
-	class type *tqh_first;	/* first element */			\
-	class type **tqh_last;	/* addr of last next element */		\
-	TRACEBUF							\
-}
-
-#define	TAILQ_HEAD_INITIALIZER(head)					\
-	{ NULL, &(head).tqh_first, TRACEBUF_INITIALIZER }
-
-#define	TAILQ_ENTRY(type)						\
-struct {								\
-	struct type *tqe_next;	/* next element */			\
-	struct type **tqe_prev;	/* address of previous next element */	\
-	TRACEBUF							\
-}
-
-#define	TAILQ_CLASS_ENTRY(type)						\
-struct {								\
-	class type *tqe_next;	/* next element */			\
-	class type **tqe_prev;	/* address of previous next element */	\
-	TRACEBUF							\
-}
-
 /*
- * Tail queue functions.
+ * Windows has no system <sys/queue.h>. The bundled copy has moved to
+ * <rte_queue.h>; this stub keeps the existing includes working until they
+ * are converted, and is removed in the following commit.
  */
-#if (defined(_KERNEL) && defined(INVARIANTS))
-/*
- * QMD_TAILQ_CHECK_HEAD(TAILQ_HEAD *head, TAILQ_ENTRY NAME)
- *
- * If the tailq is non-empty, validates that the first element of the tailq
- * points back at 'head.'
- */
-#define	QMD_TAILQ_CHECK_HEAD(head, field) do {				\
-	if (!TAILQ_EMPTY(head) &&					\
-	    TAILQ_FIRST((head))->field.tqe_prev !=			\
-	     &TAILQ_FIRST((head)))					\
-		panic("Bad tailq head %p first->prev != head", (head));	\
-} while (0)
-
-/*
- * QMD_TAILQ_CHECK_TAIL(TAILQ_HEAD *head, TAILQ_ENTRY NAME)
- *
- * Validates that the tail of the tailq is a pointer to pointer to NULL.
- */
-#define	QMD_TAILQ_CHECK_TAIL(head, field) do {				\
-	if (*(head)->tqh_last != NULL)					\
-	    	panic("Bad tailq NEXT(%p->tqh_last) != NULL", (head)); 	\
-} while (0)
-
-/*
- * QMD_TAILQ_CHECK_NEXT(TYPE *elm, TAILQ_ENTRY NAME)
- *
- * If an element follows 'elm' in the tailq, validates that the next element
- * points back at 'elm.'
- */
-#define	QMD_TAILQ_CHECK_NEXT(elm, field) do {				\
-	if (TAILQ_NEXT((elm), field) != NULL &&				\
-	    TAILQ_NEXT((elm), field)->field.tqe_prev !=			\
-	     &((elm)->field.tqe_next))					\
-		panic("Bad link elm %p next->prev != elm", (elm));	\
-} while (0)
-
-/*
- * QMD_TAILQ_CHECK_PREV(TYPE *elm, TAILQ_ENTRY NAME)
- *
- * Validates that the previous element (or head of the tailq) points to 'elm.'
- */
-#define	QMD_TAILQ_CHECK_PREV(elm, field) do {				\
-	if (*(elm)->field.tqe_prev != (elm))				\
-		panic("Bad link elm %p prev->next != elm", (elm));	\
-} while (0)
-#else
-#define	QMD_TAILQ_CHECK_HEAD(head, field)
-#define	QMD_TAILQ_CHECK_TAIL(head, headname)
-#define	QMD_TAILQ_CHECK_NEXT(elm, field)
-#define	QMD_TAILQ_CHECK_PREV(elm, field)
-#endif /* (_KERNEL && INVARIANTS) */
-
-#define	TAILQ_CONCAT(head1, head2, field) do {				\
-	if (!TAILQ_EMPTY(head2)) {					\
-		*(head1)->tqh_last = (head2)->tqh_first;		\
-		(head2)->tqh_first->field.tqe_prev = (head1)->tqh_last;	\
-		(head1)->tqh_last = (head2)->tqh_last;			\
-		TAILQ_INIT((head2));					\
-		QMD_TRACE_HEAD(head1);					\
-		QMD_TRACE_HEAD(head2);					\
-	}								\
-} while (0)
-
-#define	TAILQ_EMPTY(head)	((head)->tqh_first == NULL)
-
-#define	TAILQ_FIRST(head)	((head)->tqh_first)
-
-#define	TAILQ_FOREACH(var, head, field)					\
-	for ((var) = TAILQ_FIRST((head));				\
-	    (var);							\
-	    (var) = TAILQ_NEXT((var), field))
-
-#define	TAILQ_FOREACH_FROM(var, head, field)				\
-	for ((var) = ((var) ? (var) : TAILQ_FIRST((head)));		\
-	    (var);							\
-	    (var) = TAILQ_NEXT((var), field))
-
-#define	TAILQ_FOREACH_SAFE(var, head, field, tvar)			\
-	for ((var) = TAILQ_FIRST((head));				\
-	    (var) && ((tvar) = TAILQ_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-
-#define	TAILQ_FOREACH_FROM_SAFE(var, head, field, tvar)			\
-	for ((var) = ((var) ? (var) : TAILQ_FIRST((head)));		\
-	    (var) && ((tvar) = TAILQ_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-
-#define	TAILQ_FOREACH_REVERSE(var, head, headname, field)		\
-	for ((var) = TAILQ_LAST((head), headname);			\
-	    (var);							\
-	    (var) = TAILQ_PREV((var), headname, field))
-
-#define	TAILQ_FOREACH_REVERSE_FROM(var, head, headname, field)		\
-	for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname));	\
-	    (var);							\
-	    (var) = TAILQ_PREV((var), headname, field))
-
-#define	TAILQ_FOREACH_REVERSE_SAFE(var, head, headname, field, tvar)	\
-	for ((var) = TAILQ_LAST((head), headname);			\
-	    (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1);	\
-	    (var) = (tvar))
-
-#define	TAILQ_FOREACH_REVERSE_FROM_SAFE(var, head, headname, field, tvar) \
-	for ((var) = ((var) ? (var) : TAILQ_LAST((head), headname));	\
-	    (var) && ((tvar) = TAILQ_PREV((var), headname, field), 1);	\
-	    (var) = (tvar))
-
-#define	TAILQ_INIT(head) do {						\
-	TAILQ_FIRST((head)) = NULL;					\
-	(head)->tqh_last = &TAILQ_FIRST((head));			\
-	QMD_TRACE_HEAD(head);						\
-} while (0)
-
-#define	TAILQ_INSERT_AFTER(head, listelm, elm, field) do {		\
-	QMD_TAILQ_CHECK_NEXT(listelm, field);				\
-	if ((TAILQ_NEXT((elm), field) = TAILQ_NEXT((listelm), field)) != NULL)\
-		TAILQ_NEXT((elm), field)->field.tqe_prev = 		\
-		    &TAILQ_NEXT((elm), field);				\
-	else {								\
-		(head)->tqh_last = &TAILQ_NEXT((elm), field);		\
-		QMD_TRACE_HEAD(head);					\
-	}								\
-	TAILQ_NEXT((listelm), field) = (elm);				\
-	(elm)->field.tqe_prev = &TAILQ_NEXT((listelm), field);		\
-	QMD_TRACE_ELEM(&(elm)->field);					\
-	QMD_TRACE_ELEM(&(listelm)->field);				\
-} while (0)
-
-#define	TAILQ_INSERT_BEFORE(listelm, elm, field) do {			\
-	QMD_TAILQ_CHECK_PREV(listelm, field);				\
-	(elm)->field.tqe_prev = (listelm)->field.tqe_prev;		\
-	TAILQ_NEXT((elm), field) = (listelm);				\
-	*(listelm)->field.tqe_prev = (elm);				\
-	(listelm)->field.tqe_prev = &TAILQ_NEXT((elm), field);		\
-	QMD_TRACE_ELEM(&(elm)->field);					\
-	QMD_TRACE_ELEM(&(listelm)->field);				\
-} while (0)
-
-#define	TAILQ_INSERT_HEAD(head, elm, field) do {			\
-	QMD_TAILQ_CHECK_HEAD(head, field);				\
-	if ((TAILQ_NEXT((elm), field) = TAILQ_FIRST((head))) != NULL)	\
-		TAILQ_FIRST((head))->field.tqe_prev =			\
-		    &TAILQ_NEXT((elm), field);				\
-	else								\
-		(head)->tqh_last = &TAILQ_NEXT((elm), field);		\
-	TAILQ_FIRST((head)) = (elm);					\
-	(elm)->field.tqe_prev = &TAILQ_FIRST((head));			\
-	QMD_TRACE_HEAD(head);						\
-	QMD_TRACE_ELEM(&(elm)->field);					\
-} while (0)
-
-#define	TAILQ_INSERT_TAIL(head, elm, field) do {			\
-	QMD_TAILQ_CHECK_TAIL(head, field);				\
-	TAILQ_NEXT((elm), field) = NULL;				\
-	(elm)->field.tqe_prev = (head)->tqh_last;			\
-	*(head)->tqh_last = (elm);					\
-	(head)->tqh_last = &TAILQ_NEXT((elm), field);			\
-	QMD_TRACE_HEAD(head);						\
-	QMD_TRACE_ELEM(&(elm)->field);					\
-} while (0)
-
-#define	TAILQ_LAST(head, headname)					\
-	(*(((struct headname *)((head)->tqh_last))->tqh_last))
-
-/*
- * The FAST function is fast in that it causes no data access other
- * then the access to the head. The standard LAST function above
- * will cause a data access of both the element you want and
- * the previous element. FAST is very useful for instances when
- * you may want to prefetch the last data element.
- */
-#define	TAILQ_LAST_FAST(head, type, field)			\
-    (TAILQ_EMPTY(head) ? NULL : __containerof((head)->tqh_last, QUEUE_TYPEOF(type), field.tqe_next))
-
-#define	TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-
-#define	TAILQ_PREV(elm, headname, field)				\
-	(*(((struct headname *)((elm)->field.tqe_prev))->tqh_last))
-
-#define	TAILQ_PREV_FAST(elm, head, type, field)				\
-    ((elm)->field.tqe_prev == &(head)->tqh_first ? NULL :		\
-     __containerof((elm)->field.tqe_prev, QUEUE_TYPEOF(type), field.tqe_next))
-
-#define	TAILQ_REMOVE(head, elm, field) do {				\
-	QMD_SAVELINK(oldnext, (elm)->field.tqe_next);			\
-	QMD_SAVELINK(oldprev, (elm)->field.tqe_prev);			\
-	QMD_TAILQ_CHECK_NEXT(elm, field);				\
-	QMD_TAILQ_CHECK_PREV(elm, field);				\
-	if ((TAILQ_NEXT((elm), field)) != NULL)				\
-		TAILQ_NEXT((elm), field)->field.tqe_prev = 		\
-		    (elm)->field.tqe_prev;				\
-	else {								\
-		(head)->tqh_last = (elm)->field.tqe_prev;		\
-		QMD_TRACE_HEAD(head);					\
-	}								\
-	*(elm)->field.tqe_prev = TAILQ_NEXT((elm), field);		\
-	TRASHIT(*oldnext);						\
-	TRASHIT(*oldprev);						\
-	QMD_TRACE_ELEM(&(elm)->field);					\
-} while (0)
-
-#define TAILQ_SWAP(head1, head2, type, field) do {			\
-	QUEUE_TYPEOF(type) *swap_first = (head1)->tqh_first;		\
-	QUEUE_TYPEOF(type) **swap_last = (head1)->tqh_last;		\
-	(head1)->tqh_first = (head2)->tqh_first;			\
-	(head1)->tqh_last = (head2)->tqh_last;				\
-	(head2)->tqh_first = swap_first;				\
-	(head2)->tqh_last = swap_last;					\
-	if ((swap_first = (head1)->tqh_first) != NULL)			\
-		swap_first->field.tqe_prev = &(head1)->tqh_first;	\
-	else								\
-		(head1)->tqh_last = &(head1)->tqh_first;		\
-	if ((swap_first = (head2)->tqh_first) != NULL)			\
-		swap_first->field.tqe_prev = &(head2)->tqh_first;	\
-	else								\
-		(head2)->tqh_last = &(head2)->tqh_first;		\
-} while (0)
 
-#endif /* !_SYS_QUEUE_H_ */
+#include <rte_queue.h>
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 3/6] build: use rte_queue.h instead of sys/queue.h
  2026-09-17 17:19 [PATCH 0/6] provide a complete set of BSD list macros Stephen Hemminger
  2026-09-17 17:19 ` [PATCH 1/6] net/bnxt: fix use after free when freeing filters Stephen Hemminger
  2026-09-17 17:19 ` [PATCH 2/6] eal: add rte_queue.h with full set of list macros Stephen Hemminger
@ 2026-09-17 17:19 ` Stephen Hemminger
  2026-09-17 17:19 ` [PATCH 4/6] build: remove private FOREACH_SAFE definitions Stephen Hemminger
                   ` (3 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2026-09-17 17:19 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Reshma Pattan, Nicolas Chautru, Jerin Jacob,
	Srikanth Yalavarthi, Cristian Dumitrescu, Aman Singh, Yipeng Wang,
	Sameh Gobriel, Bruce Richardson, Vladimir Medvedkin,
	Andrew Rybchenko, Morten Brørup, Anatoly Burakov,
	Konstantin Ananyev, Wathsala Vithanage, Chas Williams,
	Min Hu (Connor), Jack Bond-Preston, Erik Gabriel Carrillo,
	Parav Pandit, Xueming Li, Hemant Agrawal, Sachin Saxena, Rosen Xu,
	Chenbo Xia, Nipun Gupta, Tomasz Duszynski, Wei Hu,
	Nithin Dabilpuram, Kiran Kumar K, Sunil Kumar Kori, Satha Rao,
	Harman Kalra, Dariusz Sosnowski, Viacheslav Ovsiienko, Bing Zhao,
	Ori Kam, Suanming Mou, Matan Azrad, Ajit Khaparde, Vikas Gupta,
	Sunil Uttarwar, Tirthendu Sarkar, Liang Ma, Peter Mccarthy,
	Selwin Sebastian, Julien Aube, Kishore Padmanabha,
	Potnuri Bharat Teja, John Daley, Hyong Youb Kim, Gaetan Rivet,
	Praveen Shetty, Jingjing Wu, Jakub Grajciar, Martin Spinler,
	Jiawen Wu, Zaiyu Wang, Christian Koue Muf, Serhii Iliushyk,
	Devendra Singh Rawat, Alok Prasad, Jie Liu, Maciej Czekaj,
	Jochen Behrens, Junlong Wang, Ming Ran, Vijay Kumar Srivastava,
	Radu Nicolau, Akhil Goyal, Fan Zhang, Pavan Nikhilesh, Zhirun Yan,
	Sivaprasad Tummala, Maxime Coquelin, Marat Khalili,
	Dmitry Kozlyuk, Thomas Monjalon, Elena Agostini, Volodymyr Fialko

Replace every direct include of <sys/queue.h> with <rte_queue.h> and
remove the Windows stub left by the previous commit, so that all
platforms get the same set of list macros.

This has to be done in one step rather than one subsystem at a time.
Both headers use the same multiple inclusion guard, deliberately, so
that this header and a system <sys/queue.h> pulled in by an application
suppress each other instead of defining the same macros twice. The
consequence in tree is that a single remaining direct include, whether
in the file itself or reached through another header, silently turns
rte_queue.h into a no-op for that whole translation unit.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 app/dumpcap/main.c                                    |  2 +-
 app/proc-info/main.c                                  |  2 +-
 app/test-bbdev/main.h                                 |  2 +-
 app/test-cmdline/cmdline_test.c                       |  2 +-
 app/test-eventdev/evt_test.c                          |  2 +-
 app/test-eventdev/evt_test.h                          |  2 +-
 app/test-mldev/ml_test.h                              |  2 +-
 app/test-pipeline/config.c                            |  2 +-
 app/test-pipeline/init.c                              |  2 +-
 app/test-pipeline/main.c                              |  2 +-
 app/test-pipeline/runtime.c                           |  2 +-
 app/test-pmd/5tswap.c                                 |  2 +-
 app/test-pmd/cmdline.c                                |  2 +-
 app/test-pmd/config.c                                 |  2 +-
 app/test-pmd/csumonly.c                               |  2 +-
 app/test-pmd/flowgen.c                                |  2 +-
 app/test-pmd/hairpin.c                                |  2 +-
 app/test-pmd/icmpecho.c                               |  2 +-
 app/test-pmd/iofwd.c                                  |  2 +-
 app/test-pmd/macfwd.c                                 |  2 +-
 app/test-pmd/macswap.c                                |  2 +-
 app/test-pmd/noisy_vnf.c                              |  2 +-
 app/test-pmd/parameters.c                             |  2 +-
 app/test-pmd/rxonly.c                                 |  2 +-
 app/test-pmd/testpmd.c                                |  2 +-
 app/test-pmd/testpmd.h                                |  2 +-
 app/test-pmd/txonly.c                                 |  2 +-
 app/test/commands.c                                   |  2 +-
 app/test/test.c                                       |  2 +-
 app/test/test.h                                       |  2 +-
 app/test/test_atomic.c                                |  2 +-
 app/test/test_cmdline_lib.c                           |  2 +-
 app/test/test_func_reentrancy.c                       |  2 +-
 app/test/test_hash.c                                  |  2 +-
 app/test/test_hash_functions.c                        |  2 +-
 app/test/test_link_bonding.c                          |  2 +-
 app/test/test_link_bonding_mode4.c                    |  2 +-
 app/test/test_link_bonding_rssconf.c                  |  2 +-
 app/test/test_logs.c                                  |  2 +-
 app/test/test_malloc.c                                |  2 +-
 app/test/test_mbuf.c                                  |  2 +-
 app/test/test_mcslock.c                               |  2 +-
 app/test/test_mempool.c                               |  2 +-
 app/test/test_mempool_perf.c                          |  2 +-
 app/test/test_memzone.c                               |  2 +-
 app/test/test_mp_secondary.c                          |  2 +-
 app/test/test_per_lcore.c                             |  2 +-
 app/test/test_pflock.c                                |  2 +-
 app/test/test_ring.c                                  |  2 +-
 app/test/test_rwlock.c                                |  2 +-
 app/test/test_soring.c                                |  2 +-
 app/test/test_spinlock.c                              |  2 +-
 app/test/test_tailq.c                                 |  2 +-
 app/test/test_ticketlock.c                            |  2 +-
 app/test/test_timer.c                                 |  2 +-
 drivers/bus/auxiliary/auxiliary_common.c              |  2 +-
 drivers/bus/auxiliary/private.h                       |  2 +-
 drivers/bus/fslmc/bus_fslmc_driver.h                  |  2 +-
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c              |  2 +-
 drivers/bus/ifpga/ifpga_bus.c                         |  2 +-
 drivers/bus/pci/bsd/pci.c                             |  2 +-
 drivers/bus/pci/pci_common.c                          |  2 +-
 drivers/bus/pci/pci_params.c                          |  2 +-
 drivers/bus/pci/windows/pci.c                         |  2 +-
 drivers/bus/pci/windows/pci_netuio.c                  |  2 +-
 drivers/bus/platform/platform.c                       |  2 +-
 drivers/bus/vdev/vdev.c                               |  2 +-
 drivers/bus/vmbus/vmbus_common.c                      |  2 +-
 drivers/common/cnxk/roc_bphy_irq.c                    |  1 -
 drivers/common/cnxk/roc_npc.h                         |  2 --
 drivers/common/cnxk/roc_platform.h                    |  1 +
 drivers/common/mlx5/mlx5_common_mr.h                  |  2 +-
 drivers/crypto/bcmfs/bcmfs_device.c                   |  2 +-
 drivers/crypto/bcmfs/bcmfs_device.h                   |  2 +-
 drivers/crypto/ccp/ccp_crypto.c                       |  2 +-
 drivers/crypto/ccp/ccp_dev.c                          |  2 +-
 drivers/event/dlb2/dlb2_selftest.c                    |  2 +-
 drivers/event/opdl/opdl_test.c                        |  2 +-
 drivers/event/sw/sw_evdev_selftest.c                  |  2 +-
 drivers/net/axgbe/axgbe_common.h                      |  2 +-
 drivers/net/bnx2x/bnx2x_ethdev.h                      |  2 +-
 drivers/net/bnxt/bnxt.h                               |  2 +-
 drivers/net/bnxt/bnxt_filter.c                        |  2 +-
 drivers/net/bnxt/bnxt_flow.c                          |  2 +-
 drivers/net/bnxt/bnxt_vnic.h                          |  2 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.h                    |  2 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c              |  2 +-
 drivers/net/bonding/eth_bond_private.h                |  2 +-
 drivers/net/bonding/rte_eth_bond_flow.c               |  2 +-
 drivers/net/cxgbe/cxgbe_ethdev.c                      |  2 +-
 drivers/net/cxgbe/cxgbe_main.c                        |  2 +-
 drivers/net/cxgbe/sge.c                               |  2 +-
 drivers/net/dpaa2/dpaa2_flow.c                        |  2 +-
 drivers/net/dpaa2/dpaa2_mux.c                         |  2 +-
 drivers/net/dpaa2/dpaa2_ptp.c                         |  2 +-
 drivers/net/enic/enic.h                               |  2 +-
 drivers/net/failsafe/failsafe_flow.c                  |  2 +-
 drivers/net/failsafe/failsafe_private.h               |  2 +-
 drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c         |  2 +-
 drivers/net/intel/e1000/e1000_ethdev.h                |  2 +-
 drivers/net/intel/e1000/em_ethdev.c                   |  2 +-
 drivers/net/intel/e1000/em_rxtx.c                     |  2 +-
 drivers/net/intel/e1000/igb_ethdev.c                  |  2 +-
 drivers/net/intel/e1000/igb_flow.c                    |  2 +-
 drivers/net/intel/e1000/igb_rxtx.c                    |  2 +-
 drivers/net/intel/i40e/i40e_ethdev.h                  |  2 +-
 drivers/net/intel/i40e/i40e_fdir.c                    |  2 +-
 drivers/net/intel/i40e/i40e_flow.c                    |  2 +-
 drivers/net/intel/i40e/i40e_hash.c                    |  2 +-
 drivers/net/intel/i40e/i40e_pf.c                      |  2 +-
 drivers/net/intel/i40e/i40e_rxtx.c                    |  2 +-
 drivers/net/intel/iavf/iavf.h                         |  2 +-
 drivers/net/intel/iavf/iavf_ethdev.c                  |  2 +-
 drivers/net/intel/iavf/iavf_fdir.c                    |  2 +-
 drivers/net/intel/iavf/iavf_fsub.c                    |  2 +-
 drivers/net/intel/iavf/iavf_generic_flow.c            |  2 +-
 drivers/net/intel/iavf/iavf_hash.c                    |  2 +-
 drivers/net/intel/iavf/iavf_rxtx.c                    |  2 +-
 drivers/net/intel/ice/base/ice_osdep.h                |  2 +-
 drivers/net/intel/ice/ice_acl_filter.c                |  2 +-
 drivers/net/intel/ice/ice_dcf.c                       |  2 +-
 drivers/net/intel/ice/ice_dcf_ethdev.c                |  2 +-
 drivers/net/intel/ice/ice_generic_flow.c              |  2 +-
 drivers/net/intel/ice/ice_hash.c                      |  2 +-
 drivers/net/intel/ice/ice_switch_filter.c             |  2 +-
 drivers/net/intel/idpf/base/idpf_osdep.h              |  2 +-
 drivers/net/intel/ipn3ke/ipn3ke_ethdev.h              |  2 +-
 drivers/net/intel/ipn3ke/ipn3ke_flow.c                |  2 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.c                |  2 +-
 drivers/net/intel/ixgbe/ixgbe_ethdev.h                |  2 +-
 drivers/net/intel/ixgbe/ixgbe_fdir.c                  |  2 +-
 drivers/net/intel/ixgbe/ixgbe_flow.c                  |  2 +-
 drivers/net/intel/ixgbe/ixgbe_rxtx.c                  |  2 +-
 drivers/net/memif/memif_socket.h                      |  2 +-
 drivers/net/memif/rte_eth_memif.h                     |  2 +-
 drivers/net/mlx4/mlx4.h                               |  2 +-
 drivers/net/mlx4/mlx4_flow.c                          |  2 +-
 drivers/net/mlx4/mlx4_flow.h                          |  2 +-
 drivers/net/mlx4/mlx4_mr.h                            |  2 +-
 drivers/net/mlx4/mlx4_rxtx.h                          |  2 +-
 drivers/net/mlx5/hws/mlx5dr_internal.h                |  2 +-
 drivers/net/mlx5/linux/mlx5_verbs.c                   |  2 +-
 drivers/net/mlx5/mlx5.h                               |  2 +-
 drivers/net/mlx5/mlx5_devx.c                          |  2 +-
 drivers/net/mlx5/mlx5_driver_event.c                  |  2 +-
 drivers/net/mlx5/mlx5_flow.c                          |  2 +-
 drivers/net/mlx5/mlx5_flow.h                          |  2 +-
 drivers/net/mlx5/mlx5_flow_dv.c                       |  2 +-
 drivers/net/mlx5/mlx5_flow_verbs.c                    |  2 +-
 drivers/net/mlx5/mlx5_rx.h                            |  2 +-
 drivers/net/mlx5/mlx5_rxq.c                           |  2 +-
 drivers/net/mlx5/mlx5_rxtx.h                          |  2 +-
 drivers/net/mlx5/mlx5_tx.h                            |  2 +-
 drivers/net/nfb/nfb_ethdev.c                          |  2 +-
 drivers/net/ngbe/ngbe_ethdev_vf.c                     |  2 +-
 drivers/net/ngbe/ngbe_rxtx.c                          |  2 +-
 drivers/net/ntnic/ntnic_ethdev.c                      |  2 +-
 drivers/net/qede/qede_ethdev.h                        |  2 +-
 drivers/net/sfc/sfc_dp.c                              |  2 +-
 drivers/net/sfc/sfc_dp.h                              |  2 +-
 drivers/net/softnic/rte_eth_softnic_internals.h       |  2 +-
 drivers/net/sxe2/sxe2_flow.c                          |  2 +-
 drivers/net/tap/rte_eth_tap.h                         |  2 +-
 drivers/net/tap/tap_flow.c                            |  2 +-
 drivers/net/thunderx/base/nicvf_bsvf.h                |  2 +-
 drivers/net/thunderx/nicvf_ethdev.c                   |  2 +-
 drivers/net/txgbe/txgbe_ethdev_vf.c                   |  2 +-
 drivers/net/txgbe/txgbe_fdir.c                        |  2 +-
 drivers/net/txgbe/txgbe_flow.c                        |  2 +-
 drivers/net/txgbe/txgbe_rxtx.c                        |  2 +-
 drivers/net/vdev_netvsc/vdev_netvsc.c                 |  2 +-
 drivers/net/vmxnet3/vmxnet3_ethdev.c                  |  2 +-
 drivers/net/vmxnet3/vmxnet3_rxtx.c                    |  2 +-
 drivers/net/zxdh/zxdh_flow.c                          |  2 +-
 drivers/net/zxdh/zxdh_flow.h                          |  2 +-
 drivers/net/zxdh/zxdh_mtr.h                           |  2 +-
 drivers/raw/ifpga/base/opae_hw_api.h                  |  2 +-
 drivers/vdpa/mlx5/mlx5_vdpa.h                         |  2 +-
 drivers/vdpa/sfc/sfc_vdpa.c                           |  2 +-
 drivers/vdpa/sfc/sfc_vdpa.h                           |  2 +-
 examples/bbdev_app/main.c                             |  2 +-
 examples/bond/main.c                                  |  2 +-
 examples/cmdline/main.c                               |  2 +-
 examples/cmdline/parse_obj_list.h                     |  2 +-
 examples/flow_filtering/main.c                        |  2 +-
 examples/helloworld/main.c                            |  2 +-
 examples/ip_fragmentation/main.c                      |  2 +-
 examples/ip_pipeline/action.h                         |  2 +-
 examples/ip_pipeline/cryptodev.h                      |  2 +-
 examples/ip_pipeline/link.h                           |  2 +-
 examples/ip_pipeline/mempool.h                        |  2 +-
 examples/ip_pipeline/pipeline.h                       |  2 +-
 examples/ip_pipeline/swq.h                            |  2 +-
 examples/ip_pipeline/tap.h                            |  2 +-
 examples/ip_pipeline/tmgr.h                           |  2 +-
 examples/ip_reassembly/main.c                         |  2 +-
 examples/ipsec-secgw/ipsec-secgw.c                    |  2 +-
 examples/ipv4_multicast/main.c                        |  2 +-
 examples/l2fwd-crypto/main.c                          |  2 +-
 examples/l2fwd-event/l2fwd_common.h                   |  2 +-
 examples/l2fwd-keepalive/ka-agent/main.c              |  2 +-
 examples/l2fwd-keepalive/main.c                       |  2 +-
 examples/l2fwd-macsec/main.c                          |  2 +-
 examples/l2fwd/main.c                                 |  2 +-
 examples/l3fwd-graph/main.c                           |  2 +-
 examples/l3fwd-power/main.c                           |  2 +-
 examples/l3fwd/l3fwd_em.c                             |  2 +-
 examples/l3fwd/l3fwd_lpm.c                            |  2 +-
 examples/l3fwd/main.c                                 |  2 +-
 examples/link_status_interrupt/main.c                 |  2 +-
 .../multi_process/client_server_mp/mp_client/client.c |  2 +-
 .../multi_process/client_server_mp/mp_server/init.c   |  2 +-
 .../multi_process/client_server_mp/mp_server/main.c   |  2 +-
 examples/multi_process/hotplug_mp/main.c              |  2 +-
 examples/multi_process/simple_mp/main.c               |  2 +-
 examples/multi_process/symmetric_mp/main.c            |  2 +-
 examples/server_node_efd/efd_node/node.c              |  2 +-
 examples/server_node_efd/efd_server/init.c            |  2 +-
 examples/server_node_efd/efd_server/main.c            |  2 +-
 examples/service_cores/main.c                         |  2 +-
 examples/timer/main.c                                 |  2 +-
 examples/vhost/main.h                                 |  2 +-
 examples/vm_power_manager/channel_manager.c           |  2 +-
 examples/vm_power_manager/channel_monitor.c           |  2 +-
 examples/vm_power_manager/main.c                      |  2 +-
 examples/vmdq/main.c                                  |  2 +-
 examples/vmdq_dcb/main.c                              |  2 +-
 lib/acl/rte_acl_osdep.h                               |  2 +-
 lib/bbdev/rte_bbdev.c                                 |  2 +-
 lib/bpf/bpf_load_elf.c                                |  2 +-
 lib/bpf/bpf_pkt.c                                     |  2 +-
 lib/cryptodev/cryptodev_pmd.c                         |  2 +-
 lib/cryptodev/rte_cryptodev.c                         |  2 +-
 lib/distributor/rte_distributor.c                     |  2 +-
 lib/distributor/rte_distributor_single.c              |  2 +-
 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_options.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                      |  2 +-
 lib/eal/linux/eal_alarm.c                             |  2 +-
 lib/eal/linux/eal_interrupts.c                        |  2 +-
 lib/eal/linux/include/rte_os.h                        |  2 +-
 lib/eal/windows/eal_alarm.c                           |  2 +-
 lib/eal/windows/include/sys/queue.h                   | 11 -----------
 lib/efd/rte_efd.c                                     |  2 +-
 lib/ethdev/ethdev_private.h                           |  2 +-
 lib/ethdev/rte_ethdev.c                               |  2 +-
 lib/fib/rte_fib.c                                     |  2 +-
 lib/fib/rte_fib6.c                                    |  2 +-
 lib/gpudev/gpudev.c                                   |  2 +-
 lib/graph/graph_private.h                             |  2 +-
 lib/hash/rte_cuckoo_hash.c                            |  2 +-
 lib/hash/rte_fbk_hash.c                               |  2 +-
 lib/hash/rte_thash.c                                  |  2 +-
 lib/ip_frag/ip_frag_common.h                          |  2 +-
 lib/log/log.c                                         |  2 +-
 lib/lpm/rte_lpm.c                                     |  2 +-
 lib/lpm/rte_lpm6.c                                    |  2 +-
 lib/mbuf/rte_mbuf_dyn.c                               |  2 +-
 lib/mempool/rte_mempool.c                             |  2 +-
 lib/pipeline/rte_swx_ctl.c                            |  2 +-
 lib/pipeline/rte_swx_pipeline_internal.h              |  2 +-
 lib/pmu/pmu.c                                         |  2 +-
 lib/reorder/rte_reorder.c                             |  2 +-
 lib/rib/rte_rib.c                                     |  2 +-
 lib/rib/rte_rib6.c                                    |  2 +-
 lib/ring/rte_ring.c                                   |  2 +-
 lib/stack/rte_stack.c                                 |  2 +-
 lib/vhost/fd_man.h                                    |  2 +-
 lib/vhost/socket.c                                    |  2 +-
 lib/vhost/vdpa.c                                      |  2 +-
 lib/vhost/vhost.h                                     |  2 +-
 283 files changed, 280 insertions(+), 293 deletions(-)
 delete mode 100644 lib/eal/windows/include/sys/queue.h

diff --git a/app/dumpcap/main.c b/app/dumpcap/main.c
index 46a6cb251e..8869c1e974 100644
--- a/app/dumpcap/main.c
+++ b/app/dumpcap/main.c
@@ -17,7 +17,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/types.h>
 #include <sys/utsname.h>
 #include <time.h>
diff --git a/app/proc-info/main.c b/app/proc-info/main.c
index 5925bbb765..4ad19456c0 100644
--- a/app/proc-info/main.c
+++ b/app/proc-info/main.c
@@ -9,7 +9,7 @@
 #include <errno.h>
 #include <stdarg.h>
 #include <inttypes.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdlib.h>
 #include <getopt.h>
 #include <unistd.h>
diff --git a/app/test-bbdev/main.h b/app/test-bbdev/main.h
index dc10a505d1..bcaee46317 100644
--- a/app/test-bbdev/main.h
+++ b/app/test-bbdev/main.h
@@ -6,7 +6,7 @@
 #define _MAIN_H_
 
 #include <stddef.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_hexdump.h>
diff --git a/app/test-cmdline/cmdline_test.c b/app/test-cmdline/cmdline_test.c
index 21b4a4278d..4d2555e24a 100644
--- a/app/test-cmdline/cmdline_test.c
+++ b/app/test-cmdline/cmdline_test.c
@@ -9,7 +9,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <ctype.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 
diff --git a/app/test-eventdev/evt_test.c b/app/test-eventdev/evt_test.c
index 72d6228bc3..1ca8062296 100644
--- a/app/test-eventdev/evt_test.c
+++ b/app/test-eventdev/evt_test.c
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 #include <unistd.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include "evt_test.h"
 
diff --git a/app/test-eventdev/evt_test.h b/app/test-eventdev/evt_test.h
index ad3f531dcf..25ab3a4e85 100644
--- a/app/test-eventdev/evt_test.h
+++ b/app/test-eventdev/evt_test.h
@@ -7,7 +7,7 @@
 
 #include <string.h>
 #include <stdbool.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_eal.h>
 
diff --git a/app/test-mldev/ml_test.h b/app/test-mldev/ml_test.h
index f35fa8aadb..1099c8dcf1 100644
--- a/app/test-mldev/ml_test.h
+++ b/app/test-mldev/ml_test.h
@@ -8,7 +8,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 
diff --git a/app/test-pipeline/config.c b/app/test-pipeline/config.c
index daf838948b..e7806a6a32 100644
--- a/app/test-pipeline/config.c
+++ b/app/test-pipeline/config.c
@@ -8,7 +8,7 @@
 #include <inttypes.h>
 #include <sys/types.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <getopt.h>
diff --git a/app/test-pipeline/init.c b/app/test-pipeline/init.c
index 558f0e428d..1701c613c9 100644
--- a/app/test-pipeline/init.c
+++ b/app/test-pipeline/init.c
@@ -8,7 +8,7 @@
 #include <inttypes.h>
 #include <sys/types.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <getopt.h>
diff --git a/app/test-pipeline/main.c b/app/test-pipeline/main.c
index e5efafdf28..fac4f880c4 100644
--- a/app/test-pipeline/main.c
+++ b/app/test-pipeline/main.c
@@ -8,7 +8,7 @@
 #include <inttypes.h>
 #include <sys/types.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdarg.h>
 #include <signal.h>
 #include <errno.h>
diff --git a/app/test-pipeline/runtime.c b/app/test-pipeline/runtime.c
index 752f783370..55654d71b7 100644
--- a/app/test-pipeline/runtime.c
+++ b/app/test-pipeline/runtime.c
@@ -8,7 +8,7 @@
 #include <inttypes.h>
 #include <sys/types.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <getopt.h>
diff --git a/app/test-pmd/5tswap.c b/app/test-pmd/5tswap.c
index 8e8de2557a..ad212982af 100644
--- a/app/test-pmd/5tswap.c
+++ b/app/test-pmd/5tswap.c
@@ -8,7 +8,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 
 #include <rte_common.h>
diff --git a/app/test-pmd/cmdline.c b/app/test-pmd/cmdline.c
index 10ee7c5179..f0a2b5a2b3 100644
--- a/app/test-pmd/cmdline.c
+++ b/app/test-pmd/cmdline.c
@@ -13,7 +13,7 @@
 #include <string.h>
 #include <unistd.h>
 #include <inttypes.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_byteorder.h>
diff --git a/app/test-pmd/config.c b/app/test-pmd/config.c
index aa03eb99cc..0264b57b3b 100644
--- a/app/test-pmd/config.c
+++ b/app/test-pmd/config.c
@@ -13,7 +13,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <fcntl.h>
diff --git a/app/test-pmd/csumonly.c b/app/test-pmd/csumonly.c
index c841651756..7471ba1f7a 100644
--- a/app/test-pmd/csumonly.c
+++ b/app/test-pmd/csumonly.c
@@ -10,7 +10,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 
 #include <rte_common.h>
diff --git a/app/test-pmd/flowgen.c b/app/test-pmd/flowgen.c
index 8dac7b9209..d24b6fb279 100644
--- a/app/test-pmd/flowgen.c
+++ b/app/test-pmd/flowgen.c
@@ -10,7 +10,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 
 #include <rte_common.h>
diff --git a/app/test-pmd/hairpin.c b/app/test-pmd/hairpin.c
index 5e6b37974e..2793b3698c 100644
--- a/app/test-pmd/hairpin.c
+++ b/app/test-pmd/hairpin.c
@@ -8,7 +8,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include "testpmd.h"
 
diff --git a/app/test-pmd/icmpecho.c b/app/test-pmd/icmpecho.c
index c87b7a80df..a9ada63b9c 100644
--- a/app/test-pmd/icmpecho.c
+++ b/app/test-pmd/icmpecho.c
@@ -10,7 +10,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 
 #include <rte_common.h>
diff --git a/app/test-pmd/iofwd.c b/app/test-pmd/iofwd.c
index ba06fae4a6..de28cb52a1 100644
--- a/app/test-pmd/iofwd.c
+++ b/app/test-pmd/iofwd.c
@@ -10,7 +10,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 
 #include <rte_common.h>
diff --git a/app/test-pmd/macfwd.c b/app/test-pmd/macfwd.c
index d19ace7395..ad2efb08e8 100644
--- a/app/test-pmd/macfwd.c
+++ b/app/test-pmd/macfwd.c
@@ -10,7 +10,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 
 #include <rte_common.h>
diff --git a/app/test-pmd/macswap.c b/app/test-pmd/macswap.c
index 57f77003fe..a000e2db6a 100644
--- a/app/test-pmd/macswap.c
+++ b/app/test-pmd/macswap.c
@@ -10,7 +10,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 
 #include <rte_common.h>
diff --git a/app/test-pmd/noisy_vnf.c b/app/test-pmd/noisy_vnf.c
index 81d1187cfe..060e3c25b1 100644
--- a/app/test-pmd/noisy_vnf.c
+++ b/app/test-pmd/noisy_vnf.c
@@ -12,7 +12,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 
 #include <rte_common.h>
diff --git a/app/test-pmd/parameters.c b/app/test-pmd/parameters.c
index 0032ea4e25..8bcaaf74be 100644
--- a/app/test-pmd/parameters.c
+++ b/app/test-pmd/parameters.c
@@ -13,7 +13,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 
 #include <stdint.h>
diff --git a/app/test-pmd/rxonly.c b/app/test-pmd/rxonly.c
index 315f9286cd..cf568742a1 100644
--- a/app/test-pmd/rxonly.c
+++ b/app/test-pmd/rxonly.c
@@ -10,7 +10,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 
 #include <rte_common.h>
diff --git a/app/test-pmd/testpmd.c b/app/test-pmd/testpmd.c
index cab2fa1556..506ace6998 100644
--- a/app/test-pmd/testpmd.c
+++ b/app/test-pmd/testpmd.c
@@ -16,7 +16,7 @@
 #include <errno.h>
 #include <stdbool.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 
 #include <stdint.h>
diff --git a/app/test-pmd/testpmd.h b/app/test-pmd/testpmd.h
index 083171853c..657dd341f4 100644
--- a/app/test-pmd/testpmd.h
+++ b/app/test-pmd/testpmd.h
@@ -21,7 +21,7 @@
 #include <cmdline.h>
 #include <cmdline_parse.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #ifdef RTE_HAS_JANSSON
 #include <jansson.h>
 #endif
diff --git a/app/test-pmd/txonly.c b/app/test-pmd/txonly.c
index a4acb85d29..4f62ff76a4 100644
--- a/app/test-pmd/txonly.c
+++ b/app/test-pmd/txonly.c
@@ -10,7 +10,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 
 #include <rte_common.h>
diff --git a/app/test/commands.c b/app/test/commands.c
index 497d8e9952..516297e411 100644
--- a/app/test/commands.c
+++ b/app/test/commands.c
@@ -10,7 +10,7 @@
 #include <stdlib.h>
 #include <inttypes.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
diff --git a/app/test/test.c b/app/test/test.c
index c610c3588e..eb992c2409 100644
--- a/app/test/test.c
+++ b/app/test/test.c
@@ -9,7 +9,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <ctype.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <cmdline_rdline.h>
 #include <cmdline_parse.h>
diff --git a/app/test/test.h b/app/test/test.h
index b29233bb32..311505170e 100644
--- a/app/test/test.h
+++ b/app/test/test.h
@@ -12,7 +12,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_bitops.h>
 #include <rte_common.h>
diff --git a/app/test/test_atomic.c b/app/test/test_atomic.c
index 2a4531b833..31a3f48614 100644
--- a/app/test/test_atomic.c
+++ b/app/test/test_atomic.c
@@ -7,7 +7,7 @@
 #include <stdint.h>
 #include <unistd.h>
 #include <inttypes.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_memory.h>
 #include <rte_common.h>
diff --git a/app/test/test_cmdline_lib.c b/app/test/test_cmdline_lib.c
index 87c1059366..20200cafaa 100644
--- a/app/test/test_cmdline_lib.c
+++ b/app/test/test_cmdline_lib.c
@@ -9,7 +9,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <ctype.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 
diff --git a/app/test/test_func_reentrancy.c b/app/test/test_func_reentrancy.c
index ce55ab991e..bd2ecd0597 100644
--- a/app/test/test_func_reentrancy.c
+++ b/app/test/test_func_reentrancy.c
@@ -9,7 +9,7 @@
 #include <inttypes.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
diff --git a/app/test/test_hash.c b/app/test/test_hash.c
index 640a33e16c..16316b1b0b 100644
--- a/app/test/test_hash.c
+++ b/app/test/test_hash.c
@@ -8,7 +8,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_malloc.h>
diff --git a/app/test/test_hash_functions.c b/app/test/test_hash_functions.c
index 70820d1f19..890108138f 100644
--- a/app/test/test_hash_functions.c
+++ b/app/test/test_hash_functions.c
@@ -8,7 +8,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_cycles.h>
 #include <rte_random.h>
diff --git a/app/test/test_link_bonding.c b/app/test/test_link_bonding.c
index 19b064771a..57cf1f775b 100644
--- a/app/test/test_link_bonding.c
+++ b/app/test/test_link_bonding.c
@@ -11,7 +11,7 @@
 #include <inttypes.h>
 #include <errno.h>
 #include <pthread.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/time.h>
 
 #include <rte_cycles.h>
diff --git a/app/test/test_link_bonding_mode4.c b/app/test/test_link_bonding_mode4.c
index ff13dbed93..b806a2639f 100644
--- a/app/test/test_link_bonding_mode4.c
+++ b/app/test/test_link_bonding_mode4.c
@@ -10,7 +10,7 @@
 #include <inttypes.h>
 #include <errno.h>
 #include <rte_cycles.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_byteorder.h>
 #include <rte_common.h>
diff --git a/app/test/test_link_bonding_rssconf.c b/app/test/test_link_bonding_rssconf.c
index 693b0ccd12..239677e4d1 100644
--- a/app/test/test_link_bonding_rssconf.c
+++ b/app/test/test_link_bonding_rssconf.c
@@ -10,7 +10,7 @@
 #include <inttypes.h>
 #include <errno.h>
 #include <rte_cycles.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_byteorder.h>
 #include <rte_common.h>
diff --git a/app/test/test_logs.c b/app/test/test_logs.c
index 375b06a1b7..0301a8657a 100644
--- a/app/test/test_logs.c
+++ b/app/test/test_logs.c
@@ -5,7 +5,7 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <stdarg.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_log.h>
 #include <rte_memory.h>
diff --git a/app/test/test_malloc.c b/app/test/test_malloc.c
index da868c8091..319e724dbd 100644
--- a/app/test/test_malloc.c
+++ b/app/test/test_malloc.c
@@ -13,7 +13,7 @@
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <sys/mman.h>
 #endif
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <unistd.h>
 
 #include <rte_common.h>
diff --git a/app/test/test_mbuf.c b/app/test/test_mbuf.c
index db23259745..808bb1cd4c 100644
--- a/app/test/test_mbuf.c
+++ b/app/test/test_mbuf.c
@@ -12,7 +12,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_errno.h>
diff --git a/app/test/test_mcslock.c b/app/test/test_mcslock.c
index b182da72f1..303e910809 100644
--- a/app/test/test_mcslock.c
+++ b/app/test/test_mcslock.c
@@ -7,7 +7,7 @@
 #include <inttypes.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_memory.h>
diff --git a/app/test/test_mempool.c b/app/test/test_mempool.c
index e54249ce61..2ad52d6469 100644
--- a/app/test/test_mempool.c
+++ b/app/test/test_mempool.c
@@ -9,7 +9,7 @@
 #include <inttypes.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_eal_paging.h>
diff --git a/app/test/test_mempool_perf.c b/app/test/test_mempool_perf.c
index e164eca788..ebd9cd7b9b 100644
--- a/app/test/test_mempool_perf.c
+++ b/app/test/test_mempool_perf.c
@@ -10,7 +10,7 @@
 #include <inttypes.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
diff --git a/app/test/test_memzone.c b/app/test/test_memzone.c
index 8712690561..a90ef9a41a 100644
--- a/app/test/test_memzone.c
+++ b/app/test/test_memzone.c
@@ -6,7 +6,7 @@
 #include <stdint.h>
 #include <string.h>
 #include <inttypes.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_random.h>
 #include <rte_cycles.h>
diff --git a/app/test/test_mp_secondary.c b/app/test/test_mp_secondary.c
index d89419c253..60638c4501 100644
--- a/app/test/test_mp_secondary.c
+++ b/app/test/test_mp_secondary.c
@@ -10,7 +10,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <inttypes.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
diff --git a/app/test/test_per_lcore.c b/app/test/test_per_lcore.c
index 6e7ba072fd..ffb14c8212 100644
--- a/app/test/test_per_lcore.c
+++ b/app/test/test_per_lcore.c
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_memory.h>
diff --git a/app/test/test_pflock.c b/app/test/test_pflock.c
index 4164a42789..a42952a882 100644
--- a/app/test/test_pflock.c
+++ b/app/test/test_pflock.c
@@ -6,7 +6,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <unistd.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <string.h>
 
 #include <rte_common.h>
diff --git a/app/test/test_ring.c b/app/test/test_ring.c
index 015623659f..9f9f241967 100644
--- a/app/test/test_ring.c
+++ b/app/test/test_ring.c
@@ -10,7 +10,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
diff --git a/app/test/test_rwlock.c b/app/test/test_rwlock.c
index a2f37add34..29aac6a588 100644
--- a/app/test/test_rwlock.c
+++ b/app/test/test_rwlock.c
@@ -6,7 +6,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <unistd.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <string.h>
 
 #include <rte_common.h>
diff --git a/app/test/test_soring.c b/app/test/test_soring.c
index 8ae63aa78e..33e1490690 100644
--- a/app/test/test_soring.c
+++ b/app/test/test_soring.c
@@ -9,7 +9,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_log.h>
diff --git a/app/test/test_spinlock.c b/app/test/test_spinlock.c
index a2ac5df427..f9c59ba4b3 100644
--- a/app/test/test_spinlock.c
+++ b/app/test/test_spinlock.c
@@ -7,7 +7,7 @@
 #include <inttypes.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_memory.h>
diff --git a/app/test/test_tailq.c b/app/test/test_tailq.c
index 34bde52c03..013617736e 100644
--- a/app/test/test_tailq.c
+++ b/app/test/test_tailq.c
@@ -7,7 +7,7 @@
 #include <stdarg.h>
 #include <string.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_eal.h>
 #include <rte_string_fns.h>
diff --git a/app/test/test_ticketlock.c b/app/test/test_ticketlock.c
index 22d17e259b..359984c2b8 100644
--- a/app/test/test_ticketlock.c
+++ b/app/test/test_ticketlock.c
@@ -6,7 +6,7 @@
 #include <stdint.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <unistd.h>
 
 #include <rte_common.h>
diff --git a/app/test/test_timer.c b/app/test/test_timer.c
index c936843ddc..1e24377f56 100644
--- a/app/test/test_timer.c
+++ b/app/test/test_timer.c
@@ -91,7 +91,7 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <inttypes.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <math.h>
 
 #include <rte_common.h>
diff --git a/drivers/bus/auxiliary/auxiliary_common.c b/drivers/bus/auxiliary/auxiliary_common.c
index 016d124f0b..ce7ba19be6 100644
--- a/drivers/bus/auxiliary/auxiliary_common.c
+++ b/drivers/bus/auxiliary/auxiliary_common.c
@@ -8,7 +8,7 @@
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <eal_export.h>
 #include <rte_errno.h>
 #include <rte_interrupts.h>
diff --git a/drivers/bus/auxiliary/private.h b/drivers/bus/auxiliary/private.h
index 282ad94618..f65e7dabf5 100644
--- a/drivers/bus/auxiliary/private.h
+++ b/drivers/bus/auxiliary/private.h
@@ -7,7 +7,7 @@
 
 #include <stdbool.h>
 #include <stdio.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <bus_driver.h>
 
diff --git a/drivers/bus/fslmc/bus_fslmc_driver.h b/drivers/bus/fslmc/bus_fslmc_driver.h
index 44f81cf662..9b3bdea2de 100644
--- a/drivers/bus/fslmc/bus_fslmc_driver.h
+++ b/drivers/bus/fslmc/bus_fslmc_driver.h
@@ -17,7 +17,7 @@
 #include <stdlib.h>
 #include <limits.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdint.h>
 #include <inttypes.h>
 
diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index e17050b625..9dbf5f413e 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -17,7 +17,6 @@
 #include <signal.h>
 #include <pthread.h>
 #include <sys/types.h>
-#include <sys/queue.h>
 #include <sys/ioctl.h>
 #include <sys/stat.h>
 #include <sys/mman.h>
@@ -26,6 +25,7 @@
 #include <sys/syscall.h>
 
 #include <eal_export.h>
+#include <rte_queue.h>
 #include <rte_mbuf.h>
 #include <ethdev_driver.h>
 #include <rte_malloc.h>
diff --git a/drivers/bus/ifpga/ifpga_bus.c b/drivers/bus/ifpga/ifpga_bus.c
index 79d1c3778f..0492200cba 100644
--- a/drivers/bus/ifpga/ifpga_bus.c
+++ b/drivers/bus/ifpga/ifpga_bus.c
@@ -7,7 +7,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/mman.h>
 #include <sys/types.h>
 #include <unistd.h>
diff --git a/drivers/bus/pci/bsd/pci.c b/drivers/bus/pci/bsd/pci.c
index c6df31d486..49874770fb 100644
--- a/drivers/bus/pci/bsd/pci.c
+++ b/drivers/bus/pci/bsd/pci.c
@@ -15,7 +15,7 @@
 #include <errno.h>
 #include <dirent.h>
 #include <limits.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/mman.h>
 #include <sys/ioctl.h>
 #include <sys/pciio.h>
diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c
index dc8db80d3b..d79bca51db 100644
--- a/drivers/bus/pci/pci_common.c
+++ b/drivers/bus/pci/pci_common.c
@@ -9,7 +9,7 @@
 #include <stdbool.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <eal_export.h>
 #include <rte_errno.h>
 #include <rte_interrupts.h>
diff --git a/drivers/bus/pci/pci_params.c b/drivers/bus/pci/pci_params.c
index 6cbd98b4c8..c1e11c9c04 100644
--- a/drivers/bus/pci/pci_params.c
+++ b/drivers/bus/pci/pci_params.c
@@ -2,7 +2,7 @@
  * Copyright 2018 Gaëtan Rivet
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <bus_driver.h>
 #include <rte_bus_pci.h>
diff --git a/drivers/bus/pci/windows/pci.c b/drivers/bus/pci/windows/pci.c
index 7b51301d1e..6389fe9baf 100644
--- a/drivers/bus/pci/windows/pci.c
+++ b/drivers/bus/pci/windows/pci.c
@@ -2,7 +2,7 @@
  * Copyright 2020 Mellanox Technologies, Ltd
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_windows.h>
diff --git a/drivers/bus/pci/windows/pci_netuio.c b/drivers/bus/pci/windows/pci_netuio.c
index 346b2f4c0a..390a0fe16e 100644
--- a/drivers/bus/pci/windows/pci_netuio.c
+++ b/drivers/bus/pci/windows/pci_netuio.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2020 Intel Corporation.
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_windows.h>
 #include <rte_errno.h>
diff --git a/drivers/bus/platform/platform.c b/drivers/bus/platform/platform.c
index 90d865a8df..ff90cae0b6 100644
--- a/drivers/bus/platform/platform.c
+++ b/drivers/bus/platform/platform.c
@@ -10,7 +10,7 @@
 #include <string.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <unistd.h>
 
 #include <bus_driver.h>
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 02d719a44d..04702a7270 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -8,7 +8,7 @@
 #include <stdlib.h>
 #include <stdint.h>
 #include <stdbool.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_os_shim.h>
 #include <eal_export.h>
diff --git a/drivers/bus/vmbus/vmbus_common.c b/drivers/bus/vmbus/vmbus_common.c
index 4c64856abb..62df339af1 100644
--- a/drivers/bus/vmbus/vmbus_common.c
+++ b/drivers/bus/vmbus/vmbus_common.c
@@ -7,7 +7,7 @@
 #include <unistd.h>
 #include <dirent.h>
 #include <fcntl.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/mman.h>
 
 #include <eal_export.h>
diff --git a/drivers/common/cnxk/roc_bphy_irq.c b/drivers/common/cnxk/roc_bphy_irq.c
index 7b39b61537..b136d1b885 100644
--- a/drivers/common/cnxk/roc_bphy_irq.c
+++ b/drivers/common/cnxk/roc_bphy_irq.c
@@ -5,7 +5,6 @@
 #include <pthread.h>
 #include <sys/ioctl.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
 #include <unistd.h>
 
 #include "roc_api.h"
diff --git a/drivers/common/cnxk/roc_npc.h b/drivers/common/cnxk/roc_npc.h
index a7254f35ca..3814340d2c 100644
--- a/drivers/common/cnxk/roc_npc.h
+++ b/drivers/common/cnxk/roc_npc.h
@@ -5,8 +5,6 @@
 #ifndef _ROC_NPC_H_
 #define _ROC_NPC_H_
 
-#include <sys/queue.h>
-
 enum roc_npc_item_type {
 	ROC_NPC_ITEM_TYPE_VOID,
 	ROC_NPC_ITEM_TYPE_ANY,
diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index ac4f76473f..24f0c41cbf 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -20,6 +20,7 @@
 #include <rte_malloc.h>
 #include <rte_memzone.h>
 #include <rte_pci.h>
+#include <rte_queue.h>
 #include <rte_seqcount.h>
 #include <rte_spinlock.h>
 #include <rte_string_fns.h>
diff --git a/drivers/common/mlx5/mlx5_common_mr.h b/drivers/common/mlx5/mlx5_common_mr.h
index 5fb931a1b5..17faaf77ec 100644
--- a/drivers/common/mlx5/mlx5_common_mr.h
+++ b/drivers/common/mlx5/mlx5_common_mr.h
@@ -8,7 +8,7 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 
 #include <rte_compat.h>
diff --git a/drivers/crypto/bcmfs/bcmfs_device.c b/drivers/crypto/bcmfs/bcmfs_device.c
index 46522970d5..fc2fa42bab 100644
--- a/drivers/crypto/bcmfs/bcmfs_device.c
+++ b/drivers/crypto/bcmfs/bcmfs_device.c
@@ -6,7 +6,7 @@
 #include <dirent.h>
 #include <stdbool.h>
 #include <stdlib.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_malloc.h>
 #include <rte_string_fns.h>
diff --git a/drivers/crypto/bcmfs/bcmfs_device.h b/drivers/crypto/bcmfs/bcmfs_device.h
index 610454dd5e..2c04fbadd4 100644
--- a/drivers/crypto/bcmfs/bcmfs_device.h
+++ b/drivers/crypto/bcmfs/bcmfs_device.h
@@ -6,7 +6,7 @@
 #ifndef _BCMFS_DEVICE_H_
 #define _BCMFS_DEVICE_H_
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_spinlock.h>
 #include <bus_vdev_driver.h>
diff --git a/drivers/crypto/ccp/ccp_crypto.c b/drivers/crypto/ccp/ccp_crypto.c
index b07a786d8e..f61fa5f4f3 100644
--- a/drivers/crypto/ccp/ccp_crypto.c
+++ b/drivers/crypto/ccp/ccp_crypto.c
@@ -9,7 +9,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/types.h>
 #include <unistd.h>
 #include <openssl/sha.h>
diff --git a/drivers/crypto/ccp/ccp_dev.c b/drivers/crypto/ccp/ccp_dev.c
index 5088d8ded6..21e5efbb03 100644
--- a/drivers/crypto/ccp/ccp_dev.c
+++ b/drivers/crypto/ccp/ccp_dev.c
@@ -7,7 +7,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/types.h>
 #include <sys/file.h>
 #include <unistd.h>
diff --git a/drivers/event/dlb2/dlb2_selftest.c b/drivers/event/dlb2/dlb2_selftest.c
index 87d98700c9..f37a35b97d 100644
--- a/drivers/event/dlb2/dlb2_selftest.c
+++ b/drivers/event/dlb2/dlb2_selftest.c
@@ -7,7 +7,7 @@
 #include <stdint.h>
 #include <errno.h>
 #include <unistd.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_memory.h>
 #include <rte_memzone.h>
diff --git a/drivers/event/opdl/opdl_test.c b/drivers/event/opdl/opdl_test.c
index 9b0c4db5ce..0c07d36b55 100644
--- a/drivers/event/opdl/opdl_test.c
+++ b/drivers/event/opdl/opdl_test.c
@@ -8,7 +8,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <unistd.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_memory.h>
 #include <rte_memzone.h>
diff --git a/drivers/event/sw/sw_evdev_selftest.c b/drivers/event/sw/sw_evdev_selftest.c
index a2ce14051c..6f935fb495 100644
--- a/drivers/event/sw/sw_evdev_selftest.c
+++ b/drivers/event/sw/sw_evdev_selftest.c
@@ -9,7 +9,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <unistd.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_memory.h>
 #include <rte_launch.h>
diff --git a/drivers/net/axgbe/axgbe_common.h b/drivers/net/axgbe/axgbe_common.h
index 842077d972..51dfa51a2f 100644
--- a/drivers/net/axgbe/axgbe_common.h
+++ b/drivers/net/axgbe/axgbe_common.h
@@ -10,7 +10,7 @@
 
 #include <stdbool.h>
 #include <limits.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/drivers/net/bnx2x/bnx2x_ethdev.h b/drivers/net/bnx2x/bnx2x_ethdev.h
index fa1c3ba955..e69ab03c6d 100644
--- a/drivers/net/bnx2x/bnx2x_ethdev.h
+++ b/drivers/net/bnx2x/bnx2x_ethdev.h
@@ -8,7 +8,7 @@
 #ifndef PMD_BNX2X_ETHDEV_H
 #define PMD_BNX2X_ETHDEV_H
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/param.h>
 #include <sys/user.h>
 #include <sys/stat.h>
diff --git a/drivers/net/bnxt/bnxt.h b/drivers/net/bnxt/bnxt.h
index 336de75da0..2a5ebf8eb9 100644
--- a/drivers/net/bnxt/bnxt.h
+++ b/drivers/net/bnxt/bnxt.h
@@ -9,7 +9,7 @@
 #include <inttypes.h>
 #include <stdbool.h>
 #include <pthread.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_pci.h>
 #include <bus_pci_driver.h>
diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index 0225215dae..a4df485965 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -3,7 +3,7 @@
  * All rights reserved.
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_byteorder.h>
 #include <rte_log.h>
diff --git a/drivers/net/bnxt/bnxt_flow.c b/drivers/net/bnxt/bnxt_flow.c
index a2e590540b..a657f33f29 100644
--- a/drivers/net/bnxt/bnxt_flow.c
+++ b/drivers/net/bnxt/bnxt_flow.c
@@ -3,7 +3,7 @@
  * All rights reserved.
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_log.h>
 #include <rte_malloc.h>
diff --git a/drivers/net/bnxt/bnxt_vnic.h b/drivers/net/bnxt/bnxt_vnic.h
index 5a4fd4ecb7..30d05d86f5 100644
--- a/drivers/net/bnxt/bnxt_vnic.h
+++ b/drivers/net/bnxt/bnxt_vnic.h
@@ -6,7 +6,7 @@
 #ifndef _BNXT_VNIC_H_
 #define _BNXT_VNIC_H_
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdbool.h>
 #include <rte_hash.h>
 
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.h b/drivers/net/bnxt/tf_ulp/bnxt_ulp.h
index afd883df2c..40f1d8798f 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.h
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.h
@@ -8,7 +8,7 @@
 
 #include <inttypes.h>
 #include <stdbool.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include "rte_version.h"
 #include "rte_ethdev.h"
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c
index 7f6a84e699..25ae45a3c7 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c
@@ -4,7 +4,7 @@
  */
 
 #include <math.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_log.h>
 #include <rte_malloc.h>
diff --git a/drivers/net/bonding/eth_bond_private.h b/drivers/net/bonding/eth_bond_private.h
index 378bbba4e6..1b7e771a33 100644
--- a/drivers/net/bonding/eth_bond_private.h
+++ b/drivers/net/bonding/eth_bond_private.h
@@ -6,7 +6,7 @@
 #define _ETH_BOND_PRIVATE_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <ethdev_driver.h>
 #include <rte_flow.h>
diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bonding/rte_eth_bond_flow.c
index 5d0be5caf5..b2a7d397c3 100644
--- a/drivers/net/bonding/rte_eth_bond_flow.c
+++ b/drivers/net/bonding/rte_eth_bond_flow.c
@@ -4,7 +4,7 @@
 
 #include <stddef.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_errno.h>
 #include <rte_malloc.h>
diff --git a/drivers/net/cxgbe/cxgbe_ethdev.c b/drivers/net/cxgbe/cxgbe_ethdev.c
index 82e67eeff1..61b3a4ce17 100644
--- a/drivers/net/cxgbe/cxgbe_ethdev.c
+++ b/drivers/net/cxgbe/cxgbe_ethdev.c
@@ -3,7 +3,7 @@
  * All rights reserved.
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/cxgbe/cxgbe_main.c b/drivers/net/cxgbe/cxgbe_main.c
index 2ed21f2d66..33ac2ef5c2 100644
--- a/drivers/net/cxgbe/cxgbe_main.c
+++ b/drivers/net/cxgbe/cxgbe_main.c
@@ -3,7 +3,7 @@
  * All rights reserved.
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/drivers/net/cxgbe/sge.c b/drivers/net/cxgbe/sge.c
index e9d45f24c4..c275dee697 100644
--- a/drivers/net/cxgbe/sge.c
+++ b/drivers/net/cxgbe/sge.c
@@ -3,7 +3,7 @@
  * All rights reserved.
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/dpaa2/dpaa2_flow.c b/drivers/net/dpaa2/dpaa2_flow.c
index 2e44bff766..e3a527813b 100644
--- a/drivers/net/dpaa2/dpaa2_flow.c
+++ b/drivers/net/dpaa2/dpaa2_flow.c
@@ -2,7 +2,7 @@
  * Copyright 2018-2022 NXP
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/dpaa2/dpaa2_mux.c b/drivers/net/dpaa2/dpaa2_mux.c
index 9bb1bbca38..dd05253d33 100644
--- a/drivers/net/dpaa2/dpaa2_mux.c
+++ b/drivers/net/dpaa2/dpaa2_mux.c
@@ -2,7 +2,7 @@
  * Copyright 2018-2021,2023 NXP
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/dpaa2/dpaa2_ptp.c b/drivers/net/dpaa2/dpaa2_ptp.c
index 751e558c73..067aac1a25 100644
--- a/drivers/net/dpaa2/dpaa2_ptp.c
+++ b/drivers/net/dpaa2/dpaa2_ptp.c
@@ -2,7 +2,7 @@
  * Copyright 2019, 2023 NXP
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/enic/enic.h b/drivers/net/enic/enic.h
index 87f6b35fcd..fbd1acf456 100644
--- a/drivers/net/enic/enic.h
+++ b/drivers/net/enic/enic.h
@@ -21,7 +21,7 @@
 #include "enic_res.h"
 #include "cq_enet_desc.h"
 #include <stdbool.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <rte_spinlock.h>
 
 #define DRV_NAME		"enic_pmd"
diff --git a/drivers/net/failsafe/failsafe_flow.c b/drivers/net/failsafe/failsafe_flow.c
index 707e6c63b5..5baa11460f 100644
--- a/drivers/net/failsafe/failsafe_flow.c
+++ b/drivers/net/failsafe/failsafe_flow.c
@@ -5,7 +5,7 @@
 
 #include <stddef.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_errno.h>
 #include <rte_malloc.h>
diff --git a/drivers/net/failsafe/failsafe_private.h b/drivers/net/failsafe/failsafe_private.h
index babea6016e..82edf588a1 100644
--- a/drivers/net/failsafe/failsafe_private.h
+++ b/drivers/net/failsafe/failsafe_private.h
@@ -7,7 +7,7 @@
 #define _ETH_FAILSAFE_PRIVATE_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <pthread.h>
 
 #include <rte_atomic.h>
diff --git a/drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c b/drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c
index f42156e28f..fbcb9d4d60 100644
--- a/drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c
+++ b/drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2022 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/e1000/e1000_ethdev.h b/drivers/net/intel/e1000/e1000_ethdev.h
index 0907c7c259..efe88e72fe 100644
--- a/drivers/net/intel/e1000/e1000_ethdev.h
+++ b/drivers/net/intel/e1000/e1000_ethdev.h
@@ -6,7 +6,7 @@
 #define _E1000_ETHDEV_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_flow.h>
 #include <rte_time.h>
diff --git a/drivers/net/intel/e1000/em_ethdev.c b/drivers/net/intel/e1000/em_ethdev.c
index c02d09e500..6e233ffbd7 100644
--- a/drivers/net/intel/e1000/em_ethdev.c
+++ b/drivers/net/intel/e1000/em_ethdev.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2010-2016 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/e1000/em_rxtx.c b/drivers/net/intel/e1000/em_rxtx.c
index f9665127df..95813c17ee 100644
--- a/drivers/net/intel/e1000/em_rxtx.c
+++ b/drivers/net/intel/e1000/em_rxtx.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2010-2016 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/drivers/net/intel/e1000/igb_ethdev.c b/drivers/net/intel/e1000/igb_ethdev.c
index 524c030be6..37a25c805f 100644
--- a/drivers/net/intel/e1000/igb_ethdev.c
+++ b/drivers/net/intel/e1000/igb_ethdev.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2010-2016 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/e1000/igb_flow.c b/drivers/net/intel/e1000/igb_flow.c
index ca76bf5ae4..ee766f2c77 100644
--- a/drivers/net/intel/e1000/igb_flow.c
+++ b/drivers/net/intel/e1000/igb_flow.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2010-2016 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/e1000/igb_rxtx.c b/drivers/net/intel/e1000/igb_rxtx.c
index 4fda5d57a0..e3e1ad2ffc 100644
--- a/drivers/net/intel/e1000/igb_rxtx.c
+++ b/drivers/net/intel/e1000/igb_rxtx.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2010-2016 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/drivers/net/intel/i40e/i40e_ethdev.h b/drivers/net/intel/i40e/i40e_ethdev.h
index 9d9bde6aeb..b2411adc64 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.h
+++ b/drivers/net/intel/i40e/i40e_ethdev.h
@@ -6,7 +6,7 @@
 #define _I40E_ETHDEV_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_time.h>
 #include <rte_kvargs.h>
diff --git a/drivers/net/intel/i40e/i40e_fdir.c b/drivers/net/intel/i40e/i40e_fdir.c
index 8a233f8a97..6ae013f5f5 100644
--- a/drivers/net/intel/i40e/i40e_fdir.c
+++ b/drivers/net/intel/i40e/i40e_fdir.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2010-2015 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/i40e/i40e_flow.c b/drivers/net/intel/i40e/i40e_flow.c
index 6eb85a7d0d..6cb5219a80 100644
--- a/drivers/net/intel/i40e/i40e_flow.c
+++ b/drivers/net/intel/i40e/i40e_flow.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2016-2017 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/i40e/i40e_hash.c b/drivers/net/intel/i40e/i40e_hash.c
index 6a23e2bf7f..f24b7540f0 100644
--- a/drivers/net/intel/i40e/i40e_hash.c
+++ b/drivers/net/intel/i40e/i40e_hash.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2020 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/i40e/i40e_pf.c b/drivers/net/intel/i40e/i40e_pf.c
index c76e035a42..cd6a9606c3 100644
--- a/drivers/net/intel/i40e/i40e_pf.c
+++ b/drivers/net/intel/i40e/i40e_pf.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2010-2017 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/i40e/i40e_rxtx.c b/drivers/net/intel/i40e/i40e_rxtx.c
index e29fcff661..81fcae09a6 100644
--- a/drivers/net/intel/i40e/i40e_rxtx.c
+++ b/drivers/net/intel/i40e/i40e_rxtx.c
@@ -10,7 +10,7 @@
 #include <stdarg.h>
 #include <unistd.h>
 #include <inttypes.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_string_fns.h>
 #include <rte_memzone.h>
diff --git a/drivers/net/intel/iavf/iavf.h b/drivers/net/intel/iavf/iavf.h
index 293adaf6c9..1701a0c18e 100644
--- a/drivers/net/intel/iavf/iavf.h
+++ b/drivers/net/intel/iavf/iavf.h
@@ -5,7 +5,7 @@
 #ifndef _IAVF_ETHDEV_H_
 #define _IAVF_ETHDEV_H_
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_kvargs.h>
 #include <rte_tm_driver.h>
diff --git a/drivers/net/intel/iavf/iavf_ethdev.c b/drivers/net/intel/iavf/iavf_ethdev.c
index d601ec3b6a..9add20e8df 100644
--- a/drivers/net/intel/iavf/iavf_ethdev.c
+++ b/drivers/net/intel/iavf/iavf_ethdev.c
@@ -3,7 +3,7 @@
  */
 
 #include <ctype.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdalign.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/drivers/net/intel/iavf/iavf_fdir.c b/drivers/net/intel/iavf/iavf_fdir.c
index ea620863ca..b6cc7b6b0a 100644
--- a/drivers/net/intel/iavf/iavf_fdir.c
+++ b/drivers/net/intel/iavf/iavf_fdir.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2020 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/iavf/iavf_fsub.c b/drivers/net/intel/iavf/iavf_fsub.c
index 19ae0e2dc2..5e215b19bd 100644
--- a/drivers/net/intel/iavf/iavf_fsub.c
+++ b/drivers/net/intel/iavf/iavf_fsub.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2022 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/iavf/iavf_generic_flow.c b/drivers/net/intel/iavf/iavf_generic_flow.c
index 92ca20031c..38c1261bd9 100644
--- a/drivers/net/intel/iavf/iavf_generic_flow.c
+++ b/drivers/net/intel/iavf/iavf_generic_flow.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2019 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/iavf/iavf_hash.c b/drivers/net/intel/iavf/iavf_hash.c
index 9515094402..f72ab89356 100644
--- a/drivers/net/intel/iavf/iavf_hash.c
+++ b/drivers/net/intel/iavf/iavf_hash.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2020 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/iavf/iavf_rxtx.c b/drivers/net/intel/iavf/iavf_rxtx.c
index 4f2ffe6188..0d2c51b17e 100644
--- a/drivers/net/intel/iavf/iavf_rxtx.c
+++ b/drivers/net/intel/iavf/iavf_rxtx.c
@@ -10,7 +10,7 @@
 #include <stdarg.h>
 #include <unistd.h>
 #include <inttypes.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_string_fns.h>
diff --git a/drivers/net/intel/ice/base/ice_osdep.h b/drivers/net/intel/ice/base/ice_osdep.h
index 5d92cf5aa4..a407ec2df5 100644
--- a/drivers/net/intel/ice/base/ice_osdep.h
+++ b/drivers/net/intel/ice/base/ice_osdep.h
@@ -10,7 +10,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <inttypes.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdbool.h>
 
 #include <rte_common.h>
diff --git a/drivers/net/intel/ice/ice_acl_filter.c b/drivers/net/intel/ice/ice_acl_filter.c
index 30ff1254c9..ce9f29281a 100644
--- a/drivers/net/intel/ice/ice_acl_filter.c
+++ b/drivers/net/intel/ice/ice_acl_filter.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2020 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/ice/ice_dcf.c b/drivers/net/intel/ice/ice_dcf.c
index 3b635c0822..89e438d8ac 100644
--- a/drivers/net/intel/ice/ice_dcf.c
+++ b/drivers/net/intel/ice/ice_dcf.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2020 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/ice/ice_dcf_ethdev.c b/drivers/net/intel/ice/ice_dcf_ethdev.c
index c78b290b0d..afb4f0a195 100644
--- a/drivers/net/intel/ice/ice_dcf_ethdev.c
+++ b/drivers/net/intel/ice/ice_dcf_ethdev.c
@@ -4,7 +4,7 @@
 
 #include <errno.h>
 #include <stdbool.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/types.h>
 #include <unistd.h>
 
diff --git a/drivers/net/intel/ice/ice_generic_flow.c b/drivers/net/intel/ice/ice_generic_flow.c
index 76b3800545..23076b23d9 100644
--- a/drivers/net/intel/ice/ice_generic_flow.c
+++ b/drivers/net/intel/ice/ice_generic_flow.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2019 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/ice/ice_hash.c b/drivers/net/intel/ice/ice_hash.c
index 7a9a4f1a04..054c1532d3 100644
--- a/drivers/net/intel/ice/ice_hash.c
+++ b/drivers/net/intel/ice/ice_hash.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2019 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/ice/ice_switch_filter.c b/drivers/net/intel/ice/ice_switch_filter.c
index 6f5af03f6a..2d1dfa7d7f 100644
--- a/drivers/net/intel/ice/ice_switch_filter.c
+++ b/drivers/net/intel/ice/ice_switch_filter.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2019 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/idpf/base/idpf_osdep.h b/drivers/net/intel/idpf/base/idpf_osdep.h
index 67bc33f2e6..207eefd100 100644
--- a/drivers/net/intel/idpf/base/idpf_osdep.h
+++ b/drivers/net/intel/idpf/base/idpf_osdep.h
@@ -10,9 +10,9 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <inttypes.h>
-#include <sys/queue.h>
 #include <stdbool.h>
 
+#include <rte_queue.h>
 #include <rte_common.h>
 #include <rte_malloc.h>
 #include <rte_memzone.h>
diff --git a/drivers/net/intel/ipn3ke/ipn3ke_ethdev.h b/drivers/net/intel/ipn3ke/ipn3ke_ethdev.h
index 3b8026114d..c9a49db840 100644
--- a/drivers/net/intel/ipn3ke/ipn3ke_ethdev.h
+++ b/drivers/net/intel/ipn3ke/ipn3ke_ethdev.h
@@ -11,7 +11,7 @@
 #include <limits.h>
 #include <net/if.h>
 #include <netinet/in.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_mbuf.h>
 #include <rte_flow_driver.h>
diff --git a/drivers/net/intel/ipn3ke/ipn3ke_flow.c b/drivers/net/intel/ipn3ke/ipn3ke_flow.c
index 941d2921fb..3ee089a416 100644
--- a/drivers/net/intel/ipn3ke/ipn3ke_flow.c
+++ b/drivers/net/intel/ipn3ke/ipn3ke_flow.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2019 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.c b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
index c5010f623c..a5df67b9be 100644
--- a/drivers/net/intel/ixgbe/ixgbe_ethdev.c
+++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2010-2017 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/ixgbe/ixgbe_ethdev.h b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
index 5d3243cb4d..23a17b0655 100644
--- a/drivers/net/intel/ixgbe/ixgbe_ethdev.h
+++ b/drivers/net/intel/ixgbe/ixgbe_ethdev.h
@@ -7,7 +7,7 @@
 
 #include <stdint.h>
 #include <stdbool.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include "base/ixgbe_type.h"
 #include "base/ixgbe_dcb.h"
diff --git a/drivers/net/intel/ixgbe/ixgbe_fdir.c b/drivers/net/intel/ixgbe/ixgbe_fdir.c
index b32dc54287..9c5d35c58a 100644
--- a/drivers/net/intel/ixgbe/ixgbe_fdir.c
+++ b/drivers/net/intel/ixgbe/ixgbe_fdir.c
@@ -6,7 +6,7 @@
 #include <stdint.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_interrupts.h>
 #include <rte_log.h>
diff --git a/drivers/net/intel/ixgbe/ixgbe_flow.c b/drivers/net/intel/ixgbe/ixgbe_flow.c
index 6868893d46..b3c4b10e75 100644
--- a/drivers/net/intel/ixgbe/ixgbe_flow.c
+++ b/drivers/net/intel/ixgbe/ixgbe_flow.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2010-2016 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/intel/ixgbe/ixgbe_rxtx.c b/drivers/net/intel/ixgbe/ixgbe_rxtx.c
index 60222693fe..1cfa71f80a 100644
--- a/drivers/net/intel/ixgbe/ixgbe_rxtx.c
+++ b/drivers/net/intel/ixgbe/ixgbe_rxtx.c
@@ -3,7 +3,7 @@
  * Copyright 2014 6WIND S.A.
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/drivers/net/memif/memif_socket.h b/drivers/net/memif/memif_socket.h
index b0decbb0a2..f1b262b41d 100644
--- a/drivers/net/memif/memif_socket.h
+++ b/drivers/net/memif/memif_socket.h
@@ -5,7 +5,7 @@
 #ifndef _MEMIF_SOCKET_H_
 #define _MEMIF_SOCKET_H_
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/un.h>
 
 /**
diff --git a/drivers/net/memif/rte_eth_memif.h b/drivers/net/memif/rte_eth_memif.h
index 9c7a3a93f0..a457ae4011 100644
--- a/drivers/net/memif/rte_eth_memif.h
+++ b/drivers/net/memif/rte_eth_memif.h
@@ -5,7 +5,7 @@
 #ifndef _RTE_ETH_MEMIF_H_
 #define _RTE_ETH_MEMIF_H_
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <ethdev_driver.h>
 #include <rte_ether.h>
diff --git a/drivers/net/mlx4/mlx4.h b/drivers/net/mlx4/mlx4.h
index f68eeb991a..fd93ec1c19 100644
--- a/drivers/net/mlx4/mlx4.h
+++ b/drivers/net/mlx4/mlx4.h
@@ -8,7 +8,7 @@
 
 #include <net/if.h>
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 /* Verbs headers do not support -pedantic. */
 #ifdef PEDANTIC
diff --git a/drivers/net/mlx4/mlx4_flow.c b/drivers/net/mlx4/mlx4_flow.c
index b520664d95..ec30e6ba81 100644
--- a/drivers/net/mlx4/mlx4_flow.c
+++ b/drivers/net/mlx4/mlx4_flow.c
@@ -14,7 +14,7 @@
 #include <stddef.h>
 #include <stdint.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 /* Verbs headers do not support -pedantic. */
 #ifdef PEDANTIC
diff --git a/drivers/net/mlx4/mlx4_flow.h b/drivers/net/mlx4/mlx4_flow.h
index 5e82df6bd6..c397df8561 100644
--- a/drivers/net/mlx4/mlx4_flow.h
+++ b/drivers/net/mlx4/mlx4_flow.h
@@ -7,7 +7,7 @@
 #define RTE_PMD_MLX4_FLOW_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 /* Verbs headers do not support -pedantic. */
 #ifdef PEDANTIC
diff --git a/drivers/net/mlx4/mlx4_mr.h b/drivers/net/mlx4/mlx4_mr.h
index 56dd73ff19..4f78551909 100644
--- a/drivers/net/mlx4/mlx4_mr.h
+++ b/drivers/net/mlx4/mlx4_mr.h
@@ -8,7 +8,7 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 /* Verbs headers do not support -pedantic. */
 #ifdef PEDANTIC
diff --git a/drivers/net/mlx4/mlx4_rxtx.h b/drivers/net/mlx4/mlx4_rxtx.h
index 70f3cd8680..b189c08262 100644
--- a/drivers/net/mlx4/mlx4_rxtx.h
+++ b/drivers/net/mlx4/mlx4_rxtx.h
@@ -7,7 +7,7 @@
 #define MLX4_RXTX_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 /* Verbs headers do not support -pedantic. */
 #ifdef PEDANTIC
diff --git a/drivers/net/mlx5/hws/mlx5dr_internal.h b/drivers/net/mlx5/hws/mlx5dr_internal.h
index 3c27206043..084b8608b4 100644
--- a/drivers/net/mlx5/hws/mlx5dr_internal.h
+++ b/drivers/net/mlx5/hws/mlx5dr_internal.h
@@ -6,7 +6,7 @@
 #define MLX5DR_INTERNAL_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 /* Verbs headers do not support -pedantic. */
 #ifdef PEDANTIC
 #pragma GCC diagnostic ignored "-Wpedantic"
diff --git a/drivers/net/mlx5/linux/mlx5_verbs.c b/drivers/net/mlx5/linux/mlx5_verbs.c
index 103a03bd1a..a73e44a208 100644
--- a/drivers/net/mlx5/linux/mlx5_verbs.c
+++ b/drivers/net/mlx5/linux/mlx5_verbs.c
@@ -8,7 +8,7 @@
 #include <stdint.h>
 #include <unistd.h>
 #include <inttypes.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include "mlx5_autoconf.h"
 
diff --git a/drivers/net/mlx5/mlx5.h b/drivers/net/mlx5/mlx5.h
index 27e6f4e31a..87d7346a00 100644
--- a/drivers/net/mlx5/mlx5.h
+++ b/drivers/net/mlx5/mlx5.h
@@ -10,7 +10,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <limits.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_pci.h>
 #include <rte_ether.h>
diff --git a/drivers/net/mlx5/mlx5_devx.c b/drivers/net/mlx5/mlx5_devx.c
index 4b30a4fade..8e783666ad 100644
--- a/drivers/net/mlx5/mlx5_devx.c
+++ b/drivers/net/mlx5/mlx5_devx.c
@@ -7,7 +7,7 @@
 #include <stdbool.h>
 #include <string.h>
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_malloc.h>
 #include <rte_common.h>
diff --git a/drivers/net/mlx5/mlx5_driver_event.c b/drivers/net/mlx5/mlx5_driver_event.c
index 89e49331c8..033b7ffd49 100644
--- a/drivers/net/mlx5/mlx5_driver_event.c
+++ b/drivers/net/mlx5/mlx5_driver_event.c
@@ -4,7 +4,7 @@
 
 #include "mlx5_driver_event.h"
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 
diff --git a/drivers/net/mlx5/mlx5_flow.c b/drivers/net/mlx5/mlx5_flow.c
index b0eac185b5..bd0525c98e 100644
--- a/drivers/net/mlx5/mlx5_flow.c
+++ b/drivers/net/mlx5/mlx5_flow.c
@@ -7,7 +7,7 @@
 #include <stdint.h>
 #include <string.h>
 #include <stdbool.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_common.h>
diff --git a/drivers/net/mlx5/mlx5_flow.h b/drivers/net/mlx5/mlx5_flow.h
index 3415b4722e..0dc8696d44 100644
--- a/drivers/net/mlx5/mlx5_flow.h
+++ b/drivers/net/mlx5/mlx5_flow.h
@@ -8,7 +8,7 @@
 #include <stdalign.h>
 #include <stdint.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_alarm.h>
 #include <rte_mtr.h>
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 58ebcf87eb..0866b425b4 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -2,7 +2,7 @@
  * Copyright 2018 Mellanox Technologies, Ltd
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdalign.h>
 #include <stdint.h>
 #include <string.h>
diff --git a/drivers/net/mlx5/mlx5_flow_verbs.c b/drivers/net/mlx5/mlx5_flow_verbs.c
index bb240d38d9..4aa02e6863 100644
--- a/drivers/net/mlx5/mlx5_flow_verbs.c
+++ b/drivers/net/mlx5/mlx5_flow_verbs.c
@@ -3,7 +3,7 @@
  */
 
 #include <netinet/in.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdalign.h>
 #include <stdint.h>
 #include <string.h>
diff --git a/drivers/net/mlx5/mlx5_rx.h b/drivers/net/mlx5/mlx5_rx.h
index cd48ee37ef..983660bee3 100644
--- a/drivers/net/mlx5/mlx5_rx.h
+++ b/drivers/net/mlx5/mlx5_rx.h
@@ -7,7 +7,7 @@
 #define RTE_PMD_MLX5_RX_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_mbuf.h>
 #include <rte_mempool.h>
diff --git a/drivers/net/mlx5/mlx5_rxq.c b/drivers/net/mlx5/mlx5_rxq.c
index 25dba7f4d9..4f58cded68 100644
--- a/drivers/net/mlx5/mlx5_rxq.c
+++ b/drivers/net/mlx5/mlx5_rxq.c
@@ -8,7 +8,7 @@
 #include <string.h>
 #include <stdint.h>
 #include <fcntl.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_mbuf.h>
diff --git a/drivers/net/mlx5/mlx5_rxtx.h b/drivers/net/mlx5/mlx5_rxtx.h
index 3fa9245769..021a0b4f75 100644
--- a/drivers/net/mlx5/mlx5_rxtx.h
+++ b/drivers/net/mlx5/mlx5_rxtx.h
@@ -8,7 +8,7 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_mbuf.h>
 #include <rte_mempool.h>
diff --git a/drivers/net/mlx5/mlx5_tx.h b/drivers/net/mlx5/mlx5_tx.h
index 682dc07718..35c4e79c2d 100644
--- a/drivers/net/mlx5/mlx5_tx.h
+++ b/drivers/net/mlx5/mlx5_tx.h
@@ -7,7 +7,7 @@
 #define RTE_PMD_MLX5_TX_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_mbuf.h>
 #include <rte_mempool.h>
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index ba7c849a4b..9ad93c6766 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -5,7 +5,7 @@
  */
 
 #include <ctype.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <eal_export.h>
 #include <rte_tailq.h>
 
diff --git a/drivers/net/ngbe/ngbe_ethdev_vf.c b/drivers/net/ngbe/ngbe_ethdev_vf.c
index c440e02369..f4cade6881 100644
--- a/drivers/net/ngbe/ngbe_ethdev_vf.c
+++ b/drivers/net/ngbe/ngbe_ethdev_vf.c
@@ -3,7 +3,7 @@
  * Copyright(c) 2010-2017 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/ngbe/ngbe_rxtx.c b/drivers/net/ngbe/ngbe_rxtx.c
index a1389de9c0..0185a69dc1 100644
--- a/drivers/net/ngbe/ngbe_rxtx.c
+++ b/drivers/net/ngbe/ngbe_rxtx.c
@@ -3,7 +3,7 @@
  * Copyright(c) 2010-2017 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <stdint.h>
 #include <rte_ethdev.h>
diff --git a/drivers/net/ntnic/ntnic_ethdev.c b/drivers/net/ntnic/ntnic_ethdev.c
index 7cc90a7a5b..cee77d85ac 100644
--- a/drivers/net/ntnic/ntnic_ethdev.c
+++ b/drivers/net/ntnic/ntnic_ethdev.c
@@ -13,7 +13,7 @@
 #include <ethdev_pci.h>
 #include <rte_kvargs.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include "rte_spinlock.h"
 #include "ntlog.h"
diff --git a/drivers/net/qede/qede_ethdev.h b/drivers/net/qede/qede_ethdev.h
index 3015c18504..96ee713af7 100644
--- a/drivers/net/qede/qede_ethdev.h
+++ b/drivers/net/qede/qede_ethdev.h
@@ -8,7 +8,7 @@
 #ifndef _QEDE_ETHDEV_H_
 #define _QEDE_ETHDEV_H_
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_ether.h>
 #include <ethdev_driver.h>
diff --git a/drivers/net/sfc/sfc_dp.c b/drivers/net/sfc/sfc_dp.c
index 7e2a20e4dc..b3b2f153b6 100644
--- a/drivers/net/sfc/sfc_dp.c
+++ b/drivers/net/sfc/sfc_dp.c
@@ -7,7 +7,7 @@
  * for Solarflare) and Solarflare Communications, Inc.
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdalign.h>
 #include <string.h>
 #include <errno.h>
diff --git a/drivers/net/sfc/sfc_dp.h b/drivers/net/sfc/sfc_dp.h
index 545f0f32bf..fa88e0455a 100644
--- a/drivers/net/sfc/sfc_dp.h
+++ b/drivers/net/sfc/sfc_dp.h
@@ -11,7 +11,7 @@
 #define _SFC_DP_H
 
 #include <stdbool.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_pci.h>
 
diff --git a/drivers/net/softnic/rte_eth_softnic_internals.h b/drivers/net/softnic/rte_eth_softnic_internals.h
index d3975dad10..77af9ddb1f 100644
--- a/drivers/net/softnic/rte_eth_softnic_internals.h
+++ b/drivers/net/softnic/rte_eth_softnic_internals.h
@@ -7,7 +7,7 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_mempool.h>
 #include <rte_mbuf.h>
diff --git a/drivers/net/sxe2/sxe2_flow.c b/drivers/net/sxe2/sxe2_flow.c
index 63cfc36968..f76effe7ff 100644
--- a/drivers/net/sxe2/sxe2_flow.c
+++ b/drivers/net/sxe2/sxe2_flow.c
@@ -2,7 +2,7 @@
  * Copyright (C), 2025, Wuxi Stars Micro System Technologies Co., Ltd.
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <unistd.h>
 #include "sxe2_ethdev.h"
 #include "sxe2_flow.h"
diff --git a/drivers/net/tap/rte_eth_tap.h b/drivers/net/tap/rte_eth_tap.h
index f53a5ad077..74fe072c4b 100644
--- a/drivers/net/tap/rte_eth_tap.h
+++ b/drivers/net/tap/rte_eth_tap.h
@@ -6,7 +6,7 @@
 #ifndef _RTE_ETH_TAP_H_
 #define _RTE_ETH_TAP_H_
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/uio.h>
 #include <inttypes.h>
 #include <limits.h>
diff --git a/drivers/net/tap/tap_flow.c b/drivers/net/tap/tap_flow.c
index a9d8e09562..2915f6da9e 100644
--- a/drivers/net/tap/tap_flow.c
+++ b/drivers/net/tap/tap_flow.c
@@ -6,7 +6,7 @@
 #include <errno.h>
 #include <string.h>
 #include <unistd.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/resource.h>
 
 #include <rte_byteorder.h>
diff --git a/drivers/net/thunderx/base/nicvf_bsvf.h b/drivers/net/thunderx/base/nicvf_bsvf.h
index 4c7615ca99..5496353ef1 100644
--- a/drivers/net/thunderx/base/nicvf_bsvf.h
+++ b/drivers/net/thunderx/base/nicvf_bsvf.h
@@ -5,7 +5,7 @@
 #ifndef __THUNDERX_NICVF_BSVF_H__
 #define __THUNDERX_NICVF_BSVF_H__
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 struct nicvf;
 
diff --git a/drivers/net/thunderx/nicvf_ethdev.c b/drivers/net/thunderx/nicvf_ethdev.c
index 6e34da7c3c..81898cc663 100644
--- a/drivers/net/thunderx/nicvf_ethdev.c
+++ b/drivers/net/thunderx/nicvf_ethdev.c
@@ -12,7 +12,7 @@
 #include <stdarg.h>
 #include <inttypes.h>
 #include <netinet/in.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_alarm.h>
 #include <rte_branch_prediction.h>
diff --git a/drivers/net/txgbe/txgbe_ethdev_vf.c b/drivers/net/txgbe/txgbe_ethdev_vf.c
index 341f62bc75..4018955e3f 100644
--- a/drivers/net/txgbe/txgbe_ethdev_vf.c
+++ b/drivers/net/txgbe/txgbe_ethdev_vf.c
@@ -3,7 +3,7 @@
  * Copyright(c) 2010-2017 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/txgbe/txgbe_fdir.c b/drivers/net/txgbe/txgbe_fdir.c
index 67f586ffc7..be0007dc99 100644
--- a/drivers/net/txgbe/txgbe_fdir.c
+++ b/drivers/net/txgbe/txgbe_fdir.c
@@ -7,7 +7,7 @@
 #include <stdint.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <rte_malloc.h>
 
 #include "txgbe_logs.h"
diff --git a/drivers/net/txgbe/txgbe_flow.c b/drivers/net/txgbe/txgbe_flow.c
index 1bb0d3978c..38e6df6ec5 100644
--- a/drivers/net/txgbe/txgbe_flow.c
+++ b/drivers/net/txgbe/txgbe_flow.c
@@ -3,7 +3,7 @@
  * Copyright(c) 2010-2017 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <bus_pci_driver.h>
 #include <rte_malloc.h>
 #include <rte_flow.h>
diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c
index 794ba041a4..bc3b2d809e 100644
--- a/drivers/net/txgbe/txgbe_rxtx.c
+++ b/drivers/net/txgbe/txgbe_rxtx.c
@@ -3,7 +3,7 @@
  * Copyright(c) 2010-2017 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/drivers/net/vdev_netvsc/vdev_netvsc.c b/drivers/net/vdev_netvsc/vdev_netvsc.c
index d70da6c7c1..490abddd24 100644
--- a/drivers/net/vdev_netvsc/vdev_netvsc.c
+++ b/drivers/net/vdev_netvsc/vdev_netvsc.c
@@ -19,7 +19,7 @@
 #include <stdio.h>
 #include <string.h>
 #include <sys/ioctl.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/socket.h>
 #include <unistd.h>
 
diff --git a/drivers/net/vmxnet3/vmxnet3_ethdev.c b/drivers/net/vmxnet3/vmxnet3_ethdev.c
index b7cf217724..6d24460578 100644
--- a/drivers/net/vmxnet3/vmxnet3_ethdev.c
+++ b/drivers/net/vmxnet3/vmxnet3_ethdev.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2010-2015 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdalign.h>
 #include <stdio.h>
 #include <errno.h>
diff --git a/drivers/net/vmxnet3/vmxnet3_rxtx.c b/drivers/net/vmxnet3/vmxnet3_rxtx.c
index 552b8a9823..e9a30592b3 100644
--- a/drivers/net/vmxnet3/vmxnet3_rxtx.c
+++ b/drivers/net/vmxnet3/vmxnet3_rxtx.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2010-2015 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/drivers/net/zxdh/zxdh_flow.c b/drivers/net/zxdh/zxdh_flow.c
index 56ac34c6e3..c138712635 100644
--- a/drivers/net/zxdh/zxdh_flow.c
+++ b/drivers/net/zxdh/zxdh_flow.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2025 ZTE Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <errno.h>
 #include <stdint.h>
diff --git a/drivers/net/zxdh/zxdh_flow.h b/drivers/net/zxdh/zxdh_flow.h
index adbc6b2a15..d0c898a014 100644
--- a/drivers/net/zxdh/zxdh_flow.h
+++ b/drivers/net/zxdh/zxdh_flow.h
@@ -7,7 +7,7 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_arp.h>
 #include <rte_common.h>
diff --git a/drivers/net/zxdh/zxdh_mtr.h b/drivers/net/zxdh/zxdh_mtr.h
index 3efcb6b591..0d0855cf39 100644
--- a/drivers/net/zxdh/zxdh_mtr.h
+++ b/drivers/net/zxdh/zxdh_mtr.h
@@ -7,7 +7,7 @@
 
 #include <stddef.h>
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <rte_mtr.h>
 
 #include "zxdh_np.h"
diff --git a/drivers/raw/ifpga/base/opae_hw_api.h b/drivers/raw/ifpga/base/opae_hw_api.h
index 57750022dd..c1c7af5511 100644
--- a/drivers/raw/ifpga/base/opae_hw_api.h
+++ b/drivers/raw/ifpga/base/opae_hw_api.h
@@ -8,7 +8,7 @@
 #include <stdint.h>
 #include <stdlib.h>
 #include <stdio.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include "opae_osdep.h"
 #include "opae_intel_max10.h"
diff --git a/drivers/vdpa/mlx5/mlx5_vdpa.h b/drivers/vdpa/mlx5/mlx5_vdpa.h
index 06155d2405..a873af39e7 100644
--- a/drivers/vdpa/mlx5/mlx5_vdpa.h
+++ b/drivers/vdpa/mlx5/mlx5_vdpa.h
@@ -6,7 +6,7 @@
 #define RTE_PMD_MLX5_VDPA_H_
 
 #include <linux/virtio_net.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #ifdef PEDANTIC
 #pragma GCC diagnostic ignored "-Wpedantic"
diff --git a/drivers/vdpa/sfc/sfc_vdpa.c b/drivers/vdpa/sfc/sfc_vdpa.c
index eda111954f..1d1d89490b 100644
--- a/drivers/vdpa/sfc/sfc_vdpa.c
+++ b/drivers/vdpa/sfc/sfc_vdpa.c
@@ -5,7 +5,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <pthread.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_devargs.h>
diff --git a/drivers/vdpa/sfc/sfc_vdpa.h b/drivers/vdpa/sfc/sfc_vdpa.h
index 2b843e563d..96b8df42be 100644
--- a/drivers/vdpa/sfc/sfc_vdpa.h
+++ b/drivers/vdpa/sfc/sfc_vdpa.h
@@ -6,7 +6,7 @@
 #define _SFC_VDPA_H
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <bus_pci_driver.h>
 
diff --git a/examples/bbdev_app/main.c b/examples/bbdev_app/main.c
index 5ac70dab59..e208c187eb 100644
--- a/examples/bbdev_app/main.c
+++ b/examples/bbdev_app/main.c
@@ -10,7 +10,7 @@
 #include <inttypes.h>
 #include <sys/types.h>
 #include <unistd.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdarg.h>
 #include <ctype.h>
 #include <errno.h>
diff --git a/examples/bond/main.c b/examples/bond/main.c
index 99359cd6fb..123c148ee8 100644
--- a/examples/bond/main.c
+++ b/examples/bond/main.c
@@ -3,7 +3,7 @@
  */
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/socket.h>
 #include <stdlib.h>
 #include <string.h>
diff --git a/examples/cmdline/main.c b/examples/cmdline/main.c
index c04a782507..ebf9f470f7 100644
--- a/examples/cmdline/main.c
+++ b/examples/cmdline/main.c
@@ -8,7 +8,7 @@
 #include <string.h>
 #include <stdint.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <cmdline_rdline.h>
 #include <cmdline_parse.h>
diff --git a/examples/cmdline/parse_obj_list.h b/examples/cmdline/parse_obj_list.h
index 1223ac1e8b..befe0673d7 100644
--- a/examples/cmdline/parse_obj_list.h
+++ b/examples/cmdline/parse_obj_list.h
@@ -10,7 +10,7 @@
 /* This file is an example of extension of libcmdline. It provides an
  * example of objects stored in a list. */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <cmdline_parse.h>
 #include <cmdline_parse_string.h>
 
diff --git a/examples/flow_filtering/main.c b/examples/flow_filtering/main.c
index f2124881a0..fb2d715ec6 100644
--- a/examples/flow_filtering/main.c
+++ b/examples/flow_filtering/main.c
@@ -8,7 +8,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <sys/types.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <setjmp.h>
 #include <stdarg.h>
 #include <ctype.h>
diff --git a/examples/helloworld/main.c b/examples/helloworld/main.c
index 4f9a550a67..aa93796706 100644
--- a/examples/helloworld/main.c
+++ b/examples/helloworld/main.c
@@ -6,7 +6,7 @@
 #include <string.h>
 #include <stdint.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_memory.h>
 #include <rte_launch.h>
diff --git a/examples/ip_fragmentation/main.c b/examples/ip_fragmentation/main.c
index 132550e497..82af653262 100644
--- a/examples/ip_fragmentation/main.c
+++ b/examples/ip_fragmentation/main.c
@@ -9,7 +9,7 @@
 #include <sys/types.h>
 #include <sys/param.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <getopt.h>
diff --git a/examples/ip_pipeline/action.h b/examples/ip_pipeline/action.h
index cde17e69a3..4cf9142711 100644
--- a/examples/ip_pipeline/action.h
+++ b/examples/ip_pipeline/action.h
@@ -5,7 +5,7 @@
 #ifndef _INCLUDE_ACTION_H_
 #define _INCLUDE_ACTION_H_
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_port_in_action.h>
 #include <rte_table_action.h>
diff --git a/examples/ip_pipeline/cryptodev.h b/examples/ip_pipeline/cryptodev.h
index d00434379e..eef1080627 100644
--- a/examples/ip_pipeline/cryptodev.h
+++ b/examples/ip_pipeline/cryptodev.h
@@ -6,7 +6,7 @@
 #define _INCLUDE_SYM_C_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_cryptodev.h>
 
diff --git a/examples/ip_pipeline/link.h b/examples/ip_pipeline/link.h
index 34ff1149e0..31d21fc601 100644
--- a/examples/ip_pipeline/link.h
+++ b/examples/ip_pipeline/link.h
@@ -6,7 +6,7 @@
 #define _INCLUDE_LINK_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include "common.h"
 
diff --git a/examples/ip_pipeline/mempool.h b/examples/ip_pipeline/mempool.h
index bd46a11ca0..43b890366d 100644
--- a/examples/ip_pipeline/mempool.h
+++ b/examples/ip_pipeline/mempool.h
@@ -6,7 +6,7 @@
 #define _INCLUDE_MEMPOOL_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_mempool.h>
 
diff --git a/examples/ip_pipeline/pipeline.h b/examples/ip_pipeline/pipeline.h
index 89696480fc..1a9842428c 100644
--- a/examples/ip_pipeline/pipeline.h
+++ b/examples/ip_pipeline/pipeline.h
@@ -6,7 +6,7 @@
 #define _INCLUDE_PIPELINE_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_pipeline.h>
 #include <rte_table_action.h>
diff --git a/examples/ip_pipeline/swq.h b/examples/ip_pipeline/swq.h
index c8440ee3cd..a31f839272 100644
--- a/examples/ip_pipeline/swq.h
+++ b/examples/ip_pipeline/swq.h
@@ -6,7 +6,7 @@
 #define _INCLUDE_SWQ_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_ring.h>
 
diff --git a/examples/ip_pipeline/tap.h b/examples/ip_pipeline/tap.h
index 0dce72fe3c..326e0cebe1 100644
--- a/examples/ip_pipeline/tap.h
+++ b/examples/ip_pipeline/tap.h
@@ -5,7 +5,7 @@
 #ifndef _INCLUDE_TAP_H_
 #define _INCLUDE_TAP_H_
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include "common.h"
 
diff --git a/examples/ip_pipeline/tmgr.h b/examples/ip_pipeline/tmgr.h
index 1994c55bcc..8d41e982cf 100644
--- a/examples/ip_pipeline/tmgr.h
+++ b/examples/ip_pipeline/tmgr.h
@@ -6,7 +6,7 @@
 #define _INCLUDE_TMGR_H_
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_sched.h>
 #include <rte_red.h>
diff --git a/examples/ip_reassembly/main.c b/examples/ip_reassembly/main.c
index 0814d47a66..ef6618b42b 100644
--- a/examples/ip_reassembly/main.c
+++ b/examples/ip_reassembly/main.c
@@ -8,7 +8,7 @@
 #include <inttypes.h>
 #include <sys/types.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <getopt.h>
diff --git a/examples/ipsec-secgw/ipsec-secgw.c b/examples/ipsec-secgw/ipsec-secgw.c
index eba7560c9b..4de40b306d 100644
--- a/examples/ipsec-secgw/ipsec-secgw.c
+++ b/examples/ipsec-secgw/ipsec-secgw.c
@@ -12,7 +12,7 @@
 #include <netinet/ip.h>
 #include <netinet/ip6.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <signal.h>
diff --git a/examples/ipv4_multicast/main.c b/examples/ipv4_multicast/main.c
index 1cb621cb8b..30313fdf6a 100644
--- a/examples/ipv4_multicast/main.c
+++ b/examples/ipv4_multicast/main.c
@@ -8,7 +8,7 @@
 #include <inttypes.h>
 #include <sys/types.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <getopt.h>
diff --git a/examples/l2fwd-crypto/main.c b/examples/l2fwd-crypto/main.c
index 84399463da..4542e3029d 100644
--- a/examples/l2fwd-crypto/main.c
+++ b/examples/l2fwd-crypto/main.c
@@ -9,7 +9,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <sys/types.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <netinet/in.h>
 #include <setjmp.h>
 #include <stdarg.h>
diff --git a/examples/l2fwd-event/l2fwd_common.h b/examples/l2fwd-event/l2fwd_common.h
index 53774e0fe6..af3388101d 100644
--- a/examples/l2fwd-event/l2fwd_common.h
+++ b/examples/l2fwd-event/l2fwd_common.h
@@ -11,7 +11,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <sys/types.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <netinet/in.h>
 #include <setjmp.h>
 #include <stdarg.h>
diff --git a/examples/l2fwd-keepalive/ka-agent/main.c b/examples/l2fwd-keepalive/ka-agent/main.c
index b8a755dbd5..94bb72ffbc 100644
--- a/examples/l2fwd-keepalive/ka-agent/main.c
+++ b/examples/l2fwd-keepalive/ka-agent/main.c
@@ -9,7 +9,7 @@
 #include <unistd.h>
 #include <fcntl.h>
 #include <sys/wait.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/mman.h>
 #include <sys/stat.h>
 #include <time.h>
diff --git a/examples/l2fwd-keepalive/main.c b/examples/l2fwd-keepalive/main.c
index 889274ddae..def3cb25c2 100644
--- a/examples/l2fwd-keepalive/main.c
+++ b/examples/l2fwd-keepalive/main.c
@@ -8,7 +8,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <sys/types.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <netinet/in.h>
 #include <setjmp.h>
 #include <stdarg.h>
diff --git a/examples/l2fwd-macsec/main.c b/examples/l2fwd-macsec/main.c
index 059f8a2170..afb83e50ab 100644
--- a/examples/l2fwd-macsec/main.c
+++ b/examples/l2fwd-macsec/main.c
@@ -8,7 +8,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <sys/types.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <setjmp.h>
 #include <stdarg.h>
 #include <ctype.h>
diff --git a/examples/l2fwd/main.c b/examples/l2fwd/main.c
index 1c4a89ae90..8ea8b01c14 100644
--- a/examples/l2fwd/main.c
+++ b/examples/l2fwd/main.c
@@ -8,7 +8,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <sys/types.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <setjmp.h>
 #include <stdarg.h>
 #include <ctype.h>
diff --git a/examples/l3fwd-graph/main.c b/examples/l3fwd-graph/main.c
index 5f89286dce..98c4281a9e 100644
--- a/examples/l3fwd-graph/main.c
+++ b/examples/l3fwd-graph/main.c
@@ -15,7 +15,7 @@
 #include <string.h>
 #include <sys/socket.h>
 #include <sys/types.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <unistd.h>
 
 #include <rte_branch_prediction.h>
diff --git a/examples/l3fwd-power/main.c b/examples/l3fwd-power/main.c
index 705cab8f2d..5c232b74ee 100644
--- a/examples/l3fwd-power/main.c
+++ b/examples/l3fwd-power/main.c
@@ -8,7 +8,7 @@
 #include <inttypes.h>
 #include <sys/types.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <getopt.h>
diff --git a/examples/l3fwd/l3fwd_em.c b/examples/l3fwd/l3fwd_em.c
index d8748a0edd..9191d8c3d3 100644
--- a/examples/l3fwd/l3fwd_em.c
+++ b/examples/l3fwd/l3fwd_em.c
@@ -8,7 +8,7 @@
 #include <inttypes.h>
 #include <sys/types.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <getopt.h>
diff --git a/examples/l3fwd/l3fwd_lpm.c b/examples/l3fwd/l3fwd_lpm.c
index 2d2651e750..70cf24c2a4 100644
--- a/examples/l3fwd/l3fwd_lpm.c
+++ b/examples/l3fwd/l3fwd_lpm.c
@@ -8,7 +8,7 @@
 #include <inttypes.h>
 #include <sys/types.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <getopt.h>
diff --git a/examples/l3fwd/main.c b/examples/l3fwd/main.c
index 6866811526..f370553fb9 100644
--- a/examples/l3fwd/main.c
+++ b/examples/l3fwd/main.c
@@ -8,7 +8,7 @@
 #include <inttypes.h>
 #include <sys/types.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdarg.h>
 #include <errno.h>
 #include <getopt.h>
diff --git a/examples/link_status_interrupt/main.c b/examples/link_status_interrupt/main.c
index b5fac31400..10cfb58a52 100644
--- a/examples/link_status_interrupt/main.c
+++ b/examples/link_status_interrupt/main.c
@@ -8,7 +8,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <sys/types.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <setjmp.h>
 #include <stdarg.h>
 #include <ctype.h>
diff --git a/examples/multi_process/client_server_mp/mp_client/client.c b/examples/multi_process/client_server_mp/mp_client/client.c
index 087c38ef73..5e32350925 100644
--- a/examples/multi_process/client_server_mp/mp_client/client.c
+++ b/examples/multi_process/client_server_mp/mp_client/client.c
@@ -7,7 +7,7 @@
 #include <inttypes.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdlib.h>
 #include <getopt.h>
 #include <string.h>
diff --git a/examples/multi_process/client_server_mp/mp_server/init.c b/examples/multi_process/client_server_mp/mp_server/init.c
index f3b9b49380..b20e2034c5 100644
--- a/examples/multi_process/client_server_mp/mp_server/init.c
+++ b/examples/multi_process/client_server_mp/mp_server/init.c
@@ -6,7 +6,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <errno.h>
 #include <stdarg.h>
 #include <inttypes.h>
diff --git a/examples/multi_process/client_server_mp/mp_server/main.c b/examples/multi_process/client_server_mp/mp_server/main.c
index 691d453d0e..68c0682969 100644
--- a/examples/multi_process/client_server_mp/mp_server/main.c
+++ b/examples/multi_process/client_server_mp/mp_server/main.c
@@ -9,7 +9,7 @@
 #include <stdint.h>
 #include <stdarg.h>
 #include <inttypes.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <errno.h>
 #include <signal.h>
 
diff --git a/examples/multi_process/hotplug_mp/main.c b/examples/multi_process/hotplug_mp/main.c
index d668580784..e84edd6674 100644
--- a/examples/multi_process/hotplug_mp/main.c
+++ b/examples/multi_process/hotplug_mp/main.c
@@ -7,7 +7,7 @@
 #include <stdint.h>
 #include <errno.h>
 #include <termios.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <cmdline_rdline.h>
 #include <cmdline_parse.h>
diff --git a/examples/multi_process/simple_mp/main.c b/examples/multi_process/simple_mp/main.c
index d73d1358ff..d272f21a01 100644
--- a/examples/multi_process/simple_mp/main.c
+++ b/examples/multi_process/simple_mp/main.c
@@ -22,7 +22,7 @@
 #include <errno.h>
 #include <unistd.h>
 #include <termios.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_memory.h>
diff --git a/examples/multi_process/symmetric_mp/main.c b/examples/multi_process/symmetric_mp/main.c
index 7314a9c6ea..fd905da085 100644
--- a/examples/multi_process/symmetric_mp/main.c
+++ b/examples/multi_process/symmetric_mp/main.c
@@ -19,7 +19,7 @@
 #include <stdlib.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <getopt.h>
 #include <signal.h>
 #include <inttypes.h>
diff --git a/examples/server_node_efd/efd_node/node.c b/examples/server_node_efd/efd_node/node.c
index fc2aa5ffef..f91c5ae075 100644
--- a/examples/server_node_efd/efd_node/node.c
+++ b/examples/server_node_efd/efd_node/node.c
@@ -7,7 +7,7 @@
 #include <inttypes.h>
 #include <stdarg.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdlib.h>
 #include <getopt.h>
 #include <string.h>
diff --git a/examples/server_node_efd/efd_server/init.c b/examples/server_node_efd/efd_server/init.c
index 9a20831a0d..2789913594 100644
--- a/examples/server_node_efd/efd_server/init.c
+++ b/examples/server_node_efd/efd_server/init.c
@@ -6,7 +6,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <errno.h>
 #include <stdarg.h>
 #include <inttypes.h>
diff --git a/examples/server_node_efd/efd_server/main.c b/examples/server_node_efd/efd_server/main.c
index 70a7372d4a..0dc57ef414 100644
--- a/examples/server_node_efd/efd_server/main.c
+++ b/examples/server_node_efd/efd_server/main.c
@@ -9,7 +9,7 @@
 #include <stdint.h>
 #include <stdarg.h>
 #include <inttypes.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <errno.h>
 #include <sys/types.h>
 #include <netinet/in.h>
diff --git a/examples/service_cores/main.c b/examples/service_cores/main.c
index 9f52082254..be86cb04e2 100644
--- a/examples/service_cores/main.c
+++ b/examples/service_cores/main.c
@@ -7,7 +7,7 @@
 #include <string.h>
 #include <stdint.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_memory.h>
 #include <rte_launch.h>
diff --git a/examples/timer/main.c b/examples/timer/main.c
index a349846c7c..89c97276b2 100644
--- a/examples/timer/main.c
+++ b/examples/timer/main.c
@@ -6,7 +6,7 @@
 #include <string.h>
 #include <stdint.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_memory.h>
diff --git a/examples/vhost/main.h b/examples/vhost/main.h
index c986cbc5a9..c85018dce4 100644
--- a/examples/vhost/main.h
+++ b/examples/vhost/main.h
@@ -5,7 +5,7 @@
 #ifndef _MAIN_H_
 #define _MAIN_H_
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_ether.h>
 #include <rte_pci.h>
diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
index 339c7fbb93..e162fe5da6 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -10,7 +10,7 @@
 #include <dirent.h>
 #include <errno.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/types.h>
 #include <sys/stat.h>
 #include <sys/socket.h>
diff --git a/examples/vm_power_manager/channel_monitor.c b/examples/vm_power_manager/channel_monitor.c
index 01590826e5..e2e12754f6 100644
--- a/examples/vm_power_manager/channel_monitor.c
+++ b/examples/vm_power_manager/channel_monitor.c
@@ -13,7 +13,7 @@
 #include <fcntl.h>
 #include <sys/types.h>
 #include <sys/epoll.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/time.h>
 #include <sys/socket.h>
 #include <sys/select.h>
diff --git a/examples/vm_power_manager/main.c b/examples/vm_power_manager/main.c
index d6f18187a7..3ac19a6526 100644
--- a/examples/vm_power_manager/main.c
+++ b/examples/vm_power_manager/main.c
@@ -12,7 +12,7 @@
 #include <signal.h>
 #include <errno.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_eal.h>
diff --git a/examples/vmdq/main.c b/examples/vmdq/main.c
index 8c9d885090..a005a31190 100644
--- a/examples/vmdq/main.c
+++ b/examples/vmdq/main.c
@@ -3,7 +3,7 @@
  */
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
diff --git a/examples/vmdq_dcb/main.c b/examples/vmdq_dcb/main.c
index d6f7b632b9..48d3c9bb00 100644
--- a/examples/vmdq_dcb/main.c
+++ b/examples/vmdq_dcb/main.c
@@ -3,7 +3,7 @@
  */
 
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
diff --git a/lib/acl/rte_acl_osdep.h b/lib/acl/rte_acl_osdep.h
index b2c262dee7..3cf8acabdd 100644
--- a/lib/acl/rte_acl_osdep.h
+++ b/lib/acl/rte_acl_osdep.h
@@ -21,7 +21,7 @@
 #include <stdio.h>
 #include <stdarg.h>
 #include <stdlib.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 /*
  * Common defines.
diff --git a/lib/bbdev/rte_bbdev.c b/lib/bbdev/rte_bbdev.c
index ea644c1f9b..e0ba5b0770 100644
--- a/lib/bbdev/rte_bbdev.c
+++ b/lib/bbdev/rte_bbdev.c
@@ -5,7 +5,7 @@
 #include <stdint.h>
 #include <string.h>
 #include <stdbool.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_common.h>
diff --git a/lib/bpf/bpf_load_elf.c b/lib/bpf/bpf_load_elf.c
index cb33923631..ab8c1c1059 100644
--- a/lib/bpf/bpf_load_elf.c
+++ b/lib/bpf/bpf_load_elf.c
@@ -17,7 +17,7 @@
 
 #include <sys/types.h>
 #include <sys/stat.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <fcntl.h>
 
 #include <libelf.h>
diff --git a/lib/bpf/bpf_pkt.c b/lib/bpf/bpf_pkt.c
index f072fdaaed..826e28810a 100644
--- a/lib/bpf/bpf_pkt.c
+++ b/lib/bpf/bpf_pkt.c
@@ -7,7 +7,7 @@
 #include <errno.h>
 #include <stdint.h>
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_common.h>
diff --git a/lib/cryptodev/cryptodev_pmd.c b/lib/cryptodev/cryptodev_pmd.c
index d79d561bf6..ded6cf908c 100644
--- a/lib/cryptodev/cryptodev_pmd.c
+++ b/lib/cryptodev/cryptodev_pmd.c
@@ -3,7 +3,7 @@
  */
 
 #include <stdlib.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <dev_driver.h>
 #include <eal_export.h>
diff --git a/lib/cryptodev/rte_cryptodev.c b/lib/cryptodev/rte_cryptodev.c
index 829a5d0846..7952ba8fb0 100644
--- a/lib/cryptodev/rte_cryptodev.c
+++ b/lib/cryptodev/rte_cryptodev.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2015-2020 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <ctype.h>
 #include <stdio.h>
 #include <stdlib.h>
diff --git a/lib/distributor/rte_distributor.c b/lib/distributor/rte_distributor.c
index dde7ce2677..5f858a23d0 100644
--- a/lib/distributor/rte_distributor.c
+++ b/lib/distributor/rte_distributor.c
@@ -5,7 +5,7 @@
 #include <stdalign.h>
 #include <stdio.h>
 #include <stdlib.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <string.h>
 #include <eal_export.h>
 #include <rte_mbuf.h>
diff --git a/lib/distributor/rte_distributor_single.c b/lib/distributor/rte_distributor_single.c
index d4b3e12648..41d5c42c05 100644
--- a/lib/distributor/rte_distributor_single.c
+++ b/lib/distributor/rte_distributor_single.c
@@ -3,7 +3,7 @@
  */
 
 #include <stdio.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <rte_mbuf.h>
 #include <rte_memzone.h>
 #include <rte_errno.h>
diff --git a/lib/eal/common/eal_common_bus.c b/lib/eal/common/eal_common_bus.c
index 067e7a8b67..20bae99ddc 100644
--- a/lib/eal/common/eal_common_bus.c
+++ b/lib/eal/common/eal_common_bus.c
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <bus_driver.h>
 #include <rte_debug.h>
diff --git a/lib/eal/common/eal_common_class.c b/lib/eal/common/eal_common_class.c
index 0f10c6894b..b02956118d 100644
--- a/lib/eal/common/eal_common_class.c
+++ b/lib/eal/common/eal_common_class.c
@@ -4,7 +4,7 @@
 
 #include <stdio.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_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 b43b0a4bb3..bfa54fb02d 100644
--- a/lib/eal/common/eal_common_dev.c
+++ b/lib/eal/common/eal_common_dev.c
@@ -6,7 +6,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <bus_driver.h>
 #include <rte_class.h>
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index 42cdef632f..9c5d6df36f 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -10,7 +10,7 @@
 #include <limits.h>
 #include <errno.h>
 #include <getopt.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #ifndef RTE_EXEC_ENV_WINDOWS
 #include <dlfcn.h>
 #include <libgen.h>
diff --git a/lib/eal/common/eal_common_tailqs.c b/lib/eal/common/eal_common_tailqs.c
index fe3ced21c7..150fc4c2a8 100644
--- a/lib/eal/common/eal_common_tailqs.c
+++ b/lib/eal/common/eal_common_tailqs.c
@@ -2,7 +2,7 @@
  * Copyright(c) 2010-2014 Intel Corporation
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdio.h>
 #include <string.h>
 
diff --git a/lib/eal/common/eal_common_trace.c b/lib/eal/common/eal_common_trace.c
index a76dff0017..dcb28ee0fe 100644
--- a/lib/eal/common/eal_common_trace.c
+++ b/lib/eal/common/eal_common_trace.c
@@ -5,7 +5,7 @@
 #include <stdlib.h>
 #include <fnmatch.h>
 #include <pthread.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <regex.h>
 
 #include <rte_common.h>
diff --git a/lib/eal/common/eal_private.h b/lib/eal/common/eal_private.h
index 6340bab8be..501c6daa95 100644
--- a/lib/eal/common/eal_private.h
+++ b/lib/eal/common/eal_private.h
@@ -8,7 +8,7 @@
 #include <stdbool.h>
 #include <stdint.h>
 #include <stdio.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <dev_driver.h>
 #include <rte_bitset.h>
diff --git a/lib/eal/common/malloc_elem.c b/lib/eal/common/malloc_elem.c
index 452b119c20..688c80d48f 100644
--- a/lib/eal/common/malloc_elem.c
+++ b/lib/eal/common/malloc_elem.c
@@ -6,7 +6,7 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_memory.h>
 #include <rte_eal.h>
diff --git a/lib/eal/common/malloc_heap.c b/lib/eal/common/malloc_heap.c
index 39240c261c..f9c56a2fb3 100644
--- a/lib/eal/common/malloc_heap.c
+++ b/lib/eal/common/malloc_heap.c
@@ -6,7 +6,7 @@
 #include <stdlib.h>
 #include <stdio.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_memory.h>
 #include <rte_errno.h>
diff --git a/lib/eal/common/malloc_heap.h b/lib/eal/common/malloc_heap.h
index dfc56d4ae3..1b96f027d2 100644
--- a/lib/eal/common/malloc_heap.h
+++ b/lib/eal/common/malloc_heap.h
@@ -6,7 +6,7 @@
 #define MALLOC_HEAP_H_
 
 #include <stdbool.h>
-#include <sys/queue.h>
+#include <rte_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 388e5a63b6..e779581530 100644
--- a/lib/eal/common/rte_malloc.c
+++ b/lib/eal/common/rte_malloc.c
@@ -6,7 +6,7 @@
 #include <stddef.h>
 #include <stdio.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_errno.h>
 #include <rte_memcpy.h>
diff --git a/lib/eal/freebsd/eal.c b/lib/eal/freebsd/eal.c
index 8b1ba5b99b..1b48dd5459 100644
--- a/lib/eal/freebsd/eal.c
+++ b/lib/eal/freebsd/eal.c
@@ -17,7 +17,7 @@
 #include <errno.h>
 #include <limits.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/stat.h>
 
 #include <rte_common.h>
diff --git a/lib/eal/freebsd/eal_interrupts.c b/lib/eal/freebsd/eal_interrupts.c
index bb2bc529f2..fe48465e5d 100644
--- a/lib/eal/freebsd/eal_interrupts.c
+++ b/lib/eal/freebsd/eal_interrupts.c
@@ -5,7 +5,7 @@
 #include <string.h>
 #include <sys/types.h>
 #include <sys/event.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <unistd.h>
 
 #include <eal_export.h>
diff --git a/lib/eal/freebsd/eal_thread.c b/lib/eal/freebsd/eal_thread.c
index 7ed76ed796..6b33dac339 100644
--- a/lib/eal/freebsd/eal_thread.c
+++ b/lib/eal/freebsd/eal_thread.c
@@ -9,7 +9,7 @@
 #include <unistd.h>
 #include <sched.h>
 #include <pthread_np.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/thr.h>
 
 #include <rte_debug.h>
diff --git a/lib/eal/freebsd/include/rte_os.h b/lib/eal/freebsd/include/rte_os.h
index 94b9275beb..ddc3b4fd2e 100644
--- a/lib/eal/freebsd/include/rte_os.h
+++ b/lib/eal/freebsd/include/rte_os.h
@@ -12,7 +12,7 @@
 
 #include <pthread_np.h>
 #include <stdlib.h>            /* Declares alloca() */
-#include <sys/queue.h>
+#include <rte_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/linux/eal_alarm.c b/lib/eal/linux/eal_alarm.c
index a1433eb867..da5aa44154 100644
--- a/lib/eal/linux/eal_alarm.c
+++ b/lib/eal/linux/eal_alarm.c
@@ -6,7 +6,7 @@
 #include <stdlib.h>
 #include <errno.h>
 #include <pthread.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/time.h>
 #include <sys/timerfd.h>
 
diff --git a/lib/eal/linux/eal_interrupts.c b/lib/eal/linux/eal_interrupts.c
index 4cfaeba7fe..10ef85896d 100644
--- a/lib/eal/linux/eal_interrupts.c
+++ b/lib/eal/linux/eal_interrupts.c
@@ -7,7 +7,7 @@
 #include <stdio.h>
 #include <stdint.h>
 #include <stdlib.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <unistd.h>
 #include <string.h>
 #include <errno.h>
diff --git a/lib/eal/linux/include/rte_os.h b/lib/eal/linux/include/rte_os.h
index 20eff0409a..3c87f52b33 100644
--- a/lib/eal/linux/include/rte_os.h
+++ b/lib/eal/linux/include/rte_os.h
@@ -12,7 +12,7 @@
 
 #include <alloca.h>
 #include <sched.h>
-#include <sys/queue.h>
+#include <rte_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..1e4a5b0d1b 100644
--- a/lib/eal/windows/eal_alarm.c
+++ b/lib/eal/windows/eal_alarm.c
@@ -4,7 +4,7 @@
 
 #include <stdatomic.h>
 #include <stdbool.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_alarm.h>
diff --git a/lib/eal/windows/include/sys/queue.h b/lib/eal/windows/include/sys/queue.h
deleted file mode 100644
index 0da00d46d7..0000000000
--- a/lib/eal/windows/include/sys/queue.h
+++ /dev/null
@@ -1,11 +0,0 @@
-/* SPDX-License-Identifier: BSD-3-Clause
- * Copyright(c) 2026 Stephen Hemminger
- */
-
-/*
- * Windows has no system <sys/queue.h>. The bundled copy has moved to
- * <rte_queue.h>; this stub keeps the existing includes working until they
- * are converted, and is removed in the following commit.
- */
-
-#include <rte_queue.h>
diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c
index 4dfc0ec9a4..34b9585cb8 100644
--- a/lib/efd/rte_efd.c
+++ b/lib/efd/rte_efd.c
@@ -7,7 +7,7 @@
 #include <stdlib.h>
 #include <inttypes.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_cpuflags.h>
diff --git a/lib/ethdev/ethdev_private.h b/lib/ethdev/ethdev_private.h
index 41a0ebe268..a483281cdf 100644
--- a/lib/ethdev/ethdev_private.h
+++ b/lib/ethdev/ethdev_private.h
@@ -5,7 +5,7 @@
 #ifndef _ETH_PRIVATE_H_
 #define _ETH_PRIVATE_H_
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_eal_memconfig.h>
 #include <rte_malloc.h>
diff --git a/lib/ethdev/rte_ethdev.c b/lib/ethdev/rte_ethdev.c
index 9efeaf77cb..49e74aa880 100644
--- a/lib/ethdev/rte_ethdev.c
+++ b/lib/ethdev/rte_ethdev.c
@@ -9,7 +9,7 @@
 #include <stdio.h>
 #include <stdlib.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <bus_driver.h>
 #include <eal_export.h>
diff --git a/lib/fib/rte_fib.c b/lib/fib/rte_fib.c
index 184210f380..92b24749b0 100644
--- a/lib/fib/rte_fib.c
+++ b/lib/fib/rte_fib.c
@@ -5,7 +5,7 @@
 
 #include <stdint.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_eal_memconfig.h>
diff --git a/lib/fib/rte_fib6.c b/lib/fib/rte_fib6.c
index 770becdb61..c6749b034a 100644
--- a/lib/fib/rte_fib6.c
+++ b/lib/fib/rte_fib6.c
@@ -5,7 +5,7 @@
 
 #include <stdint.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_eal_memconfig.h>
diff --git a/lib/gpudev/gpudev.c b/lib/gpudev/gpudev.c
index 4a2335834c..b44f92a04c 100644
--- a/lib/gpudev/gpudev.c
+++ b/lib/gpudev/gpudev.c
@@ -3,7 +3,7 @@
  */
 
 #include <stdlib.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_eal.h>
diff --git a/lib/graph/graph_private.h b/lib/graph/graph_private.h
index 26cdc66371..527a283d7d 100644
--- a/lib/graph/graph_private.h
+++ b/lib/graph/graph_private.h
@@ -6,7 +6,7 @@
 #define _RTE_GRAPH_PRIVATE_H_
 
 #include <inttypes.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_eal.h>
diff --git a/lib/hash/rte_cuckoo_hash.c b/lib/hash/rte_cuckoo_hash.c
index 5d495ae973..f976db6845 100644
--- a/lib/hash/rte_cuckoo_hash.c
+++ b/lib/hash/rte_cuckoo_hash.c
@@ -7,7 +7,7 @@
 #include <stdint.h>
 #include <errno.h>
 #include <stdio.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_common.h>
diff --git a/lib/hash/rte_fbk_hash.c b/lib/hash/rte_fbk_hash.c
index 45d4a13427..fd8270984f 100644
--- a/lib/hash/rte_fbk_hash.c
+++ b/lib/hash/rte_fbk_hash.c
@@ -7,7 +7,7 @@
 #include <string.h>
 #include <stdlib.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_cpuflags.h>
diff --git a/lib/hash/rte_thash.c b/lib/hash/rte_thash.c
index fcd41248b9..5ffd2074f6 100644
--- a/lib/hash/rte_thash.c
+++ b/lib/hash/rte_thash.c
@@ -3,7 +3,7 @@
  */
 
 #include <stdalign.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_thash.h>
diff --git a/lib/ip_frag/ip_frag_common.h b/lib/ip_frag/ip_frag_common.h
index 34be5bb6ab..fdc4ba043a 100644
--- a/lib/ip_frag/ip_frag_common.h
+++ b/lib/ip_frag/ip_frag_common.h
@@ -5,7 +5,7 @@
 #ifndef _IP_FRAG_COMMON_H_
 #define _IP_FRAG_COMMON_H_
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_common.h>
 #include <rte_tailq.h>
diff --git a/lib/log/log.c b/lib/log/log.c
index 8ad5250a13..47a0a5bc74 100644
--- a/lib/log/log.c
+++ b/lib/log/log.c
@@ -11,7 +11,7 @@
 #include <errno.h>
 #include <regex.h>
 #include <fnmatch.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <unistd.h>
 
 #include <eal_export.h>
diff --git a/lib/lpm/rte_lpm.c b/lib/lpm/rte_lpm.c
index 0d1afe0ca1..e97a535929 100644
--- a/lib/lpm/rte_lpm.c
+++ b/lib/lpm/rte_lpm.c
@@ -7,7 +7,7 @@
 #include <stdint.h>
 #include <errno.h>
 #include <stdio.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_log.h>
diff --git a/lib/lpm/rte_lpm6.c b/lib/lpm/rte_lpm6.c
index e23c886766..2e696faec9 100644
--- a/lib/lpm/rte_lpm6.c
+++ b/lib/lpm/rte_lpm6.c
@@ -6,7 +6,7 @@
 #include <stdint.h>
 #include <errno.h>
 #include <stdio.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_log.h>
diff --git a/lib/mbuf/rte_mbuf_dyn.c b/lib/mbuf/rte_mbuf_dyn.c
index 5987c9dee8..73c5924153 100644
--- a/lib/mbuf/rte_mbuf_dyn.c
+++ b/lib/mbuf/rte_mbuf_dyn.c
@@ -3,7 +3,7 @@
  */
 
 #include <stdalign.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <stdint.h>
 #include <limits.h>
 
diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index 817e2b8dc1..57fd282970 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -12,7 +12,7 @@
 #include <unistd.h>
 #include <inttypes.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_common.h>
diff --git a/lib/pipeline/rte_swx_ctl.c b/lib/pipeline/rte_swx_ctl.c
index d24764cbbe..a96546c1eb 100644
--- a/lib/pipeline/rte_swx_ctl.c
+++ b/lib/pipeline/rte_swx_ctl.c
@@ -5,7 +5,7 @@
 #include <stdlib.h>
 #include <string.h>
 #include <stdio.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <unistd.h>
 
 #include <eal_export.h>
diff --git a/lib/pipeline/rte_swx_pipeline_internal.h b/lib/pipeline/rte_swx_pipeline_internal.h
index f527857861..543ece261d 100644
--- a/lib/pipeline/rte_swx_pipeline_internal.h
+++ b/lib/pipeline/rte_swx_pipeline_internal.h
@@ -6,7 +6,7 @@
 
 #include <inttypes.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <rte_bitops.h>
 #include <rte_byteorder.h>
diff --git a/lib/pmu/pmu.c b/lib/pmu/pmu.c
index e4d4f146d1..d372ecf4f1 100644
--- a/lib/pmu/pmu.c
+++ b/lib/pmu/pmu.c
@@ -8,7 +8,7 @@
 #include <stdlib.h>
 #include <unistd.h>
 #include <sys/mman.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <sys/ioctl.h>
 #include <sys/syscall.h>
 
diff --git a/lib/reorder/rte_reorder.c b/lib/reorder/rte_reorder.c
index af5a6d9f01..511b8d502e 100644
--- a/lib/reorder/rte_reorder.c
+++ b/lib/reorder/rte_reorder.c
@@ -4,7 +4,7 @@
 
 #include <stdalign.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_string_fns.h>
diff --git a/lib/rib/rte_rib.c b/lib/rib/rte_rib.c
index 046db131ca..1a5fb8b927 100644
--- a/lib/rib/rte_rib.c
+++ b/lib/rib/rte_rib.c
@@ -5,7 +5,7 @@
 
 #include <stdbool.h>
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_eal_memconfig.h>
diff --git a/lib/rib/rte_rib6.c b/lib/rib/rte_rib6.c
index 918ddbdfd3..30c14eb2ef 100644
--- a/lib/rib/rte_rib6.c
+++ b/lib/rib/rte_rib6.c
@@ -5,7 +5,7 @@
 
 #include <stdbool.h>
 #include <stdint.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_eal_memconfig.h>
diff --git a/lib/ring/rte_ring.c b/lib/ring/rte_ring.c
index 10b52dc679..60b1ebf716 100644
--- a/lib/ring/rte_ring.c
+++ b/lib/ring/rte_ring.c
@@ -13,7 +13,7 @@
 #include <stdint.h>
 #include <inttypes.h>
 #include <errno.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_common.h>
diff --git a/lib/stack/rte_stack.c b/lib/stack/rte_stack.c
index 4c78fe4b4b..c8660fc1cc 100644
--- a/lib/stack/rte_stack.c
+++ b/lib/stack/rte_stack.c
@@ -4,7 +4,7 @@
 
 #include <stdalign.h>
 #include <string.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <eal_export.h>
 #include <rte_string_fns.h>
diff --git a/lib/vhost/fd_man.h b/lib/vhost/fd_man.h
index ed2109f3c8..aa63ad466d 100644
--- a/lib/vhost/fd_man.h
+++ b/lib/vhost/fd_man.h
@@ -6,7 +6,7 @@
 #define _FD_MAN_H_
 #include <pthread.h>
 #include <poll.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 struct fdset;
 
diff --git a/lib/vhost/socket.c b/lib/vhost/socket.c
index 70e582a18d..6e3c1aeaae 100644
--- a/lib/vhost/socket.c
+++ b/lib/vhost/socket.c
@@ -10,7 +10,7 @@
 #include <string.h>
 #include <sys/socket.h>
 #include <sys/un.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <errno.h>
 #include <fcntl.h>
 
diff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c
index bc2dd8d2e1..4f2b7e0013 100644
--- a/lib/vhost/vdpa.c
+++ b/lib/vhost/vdpa.c
@@ -8,7 +8,7 @@
  * Device specific vhost lib
  */
 
-#include <sys/queue.h>
+#include <rte_queue.h>
 
 #include <dev_driver.h>
 #include <eal_export.h>
diff --git a/lib/vhost/vhost.h b/lib/vhost/vhost.h
index ee61f7415e..e405b68e4e 100644
--- a/lib/vhost/vhost.h
+++ b/lib/vhost/vhost.h
@@ -8,7 +8,7 @@
 #include <stdio.h>
 #include <stdbool.h>
 #include <stdlib.h>
-#include <sys/queue.h>
+#include <rte_queue.h>
 #include <unistd.h>
 #include <linux/virtio_net.h>
 #include <sys/socket.h>
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 4/6] build: remove private FOREACH_SAFE definitions
  2026-09-17 17:19 [PATCH 0/6] provide a complete set of BSD list macros Stephen Hemminger
                   ` (2 preceding siblings ...)
  2026-09-17 17:19 ` [PATCH 3/6] build: use rte_queue.h instead of sys/queue.h Stephen Hemminger
@ 2026-09-17 17:19 ` Stephen Hemminger
  2026-09-17 17:19 ` [PATCH 5/6] eal: deprecate RTE_TAILQ and RTE_STAILQ macro wrappers Stephen Hemminger
                   ` (2 subsequent siblings)
  6 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2026-09-17 17:19 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Hemant Agrawal, Sachin Saxena, Jie Liu,
	Kishore Padmanabha, Ajit Khaparde, Vladimir Medvedkin,
	Jingjing Wu, Praveen Shetty, Wei Hu, Devendra Singh Rawat,
	Alok Prasad, Rosen Xu, Konstantin Ananyev, Marat Khalili

Ten files carried their own copy of LIST_FOREACH_SAFE,
SLIST_FOREACH_SAFE, STAILQ_FOREACH_SAFE or TAILQ_FOREACH_SAFE, because
glibc does not provide them. They all now get the macros from
rte_queue.h, so drop the private copies.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 drivers/bus/fslmc/portal/dpaa2_hw_dpio.c  | 7 -------
 drivers/common/sxe2/sxe2_osal.h           | 8 +-------
 drivers/net/bnxt/bnxt_filter.c            | 7 -------
 drivers/net/intel/iavf/iavf_vchnl.c       | 8 +-------
 drivers/net/intel/idpf/base/idpf_osdep.h  | 7 -------
 drivers/net/netvsc/hn_ethdev.c            | 8 +-------
 drivers/net/nfp/nfp_mtr.c                 | 8 +-------
 drivers/net/qede/qede_filter.c            | 8 +-------
 drivers/raw/ifpga/base/opae_intel_max10.c | 8 +-------
 lib/bpf/bpf_validate_debug.c              | 9 +--------
 10 files changed, 7 insertions(+), 71 deletions(-)

diff --git a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
index 9dbf5f413e..fb7ecff468 100644
--- a/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
+++ b/drivers/bus/fslmc/portal/dpaa2_hw_dpio.c
@@ -41,13 +41,6 @@
 #include "dpaa2_hw_dpio.h"
 #include <mc/fsl_dpmng.h>
 
-#ifndef TAILQ_FOREACH_SAFE
-#define	TAILQ_FOREACH_SAFE(var, head, field, tvar)			\
-	for ((var) = TAILQ_FIRST((head));				\
-	    (var) && ((tvar) = TAILQ_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-#endif
-
 #define NUM_HOST_CPUS RTE_MAX_LCORE
 
 RTE_EXPORT_INTERNAL_SYMBOL(dpaa2_io_portal)
diff --git a/drivers/common/sxe2/sxe2_osal.h b/drivers/common/sxe2/sxe2_osal.h
index 9f0ee73b5a..fccc7d35e7 100644
--- a/drivers/common/sxe2/sxe2_osal.h
+++ b/drivers/common/sxe2/sxe2_osal.h
@@ -12,6 +12,7 @@
 #include <stdbool.h>
 
 #include <rte_common.h>
+#include <rte_queue.h>
 #include <rte_cycles.h>
 #include <rte_malloc.h>
 #include <rte_ether.h>
@@ -24,13 +25,6 @@
 #define BIT_WORD(nr)      ((nr) / __BITS_PER_LONG)
 #define BIT_MASK(nr)      (1UL << ((nr) % __BITS_PER_LONG))
 
-#ifndef TAILQ_FOREACH_SAFE
-#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
-	for ((var) = TAILQ_FIRST((head)); \
-		(var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
-		(var) = (tvar))
-#endif
-
 #define upper_32_bits(n) ((uint32_t)(((n) >> 16) >> 16))
 #define lower_32_bits(n) ((uint32_t)((n) & 0xffffffff))
 
diff --git a/drivers/net/bnxt/bnxt_filter.c b/drivers/net/bnxt/bnxt_filter.c
index a4df485965..9a1b294dc0 100644
--- a/drivers/net/bnxt/bnxt_filter.c
+++ b/drivers/net/bnxt/bnxt_filter.c
@@ -18,13 +18,6 @@
 #include "bnxt_vnic.h"
 #include "hsi_struct_def_dpdk.h"
 
-#ifndef STAILQ_FOREACH_SAFE
-#define	STAILQ_FOREACH_SAFE(var, head, field, tvar)			\
-	for ((var) = STAILQ_FIRST((head));				\
-	    (var) && ((tvar) = STAILQ_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-#endif
-
 /*
  * Filter Functions
  */
diff --git a/drivers/net/intel/iavf/iavf_vchnl.c b/drivers/net/intel/iavf/iavf_vchnl.c
index f8fffa7802..e876e830e7 100644
--- a/drivers/net/intel/iavf/iavf_vchnl.c
+++ b/drivers/net/intel/iavf/iavf_vchnl.c
@@ -12,6 +12,7 @@
 #include <inttypes.h>
 #include <rte_byteorder.h>
 #include <rte_common.h>
+#include <rte_queue.h>
 #include <rte_os_shim.h>
 
 #include <rte_debug.h>
@@ -52,13 +53,6 @@ static struct iavf_event_handler event_handler = {
 	.fd = {-1, -1},
 };
 
-#ifndef TAILQ_FOREACH_SAFE
-#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
-	for ((var) = TAILQ_FIRST((head)); \
-		(var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
-	(var) = (tvar))
-#endif
-
 static uint32_t
 iavf_dev_event_handle(void *param __rte_unused)
 {
diff --git a/drivers/net/intel/idpf/base/idpf_osdep.h b/drivers/net/intel/idpf/base/idpf_osdep.h
index 207eefd100..f651559475 100644
--- a/drivers/net/intel/idpf/base/idpf_osdep.h
+++ b/drivers/net/intel/idpf/base/idpf_osdep.h
@@ -342,13 +342,6 @@ idpf_hweight32(u32 num)
 #define LIST_ENTRY_TYPE(type)	   LIST_ENTRY(type)
 #endif
 
-#ifndef LIST_FOREACH_SAFE
-#define LIST_FOREACH_SAFE(var, head, field, tvar)			\
-	for ((var) = LIST_FIRST((head));				\
-	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-#endif
-
 #ifndef LIST_FOR_EACH_ENTRY_SAFE
 #define LIST_FOR_EACH_ENTRY_SAFE(pos, temp, head, entry_type, list)	\
 	LIST_FOREACH_SAFE(pos, head, list, temp)
diff --git a/drivers/net/netvsc/hn_ethdev.c b/drivers/net/netvsc/hn_ethdev.c
index 9a193e4a7a..2c6a6c5857 100644
--- a/drivers/net/netvsc/hn_ethdev.c
+++ b/drivers/net/netvsc/hn_ethdev.c
@@ -17,6 +17,7 @@
 
 #include <rte_ethdev.h>
 #include <rte_memcpy.h>
+#include <rte_queue.h>
 #include <rte_string_fns.h>
 #include <rte_memzone.h>
 #include <rte_devargs.h>
@@ -41,13 +42,6 @@
 #include "hn_nvs.h"
 #include "ndis.h"
 
-#ifndef LIST_FOREACH_SAFE
-#define LIST_FOREACH_SAFE(var, head, field, tvar)			\
-	for ((var) = LIST_FIRST((head));				\
-	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-#endif
-
 /* Spinlock for netvsc_shared_data */
 static rte_spinlock_t netvsc_shared_data_lock = RTE_SPINLOCK_INITIALIZER;
 
diff --git a/drivers/net/nfp/nfp_mtr.c b/drivers/net/nfp/nfp_mtr.c
index 4833ebd881..a89214d6e3 100644
--- a/drivers/net/nfp/nfp_mtr.c
+++ b/drivers/net/nfp/nfp_mtr.c
@@ -7,18 +7,12 @@
 
 #include <rte_alarm.h>
 #include <rte_malloc.h>
+#include <rte_queue.h>
 #include <rte_mtr_driver.h>
 
 #include "flower/nfp_flower_representor.h"
 #include "nfp_logs.h"
 
-#ifndef LIST_FOREACH_SAFE
-#define	LIST_FOREACH_SAFE(var, head, field, tvar)			\
-	for ((var) = LIST_FIRST((head));				\
-	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-#endif
-
 #define NFP_MAX_POLICY_CNT             NFP_MAX_MTR_CNT
 #define NFP_MAX_PROFILE_CNT            NFP_MAX_MTR_CNT
 
diff --git a/drivers/net/qede/qede_filter.c b/drivers/net/qede/qede_filter.c
index cecb58c997..799cd535f7 100644
--- a/drivers/net/qede/qede_filter.c
+++ b/drivers/net/qede/qede_filter.c
@@ -8,17 +8,11 @@
 #include <rte_tcp.h>
 #include <rte_sctp.h>
 #include <rte_errno.h>
+#include <rte_queue.h>
 #include <rte_flow_driver.h>
 
 #include "qede_ethdev.h"
 
-#ifndef SLIST_FOREACH_SAFE
-#define	SLIST_FOREACH_SAFE(var, head, field, tvar)			\
-	for ((var) = SLIST_FIRST((head));				\
-	    (var) && ((tvar) = SLIST_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-#endif
-
 /* VXLAN tunnel classification mapping */
 const struct _qede_udp_tunn_types {
 	uint16_t rte_filter_type;
diff --git a/drivers/raw/ifpga/base/opae_intel_max10.c b/drivers/raw/ifpga/base/opae_intel_max10.c
index 58c884a8d8..1a4db13671 100644
--- a/drivers/raw/ifpga/base/opae_intel_max10.c
+++ b/drivers/raw/ifpga/base/opae_intel_max10.c
@@ -4,15 +4,9 @@
 
 #include "opae_intel_max10.h"
 #include <libfdt.h>
+#include <rte_queue.h>
 #include "opae_osdep.h"
 
-#ifndef TAILQ_FOREACH_SAFE
-#define TAILQ_FOREACH_SAFE(var, head, field, tvar) \
-	for ((var) = TAILQ_FIRST((head)); \
-		(var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
-	(var) = (tvar))
-#endif
-
 int max10_sys_read(struct intel_max10_device *dev,
 	unsigned int offset, unsigned int *val)
 {
diff --git a/lib/bpf/bpf_validate_debug.c b/lib/bpf/bpf_validate_debug.c
index 5d18804a74..5c7c0e19bc 100644
--- a/lib/bpf/bpf_validate_debug.c
+++ b/lib/bpf/bpf_validate_debug.c
@@ -10,19 +10,12 @@
 #include <rte_bpf_validate_debug.h>
 #include <rte_errno.h>
 #include <rte_per_lcore.h>
+#include <rte_queue.h>
 
 #include <errno.h>
 #include <stddef.h>
 #include <stdlib.h>
 
-#ifndef LIST_FOREACH_SAFE
-/* We need this macro which neither Linux nor EAL for Linux include yet. */
-#define	LIST_FOREACH_SAFE(var, head, field, tvar)			\
-	for ((var) = LIST_FIRST((head));				\
-	    (var) && ((tvar) = LIST_NEXT((var), field), 1);		\
-	    (var) = (tvar))
-#endif
-
 #define EVENT_ARRAY_LENGTH RTE_BPF_VALIDATE_DEBUG_EVENT_END
 
 struct rte_bpf_validate_debug_point {
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 5/6] eal: deprecate RTE_TAILQ and RTE_STAILQ macro wrappers
  2026-09-17 17:19 [PATCH 0/6] provide a complete set of BSD list macros Stephen Hemminger
                   ` (3 preceding siblings ...)
  2026-09-17 17:19 ` [PATCH 4/6] build: remove private FOREACH_SAFE definitions Stephen Hemminger
@ 2026-09-17 17:19 ` Stephen Hemminger
  2026-09-17 17:19 ` [PATCH 6/6] devtools: forbid direct use of sys/queue.h Stephen Hemminger
  2026-09-18 11:34 ` [PATCH 0/6] provide a complete set of BSD list macros Marat Khalili
  6 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2026-09-17 17:19 UTC (permalink / raw)
  To: dev
  Cc: Stephen Hemminger, Nithin Dabilpuram, Kiran Kumar K,
	Sunil Kumar Kori, Satha Rao, Harman Kalra, Kishore Padmanabha,
	Ajit Khaparde, Chas Williams, Min Hu (Connor), Gaetan Rivet,
	Praveen Shetty, Bruce Richardson, Vladimir Medvedkin,
	Anatoly Burakov, Rosen Xu, Dariusz Sosnowski,
	Viacheslav Ovsiienko, Bing Zhao, Ori Kam, Suanming Mou,
	Matan Azrad, Dimon Zhao, Leon Yu, Sam Chen, Martin Spinler,
	Andrew Rybchenko, Cristian Dumitrescu, Jie Liu, Junlong Wang,
	Ming Ran, Sivaprasad Tummala, Nicolas Chautru, Akhil Goyal,
	Fan Zhang, Dmitry Kozlyuk, Yipeng Wang, Thomas Monjalon,
	Pavan Nikhilesh, Jerin Jacob, Elena Agostini, Konstantin Ananyev,
	Morten Brørup, Tomasz Duszynski, Maxime Coquelin, Chenbo Xia

The RTE_TAILQ_HEAD, RTE_TAILQ_ENTRY, RTE_TAILQ_FOREACH, RTE_TAILQ_FIRST,
RTE_TAILQ_NEXT, RTE_TAILQ_FOREACH_SAFE, RTE_STAILQ_HEAD and
RTE_STAILQ_ENTRY were added to help the port to Windows.

Now that rte_queue.h provides the same macros on all platforms, they are
no longer necessary.  Keep them in rte_tailq.h as deprecated aliases and
add a deprecation notice for removal in 27.11.

The wrappers are defined in terms of the plain macros only, never the
extended ones, so that they keep working in a translation unit where a
system <sys/queue.h> was included first and rte_queue.h was therefore
suppressed.  That is why RTE_TAILQ_FOREACH_SAFE is open coded rather
than mapped to TAILQ_FOREACH_SAFE, which glibc does not have.

Document why rte_queue.h wins the include guard inside DPDK, and note it
in rte_os.h.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 doc/guides/rel_notes/deprecation.rst         |  8 +++++
 doc/guides/rel_notes/release_26_11.rst       |  8 +++++
 drivers/bus/vdev/vdev.c                      |  2 +-
 drivers/common/cnxk/roc_platform.h           |  2 +-
 drivers/net/bnxt/tf_ulp/bnxt_ulp.c           |  4 +--
 drivers/net/bonding/rte_eth_bond_flow.c      |  2 +-
 drivers/net/cnxk/cnxk_eswitch_flow.c         |  2 +-
 drivers/net/cnxk/cnxk_ethdev.c               |  6 ++--
 drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c |  8 ++---
 drivers/net/failsafe/failsafe_flow.c         |  2 +-
 drivers/net/intel/cpfl/cpfl_flow.c           |  8 ++---
 drivers/net/intel/i40e/i40e_ethdev.c         | 10 +++---
 drivers/net/intel/i40e/i40e_flow.c           |  6 ++--
 drivers/net/intel/i40e/i40e_hash.c           |  2 +-
 drivers/net/intel/i40e/rte_pmd_i40e.c        |  6 ++--
 drivers/net/intel/iavf/iavf_generic_flow.c   | 16 ++++-----
 drivers/net/intel/ice/ice_ethdev.c           |  4 +--
 drivers/net/intel/ice/ice_generic_flow.c     |  8 ++---
 drivers/net/intel/ipn3ke/ipn3ke_flow.c       |  2 +-
 drivers/net/intel/ixgbe/ixgbe_flow.c         |  2 +-
 drivers/net/mlx5/mlx5_flow_dv.c              |  2 +-
 drivers/net/mlx5/mlx5_flow_meter.c           |  2 +-
 drivers/net/nbl/nbl_common/nbl_userdev.c     |  4 +--
 drivers/net/nfb/nfb_ethdev.c                 |  2 +-
 drivers/net/sfc/sfc_flow.c                   |  4 +--
 drivers/net/softnic/rte_eth_softnic_swq.c    |  2 +-
 drivers/net/sxe2/sxe2_dump.c                 |  6 ++--
 drivers/net/sxe2/sxe2_filter.c               | 22 ++++++------
 drivers/net/sxe2/sxe2_vsi.c                  |  2 +-
 drivers/net/zxdh/zxdh_flow.c                 |  2 +-
 drivers/net/zxdh/zxdh_mtr.c                  |  6 ++--
 examples/vm_power_manager/channel_manager.c  |  8 ++---
 lib/bbdev/rte_bbdev.h                        |  2 +-
 lib/cryptodev/cryptodev_pmd.h                |  2 +-
 lib/cryptodev/rte_cryptodev.h                |  2 +-
 lib/eal/common/eal_common_devargs.c          |  4 +--
 lib/eal/common/eal_common_options.c          |  2 +-
 lib/eal/common/eal_common_proc.c             |  2 +-
 lib/eal/freebsd/include/rte_os.h             | 12 ++-----
 lib/eal/include/bus_driver.h                 |  8 ++---
 lib/eal/include/dev_driver.h                 |  4 +--
 lib/eal/include/rte_class.h                  |  4 +--
 lib/eal/include/rte_devargs.h                |  2 +-
 lib/eal/include/rte_queue.h                  |  5 +++
 lib/eal/include/rte_tailq.h                  | 35 ++++++++++++++++----
 lib/eal/linux/include/rte_os.h               | 12 ++-----
 lib/eal/windows/include/rte_os.h             | 31 +++--------------
 lib/efd/rte_efd.c                            |  2 +-
 lib/ethdev/rte_ethdev_core.h                 |  2 +-
 lib/eventdev/rte_event_vector_adapter.c      |  2 +-
 lib/gpudev/gpudev.c                          |  4 +--
 lib/gpudev/gpudev_driver.h                   |  2 +-
 lib/ip_frag/ip_reassembly.h                  |  4 +--
 lib/ip_frag/rte_ip_frag_common.c             |  2 +-
 lib/mempool/rte_mempool.c                    |  4 +--
 lib/mempool/rte_mempool.h                    |  8 ++---
 lib/pmu/pmu.c                                |  2 +-
 lib/power/power_cpufreq.h                    |  2 +-
 lib/power/power_uncore_ops.h                 |  2 +-
 lib/power/rte_power_cpufreq.c                |  8 ++---
 lib/power/rte_power_uncore.c                 |  6 ++--
 lib/table/rte_swx_table.h                    |  4 +--
 lib/table/rte_swx_table_selector.h           |  4 +--
 lib/vhost/iotlb.c                            | 14 ++++----
 lib/vhost/vdpa.c                             |  2 +-
 lib/vhost/vdpa_driver.h                      |  2 +-
 66 files changed, 191 insertions(+), 182 deletions(-)

diff --git a/doc/guides/rel_notes/deprecation.rst b/doc/guides/rel_notes/deprecation.rst
index 6ad7698c6b..8a9c4f2992 100644
--- a/doc/guides/rel_notes/deprecation.rst
+++ b/doc/guides/rel_notes/deprecation.rst
@@ -177,3 +177,11 @@ Deprecation Notices
   after a VF reset, but this is of questionable value
   since most applications expect their settings to be preserved
   transparently across a reset.
+
+* eal: The ``RTE_TAILQ_HEAD``, ``RTE_TAILQ_ENTRY``, ``RTE_TAILQ_FOREACH``,
+  ``RTE_TAILQ_FIRST``, ``RTE_TAILQ_NEXT``, ``RTE_TAILQ_FOREACH_SAFE``,
+  ``RTE_STAILQ_HEAD`` and ``RTE_STAILQ_ENTRY`` macros in ``rte_tailq.h``
+  are deprecated and will be removed in DPDK 27.11.
+  They existed only because Windows had no ``<sys/queue.h>``.
+  Use the equivalent ``TAILQ_`` and ``STAILQ_`` macros from
+  ``<rte_queue.h>``, which are now available on all platforms.
diff --git a/doc/guides/rel_notes/release_26_11.rst b/doc/guides/rel_notes/release_26_11.rst
index 0701fbee8d..892d55a7eb 100644
--- a/doc/guides/rel_notes/release_26_11.rst
+++ b/doc/guides/rel_notes/release_26_11.rst
@@ -130,6 +130,14 @@ API Changes
   * ``rte_tel_data_add_dict_uint_hex``
   * ``rte_telemetry_register_cmd_arg``
 
+* eal: Deprecated the ``RTE_TAILQ_HEAD``, ``RTE_TAILQ_ENTRY``,
+  ``RTE_TAILQ_FOREACH``, ``RTE_TAILQ_FIRST``, ``RTE_TAILQ_NEXT``,
+  ``RTE_TAILQ_FOREACH_SAFE``, ``RTE_STAILQ_HEAD`` and ``RTE_STAILQ_ENTRY``
+  macros.
+  They existed only because Windows had no ``<sys/queue.h>``.
+  Use the standard ``TAILQ_`` and ``STAILQ_`` macros from ``rte_queue.h``.
+  The macros are kept as aliases and will be removed in DPDK 27.11.
+
 
 ABI Changes
 -----------
diff --git a/drivers/bus/vdev/vdev.c b/drivers/bus/vdev/vdev.c
index 04702a7270..4f30a295d5 100644
--- a/drivers/bus/vdev/vdev.c
+++ b/drivers/bus/vdev/vdev.c
@@ -103,7 +103,7 @@ rte_vdev_remove_custom_scan(rte_vdev_scan_callback callback, void *user_arg)
 	struct vdev_custom_scan *custom_scan, *tmp_scan;
 
 	rte_spinlock_lock(&vdev_custom_scan_lock);
-	RTE_TAILQ_FOREACH_SAFE(custom_scan, &vdev_custom_scans, next,
+	TAILQ_FOREACH_SAFE(custom_scan, &vdev_custom_scans, next,
 				tmp_scan) {
 		if (custom_scan->callback != callback ||
 				(custom_scan->user_arg != (void *)-1 &&
diff --git a/drivers/common/cnxk/roc_platform.h b/drivers/common/cnxk/roc_platform.h
index 24f0c41cbf..5c9776ab61 100644
--- a/drivers/common/cnxk/roc_platform.h
+++ b/drivers/common/cnxk/roc_platform.h
@@ -66,7 +66,7 @@
 #define PLT_ALIGN_FLOOR		 RTE_ALIGN_FLOOR
 #define PLT_INIT		 RTE_INIT
 #define PLT_MAX_ETHPORTS	 RTE_MAX_ETHPORTS
-#define PLT_TAILQ_FOREACH_SAFE	 RTE_TAILQ_FOREACH_SAFE
+#define PLT_TAILQ_FOREACH_SAFE	 TAILQ_FOREACH_SAFE
 
 #ifndef PLT_ETHER_ADDR_LEN
 #define PLT_ETHER_ADDR_LEN RTE_ETHER_ADDR_LEN
diff --git a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
index a75da8aa19..1721f97a38 100644
--- a/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
+++ b/drivers/net/bnxt/tf_ulp/bnxt_ulp.c
@@ -649,7 +649,7 @@ bnxt_ulp_cntxt_list_del(struct bnxt_ulp_context *ulp_ctx)
 	struct ulp_context_list_entry	*entry, *temp;
 
 	rte_spinlock_lock(&bnxt_ulp_ctxt_lock);
-	RTE_TAILQ_FOREACH_SAFE(entry, &ulp_cntx_list, next, temp) {
+	TAILQ_FOREACH_SAFE(entry, &ulp_cntx_list, next, temp) {
 		if (entry->ulp_ctx == ulp_ctx) {
 			TAILQ_REMOVE(&ulp_cntx_list, entry, next);
 			rte_free(entry);
@@ -666,7 +666,7 @@ bnxt_ulp_cntxt_list_count(void)
 	int count_1 = 0;
 
 	rte_spinlock_lock(&bnxt_ulp_ctxt_lock);
-	RTE_TAILQ_FOREACH_SAFE(entry, &ulp_cntx_list, next, temp) {
+	TAILQ_FOREACH_SAFE(entry, &ulp_cntx_list, next, temp) {
 		count_1++;
 	}
 	rte_spinlock_unlock(&bnxt_ulp_ctxt_lock);
diff --git a/drivers/net/bonding/rte_eth_bond_flow.c b/drivers/net/bonding/rte_eth_bond_flow.c
index b2a7d397c3..9e267078b0 100644
--- a/drivers/net/bonding/rte_eth_bond_flow.c
+++ b/drivers/net/bonding/rte_eth_bond_flow.c
@@ -157,7 +157,7 @@ bond_flow_flush(struct rte_eth_dev *dev, struct rte_flow_error *err)
 	/* Destroy all bond flows from its members instead of flushing them to
 	 * keep the LACP flow or any other external flows.
 	 */
-	RTE_TAILQ_FOREACH_SAFE(flow, &internals->flow_list, next, tmp) {
+	TAILQ_FOREACH_SAFE(flow, &internals->flow_list, next, tmp) {
 		lret = bond_flow_destroy(dev, flow, err);
 		if (unlikely(lret != 0))
 			ret = lret;
diff --git a/drivers/net/cnxk/cnxk_eswitch_flow.c b/drivers/net/cnxk/cnxk_eswitch_flow.c
index 06077bfe92..767b666e86 100644
--- a/drivers/net/cnxk/cnxk_eswitch_flow.c
+++ b/drivers/net/cnxk/cnxk_eswitch_flow.c
@@ -21,7 +21,7 @@ cnxk_eswitch_flow_rules_remove_list(struct cnxk_eswitch_dev *eswitch_dev, struct
 	struct roc_npc_flow *flow, *tvar;
 	int rc = 0;
 
-	RTE_TAILQ_FOREACH_SAFE(flow, list, next, tvar) {
+	TAILQ_FOREACH_SAFE(flow, list, next, tvar) {
 		plt_esw_dbg("Removing flow %d", flow->mcam_id);
 		rc = roc_eswitch_npc_mcam_delete_rule(&eswitch_dev->npc, flow,
 						      hw_func);
diff --git a/drivers/net/cnxk/cnxk_ethdev.c b/drivers/net/cnxk/cnxk_ethdev.c
index c41959173b..5317d48fd2 100644
--- a/drivers/net/cnxk/cnxk_ethdev.c
+++ b/drivers/net/cnxk/cnxk_ethdev.c
@@ -464,7 +464,7 @@ nix_meter_fini(struct cnxk_eth_dev *dev)
 	uint32_t i;
 	int rc = 0;
 
-	RTE_TAILQ_FOREACH_SAFE(mtr, fms, next, next_mtr) {
+	TAILQ_FOREACH_SAFE(mtr, fms, next, next_mtr) {
 		for (i = 0; i < mtr->rq_num; i++) {
 			rq = &dev->rqs[mtr->rq_id[i]];
 			rc |= roc_nix_bpf_ena_dis(nix, mtr->bpf_id, rq, false);
@@ -512,7 +512,7 @@ nix_security_release(struct cnxk_eth_dev *dev)
 	if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SECURITY || dev->ip_reass_en) {
 		/* Destroy inbound sessions */
 		tvar = NULL;
-		RTE_TAILQ_FOREACH_SAFE(eth_sec, &dev->inb.list, entry, tvar)
+		TAILQ_FOREACH_SAFE(eth_sec, &dev->inb.list, entry, tvar)
 			cnxk_eth_sec_ops.session_destroy(eth_dev,
 							 eth_sec->sess);
 
@@ -534,7 +534,7 @@ nix_security_release(struct cnxk_eth_dev *dev)
 	    dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SECURITY) {
 		/* Destroy outbound sessions */
 		tvar = NULL;
-		RTE_TAILQ_FOREACH_SAFE(eth_sec, &dev->outb.list, entry, tvar)
+		TAILQ_FOREACH_SAFE(eth_sec, &dev->outb.list, entry, tvar)
 			cnxk_eth_sec_ops.session_destroy(eth_dev,
 							 eth_sec->sess);
 
diff --git a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
index 0c1533e3d7..1104e0ec81 100644
--- a/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
+++ b/drivers/net/cnxk/cnxk_ethdev_sec_telemetry.c
@@ -275,7 +275,7 @@ ethdev_sec_tel_handle_sa_info(const char *cmd __rte_unused, const char *params,
 	i = 0;
 	if (dev->tx_offloads & RTE_ETH_TX_OFFLOAD_SECURITY) {
 		tvar = NULL;
-		RTE_TAILQ_FOREACH_SAFE(eth_sec, &dev->outb.list, entry, tvar) {
+		TAILQ_FOREACH_SAFE(eth_sec, &dev->outb.list, entry, tvar) {
 			if (eth_sec->sa_idx == sa_idx) {
 				rte_tel_data_add_dict_int(d, "outb_sa", 1);
 				if (roc_model_is_cn10k())
@@ -292,7 +292,7 @@ ethdev_sec_tel_handle_sa_info(const char *cmd __rte_unused, const char *params,
 	i = 0;
 	if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SECURITY) {
 		tvar = NULL;
-		RTE_TAILQ_FOREACH_SAFE(eth_sec, &dev->inb.list, entry, tvar) {
+		TAILQ_FOREACH_SAFE(eth_sec, &dev->inb.list, entry, tvar) {
 			if (eth_sec->sa_idx == sa_idx) {
 				rte_tel_data_add_dict_int(d, "inb_sa", 1);
 				if (roc_model_is_cn10k())
@@ -353,7 +353,7 @@ ethdev_sec_tel_handle_info(const char *cmd __rte_unused, const char *params,
 
 	if (dev->tx_offloads & RTE_ETH_TX_OFFLOAD_SECURITY) {
 		tvar = NULL;
-		RTE_TAILQ_FOREACH_SAFE(eth_sec, &dev->outb.list, entry, tvar) {
+		TAILQ_FOREACH_SAFE(eth_sec, &dev->outb.list, entry, tvar) {
 			if (eth_sec->sa_idx < min_outb_sa)
 				min_outb_sa = eth_sec->sa_idx;
 			if (eth_sec->sa_idx > max_outb_sa)
@@ -370,7 +370,7 @@ ethdev_sec_tel_handle_info(const char *cmd __rte_unused, const char *params,
 
 	if (dev->rx_offloads & RTE_ETH_RX_OFFLOAD_SECURITY) {
 		tvar = NULL;
-		RTE_TAILQ_FOREACH_SAFE(eth_sec, &dev->inb.list, entry, tvar) {
+		TAILQ_FOREACH_SAFE(eth_sec, &dev->inb.list, entry, tvar) {
 			if (eth_sec->sa_idx < min_inb_sa)
 				min_inb_sa = eth_sec->sa_idx;
 			if (eth_sec->sa_idx > max_inb_sa)
diff --git a/drivers/net/failsafe/failsafe_flow.c b/drivers/net/failsafe/failsafe_flow.c
index 5baa11460f..7b54644e38 100644
--- a/drivers/net/failsafe/failsafe_flow.c
+++ b/drivers/net/failsafe/failsafe_flow.c
@@ -186,7 +186,7 @@ fs_flow_flush(struct rte_eth_dev *dev,
 			return ret;
 		}
 	}
-	RTE_TAILQ_FOREACH_SAFE(flow, &PRIV(dev)->flow_list, next, tmp) {
+	TAILQ_FOREACH_SAFE(flow, &PRIV(dev)->flow_list, next, tmp) {
 		TAILQ_REMOVE(&PRIV(dev)->flow_list, flow, next);
 		fs_flow_release(&flow);
 	}
diff --git a/drivers/net/intel/cpfl/cpfl_flow.c b/drivers/net/intel/cpfl/cpfl_flow.c
index 3ba6c0f0e7..fd847d76b6 100644
--- a/drivers/net/intel/cpfl/cpfl_flow.c
+++ b/drivers/net/intel/cpfl/cpfl_flow.c
@@ -27,7 +27,7 @@ cpfl_flow_engine_match(struct rte_eth_dev *dev,
 	struct cpfl_flow_engine *engine = NULL;
 	void *temp;
 
-	RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
+	TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
 		if (!engine->parse_pattern_action)
 			continue;
 
@@ -46,7 +46,7 @@ cpfl_flow_engine_init(struct cpfl_adapter_ext *adapter)
 	void *temp;
 	int ret;
 
-	RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
+	TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
 		if (!engine->init) {
 			PMD_INIT_LOG(ERR, "Invalid engine type (%d)",
 				     engine->type);
@@ -70,7 +70,7 @@ cpfl_flow_engine_uninit(struct cpfl_adapter_ext *adapter)
 	struct cpfl_flow_engine *engine = NULL;
 	void *temp;
 
-	RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
+	TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
 		if (engine->uninit)
 			engine->uninit(adapter);
 	}
@@ -244,7 +244,7 @@ cpfl_flow_flush(struct rte_eth_dev *dev,
 	void *temp;
 	int ret = 0;
 
-	RTE_TAILQ_FOREACH_SAFE(p_flow, &itf->flow_list, next, temp) {
+	TAILQ_FOREACH_SAFE(p_flow, &itf->flow_list, next, temp) {
 		ret = cpfl_flow_destroy(dev, p_flow, error);
 		if (ret) {
 			PMD_DRV_LOG(ERR, "Failed to flush flows");
diff --git a/drivers/net/intel/i40e/i40e_ethdev.c b/drivers/net/intel/i40e/i40e_ethdev.c
index b6b2d291ee..32a0f51973 100644
--- a/drivers/net/intel/i40e/i40e_ethdev.c
+++ b/drivers/net/intel/i40e/i40e_ethdev.c
@@ -4195,7 +4195,7 @@ i40e_vlan_offload_set(struct rte_eth_dev *dev, int mask)
 		 * recommended to be used in firmware v8.6.
 		 */
 		/* Remove all existing mac */
-		RTE_TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) {
+		TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) {
 			mac_filter[i] = f->mac_info;
 			ret = i40e_vsi_delete_mac(vsi, &f->mac_info.mac_addr);
 			if (ret)
@@ -5570,7 +5570,7 @@ i40e_vsi_release(struct i40e_vsi *vsi)
 
 	/* VSI has child to attach, release child first */
 	if (vsi->veb) {
-		RTE_TAILQ_FOREACH_SAFE(vsi_list, &vsi->veb->head, list, temp) {
+		TAILQ_FOREACH_SAFE(vsi_list, &vsi->veb->head, list, temp) {
 			if (i40e_vsi_release(vsi_list->vsi) != I40E_SUCCESS)
 				return -1;
 		}
@@ -5578,7 +5578,7 @@ i40e_vsi_release(struct i40e_vsi *vsi)
 	}
 
 	if (vsi->floating_veb) {
-		RTE_TAILQ_FOREACH_SAFE(vsi_list, &vsi->floating_veb->head,
+		TAILQ_FOREACH_SAFE(vsi_list, &vsi->floating_veb->head,
 			list, temp) {
 			if (i40e_vsi_release(vsi_list->vsi) != I40E_SUCCESS)
 				return -1;
@@ -5587,7 +5587,7 @@ i40e_vsi_release(struct i40e_vsi *vsi)
 
 	/* Remove all macvlan filters of the VSI */
 	i40e_vsi_remove_all_macvlan_filter(vsi);
-	RTE_TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp)
+	TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp)
 		rte_free(f);
 
 	if (vsi->type != I40E_VSI_MAIN &&
@@ -6230,7 +6230,7 @@ i40e_vsi_config_vlan_filter(struct i40e_vsi *vsi, bool on)
 	i = 0;
 
 	/* Remove all existing mac */
-	RTE_TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) {
+	TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) {
 		mac_filter[i] = f->mac_info;
 		ret = i40e_vsi_delete_mac(vsi, &f->mac_info.mac_addr);
 		if (ret) {
diff --git a/drivers/net/intel/i40e/i40e_flow.c b/drivers/net/intel/i40e/i40e_flow.c
index 6cb5219a80..5eb31876aa 100644
--- a/drivers/net/intel/i40e/i40e_flow.c
+++ b/drivers/net/intel/i40e/i40e_flow.c
@@ -4216,7 +4216,7 @@ i40e_flow_flush_fdir_filter(struct i40e_pf *pf)
 		}
 
 		/* Delete FDIR flows in flow list. */
-		RTE_TAILQ_FOREACH_SAFE(flow, &pf->flow_list, node, temp) {
+		TAILQ_FOREACH_SAFE(flow, &pf->flow_list, node, temp) {
 			if (flow->filter_type == RTE_ETH_FILTER_FDIR) {
 				TAILQ_REMOVE(&pf->flow_list, flow, node);
 			}
@@ -4271,7 +4271,7 @@ i40e_flow_flush_ethertype_filter(struct i40e_pf *pf)
 	}
 
 	/* Delete ethertype flows in flow list. */
-	RTE_TAILQ_FOREACH_SAFE(flow, &pf->flow_list, node, temp) {
+	TAILQ_FOREACH_SAFE(flow, &pf->flow_list, node, temp) {
 		if (flow->filter_type == RTE_ETH_FILTER_ETHERTYPE) {
 			TAILQ_REMOVE(&pf->flow_list, flow, node);
 			rte_free(flow);
@@ -4299,7 +4299,7 @@ i40e_flow_flush_tunnel_filter(struct i40e_pf *pf)
 	}
 
 	/* Delete tunnel flows in flow list. */
-	RTE_TAILQ_FOREACH_SAFE(flow, &pf->flow_list, node, temp) {
+	TAILQ_FOREACH_SAFE(flow, &pf->flow_list, node, temp) {
 		if (flow->filter_type == RTE_ETH_FILTER_TUNNEL) {
 			TAILQ_REMOVE(&pf->flow_list, flow, node);
 			rte_free(flow);
diff --git a/drivers/net/intel/i40e/i40e_hash.c b/drivers/net/intel/i40e/i40e_hash.c
index f24b7540f0..db8c4a9b17 100644
--- a/drivers/net/intel/i40e/i40e_hash.c
+++ b/drivers/net/intel/i40e/i40e_hash.c
@@ -1503,7 +1503,7 @@ i40e_hash_filter_flush(struct i40e_pf *pf)
 {
 	struct rte_flow *flow, *next;
 
-	RTE_TAILQ_FOREACH_SAFE(flow, &pf->flow_list, node, next) {
+	TAILQ_FOREACH_SAFE(flow, &pf->flow_list, node, next) {
 		if (flow->filter_type != RTE_ETH_FILTER_HASH)
 			continue;
 
diff --git a/drivers/net/intel/i40e/rte_pmd_i40e.c b/drivers/net/intel/i40e/rte_pmd_i40e.c
index 2e7943ef8b..dd1358ce7a 100644
--- a/drivers/net/intel/i40e/rte_pmd_i40e.c
+++ b/drivers/net/intel/i40e/rte_pmd_i40e.c
@@ -221,7 +221,7 @@ i40e_vsi_rm_mac_filter(struct i40e_vsi *vsi)
 	void *temp;
 
 	/* remove all the MACs */
-	RTE_TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) {
+	TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) {
 		vlan_num = vsi->vlan_num;
 		filter_type = f->mac_info.filter_type;
 		if (filter_type == I40E_MACVLAN_PERFECT_MATCH ||
@@ -279,7 +279,7 @@ i40e_vsi_restore_mac_filter(struct i40e_vsi *vsi)
 	void *temp;
 
 	/* restore all the MACs */
-	RTE_TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) {
+	TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp) {
 		if (f->mac_info.filter_type == I40E_MACVLAN_PERFECT_MATCH ||
 		    f->mac_info.filter_type == I40E_MACVLAN_HASH_MATCH) {
 			/**
@@ -572,7 +572,7 @@ rte_pmd_i40e_set_vf_mac_addr(uint16_t port, uint16_t vf_id,
 	rte_ether_addr_copy(mac_addr, &vf->mac_addr);
 
 	/* Remove all existing mac */
-	RTE_TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp)
+	TAILQ_FOREACH_SAFE(f, &vsi->mac_list, next, temp)
 		if (i40e_vsi_delete_mac(vsi, &f->mac_info.mac_addr)
 				!= I40E_SUCCESS)
 			PMD_DRV_LOG(WARNING, "Delete MAC failed");
diff --git a/drivers/net/intel/iavf/iavf_generic_flow.c b/drivers/net/intel/iavf/iavf_generic_flow.c
index 38c1261bd9..e45abb2928 100644
--- a/drivers/net/intel/iavf/iavf_generic_flow.c
+++ b/drivers/net/intel/iavf/iavf_generic_flow.c
@@ -1817,7 +1817,7 @@ iavf_flow_init(struct iavf_adapter *ad)
 	TAILQ_INIT(&vf->ipsec_crypto_parser_list);
 	rte_spinlock_init(&vf->flow_ops_lock);
 
-	RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
+	TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
 		if (engine->init == NULL) {
 			PMD_INIT_LOG(ERR, "Invalid engine type (%d)",
 				     engine->type);
@@ -1843,7 +1843,7 @@ iavf_flow_uninit(struct iavf_adapter *ad)
 	struct iavf_flow_parser_node *p_parser;
 	void *temp;
 
-	RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
+	TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
 		if (engine->uninit)
 			engine->uninit(ad);
 	}
@@ -1895,7 +1895,7 @@ iavf_register_parser(struct iavf_flow_parser *parser,
 		TAILQ_INSERT_TAIL(list, parser_node, node);
 	} else if (parser->engine->type == IAVF_FLOW_ENGINE_FDIR) {
 		list = &vf->dist_parser_list;
-		RTE_TAILQ_FOREACH_SAFE(existing_node, list, node, temp) {
+		TAILQ_FOREACH_SAFE(existing_node, list, node, temp) {
 			if (existing_node->parser->engine->type ==
 			    IAVF_FLOW_ENGINE_FSUB) {
 				TAILQ_INSERT_AFTER(list, existing_node,
@@ -1939,7 +1939,7 @@ iavf_unregister_parser(struct iavf_flow_parser *parser,
 	if (list == NULL)
 		return;
 
-	RTE_TAILQ_FOREACH_SAFE(p_parser, list, node, temp) {
+	TAILQ_FOREACH_SAFE(p_parser, list, node, temp) {
 		if (p_parser->parser->engine->type == parser->engine->type) {
 			TAILQ_REMOVE(list, p_parser, node);
 			rte_free(p_parser);
@@ -2085,7 +2085,7 @@ iavf_parse_engine_create(struct iavf_adapter *ad,
 	void *temp;
 	void *meta = NULL;
 
-	RTE_TAILQ_FOREACH_SAFE(parser_node, parser_list, node, temp) {
+	TAILQ_FOREACH_SAFE(parser_node, parser_list, node, temp) {
 		if (parser_node->parser->parse_pattern_action(ad,
 				parser_node->parser->array,
 				parser_node->parser->array_len,
@@ -2115,7 +2115,7 @@ iavf_parse_engine_validate(struct iavf_adapter *ad,
 	void *temp;
 	void *meta = NULL;
 
-	RTE_TAILQ_FOREACH_SAFE(parser_node, parser_list, node, temp) {
+	TAILQ_FOREACH_SAFE(parser_node, parser_list, node, temp) {
 		if (parser_node->parser->parse_pattern_action(ad,
 				parser_node->parser->array,
 				parser_node->parser->array_len,
@@ -2261,7 +2261,7 @@ iavf_flow_is_valid(struct rte_flow *flow)
 		return true;
 
 	if (flow->engine) {
-		RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
+		TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
 			if (engine == flow->engine)
 				return true;
 		}
@@ -2322,7 +2322,7 @@ iavf_flow_flush(struct rte_eth_dev *dev,
 	void *temp;
 	int ret = 0;
 
-	RTE_TAILQ_FOREACH_SAFE(p_flow, &vf->flow_list, node, temp) {
+	TAILQ_FOREACH_SAFE(p_flow, &vf->flow_list, node, temp) {
 		ret = iavf_flow_destroy(dev, p_flow, error);
 		if (ret) {
 			PMD_DRV_LOG(ERR, "Failed to flush flows");
diff --git a/drivers/net/intel/ice/ice_ethdev.c b/drivers/net/intel/ice/ice_ethdev.c
index 76b8ff0a72..6f4b26dc9f 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -1373,7 +1373,7 @@ ice_remove_all_mac_vlan_filters(struct ice_vsi *vsi)
 	if (!vsi || !vsi->mac_num)
 		return -EINVAL;
 
-	RTE_TAILQ_FOREACH_SAFE(m_f, &vsi->mac_list, next, temp) {
+	TAILQ_FOREACH_SAFE(m_f, &vsi->mac_list, next, temp) {
 		ret = ice_remove_mac_filter(vsi, &m_f->mac_info.mac_addr);
 		if (ret != ICE_SUCCESS) {
 			ret = -EINVAL;
@@ -1384,7 +1384,7 @@ ice_remove_all_mac_vlan_filters(struct ice_vsi *vsi)
 	if (vsi->vlan_num == 0)
 		return 0;
 
-	RTE_TAILQ_FOREACH_SAFE(v_f, &vsi->vlan_list, next, temp) {
+	TAILQ_FOREACH_SAFE(v_f, &vsi->vlan_list, next, temp) {
 		ret = ice_remove_vlan_filter(vsi, &v_f->vlan_info.vlan);
 		if (ret != ICE_SUCCESS) {
 			ret = -EINVAL;
diff --git a/drivers/net/intel/ice/ice_generic_flow.c b/drivers/net/intel/ice/ice_generic_flow.c
index 23076b23d9..929dc94764 100644
--- a/drivers/net/intel/ice/ice_generic_flow.c
+++ b/drivers/net/intel/ice/ice_generic_flow.c
@@ -1998,7 +1998,7 @@ ice_flow_init(struct ice_adapter *ad)
 			ice_parser_dvm_set(ad->psr, false);
 	}
 
-	RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
+	TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
 		if (engine->init == NULL) {
 			PMD_INIT_LOG(ERR, "Invalid engine type (%d)",
 					engine->type);
@@ -2028,7 +2028,7 @@ ice_flow_uninit(struct ice_adapter *ad)
 	struct rte_flow *p_flow;
 	void *temp;
 
-	RTE_TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
+	TAILQ_FOREACH_SAFE(engine, &engine_list, node, temp) {
 		if (ICE_FLOW_ENGINE_DISABLED(ad->disabled_engine_mask, engine->type)) {
 			PMD_DRV_LOG(DEBUG, "Engine %d disabled skip it", engine->type);
 			continue;
@@ -2556,7 +2556,7 @@ ice_flow_flush(struct rte_eth_dev *dev,
 	void *temp;
 	int ret = 0;
 
-	RTE_TAILQ_FOREACH_SAFE(p_flow, &pf->flow_list, node, temp) {
+	TAILQ_FOREACH_SAFE(p_flow, &pf->flow_list, node, temp) {
 		ret = ice_flow_destroy(dev, p_flow, error);
 		if (ret) {
 			PMD_DRV_LOG(ERR, "Failed to flush flows");
@@ -2697,7 +2697,7 @@ ice_flow_redirect(struct ice_adapter *ad,
 
 	rte_spinlock_lock(&pf->flow_ops_lock);
 
-	RTE_TAILQ_FOREACH_SAFE(p_flow, &pf->flow_list, node, temp) {
+	TAILQ_FOREACH_SAFE(p_flow, &pf->flow_list, node, temp) {
 		if (!p_flow->engine->redirect)
 			continue;
 		ret = p_flow->engine->redirect(ad, p_flow, rd);
diff --git a/drivers/net/intel/ipn3ke/ipn3ke_flow.c b/drivers/net/intel/ipn3ke/ipn3ke_flow.c
index 3ee089a416..a74e729a66 100644
--- a/drivers/net/intel/ipn3ke/ipn3ke_flow.c
+++ b/drivers/net/intel/ipn3ke/ipn3ke_flow.c
@@ -1230,7 +1230,7 @@ ipn3ke_flow_flush(struct rte_eth_dev *dev,
 	struct ipn3ke_hw *hw = IPN3KE_DEV_PRIVATE_TO_HW(dev);
 	struct rte_flow *flow, *temp;
 
-	RTE_TAILQ_FOREACH_SAFE(flow, &hw->flow_list, next, temp) {
+	TAILQ_FOREACH_SAFE(flow, &hw->flow_list, next, temp) {
 		TAILQ_REMOVE(&hw->flow_list, flow, next);
 		rte_free(flow);
 	}
diff --git a/drivers/net/intel/ixgbe/ixgbe_flow.c b/drivers/net/intel/ixgbe/ixgbe_flow.c
index b3c4b10e75..4899be44af 100644
--- a/drivers/net/intel/ixgbe/ixgbe_flow.c
+++ b/drivers/net/intel/ixgbe/ixgbe_flow.c
@@ -2783,7 +2783,7 @@ ixgbe_filterlist_flush(struct rte_eth_dev *dev)
 	struct ixgbe_adapter *adapter = IXGBE_DEV_PRIVATE_TO_ADAPTER(dev->data->dev_private);
 	struct ixgbe_filter_ele_base *ele, *tmp;
 
-	RTE_TAILQ_FOREACH_SAFE(ele, &adapter->flow_list, entries, tmp) {
+	TAILQ_FOREACH_SAFE(ele, &adapter->flow_list, entries, tmp) {
 		struct ixgbe_flow_mem *ixgbe_flow_mem_ptr =
 			(struct ixgbe_flow_mem *)ele;
 		struct rte_flow *flow = ixgbe_flow_mem_ptr->flow;
diff --git a/drivers/net/mlx5/mlx5_flow_dv.c b/drivers/net/mlx5/mlx5_flow_dv.c
index 0866b425b4..0b26fab216 100644
--- a/drivers/net/mlx5/mlx5_flow_dv.c
+++ b/drivers/net/mlx5/mlx5_flow_dv.c
@@ -17516,7 +17516,7 @@ __flow_dv_destroy_sub_policy_rules(struct rte_eth_dev *dev,
 		    policy->act_cnt[i].fate_action == MLX5_FLOW_FATE_MTR)
 			next_fm = mlx5_flow_meter_find(priv,
 					policy->act_cnt[i].next_mtr_id, NULL);
-		RTE_TAILQ_FOREACH_SAFE(color_rule, &sub_policy->color_rules[i],
+		TAILQ_FOREACH_SAFE(color_rule, &sub_policy->color_rules[i],
 				   next_port, tmp) {
 			claim_zero(mlx5_flow_os_destroy_flow(color_rule->rule));
 			tbl = container_of(color_rule->matcher->tbl,
diff --git a/drivers/net/mlx5/mlx5_flow_meter.c b/drivers/net/mlx5/mlx5_flow_meter.c
index e7afcf5399..56babbff7f 100644
--- a/drivers/net/mlx5/mlx5_flow_meter.c
+++ b/drivers/net/mlx5/mlx5_flow_meter.c
@@ -2747,7 +2747,7 @@ mlx5_flow_meter_flush(struct rte_eth_dev *dev, struct rte_mtr_error *error)
 			priv->mtr_idx_tbl = NULL;
 		}
 	} else {
-		RTE_TAILQ_FOREACH_SAFE(legacy_fm, fms, next, tmp) {
+		TAILQ_FOREACH_SAFE(legacy_fm, fms, next, tmp) {
 			fm = &legacy_fm->fm;
 			if (mlx5_flow_meter_params_flush(dev, fm, 0))
 				return -rte_mtr_error_set(error, EINVAL,
diff --git a/drivers/net/nbl/nbl_common/nbl_userdev.c b/drivers/net/nbl/nbl_common/nbl_userdev.c
index 96f0d2e264..b95fad6c47 100644
--- a/drivers/net/nbl/nbl_common/nbl_userdev.c
+++ b/drivers/net/nbl/nbl_common/nbl_userdev.c
@@ -281,7 +281,7 @@ static int nbl_userdev_free_record(u64 vaddr, u64 iova __rte_unused, u64 len __r
 {
 	struct nbl_userdev_map_record *record, *tmp_record;
 
-	RTE_TAILQ_FOREACH_SAFE(record, &nbl_map_list, next, tmp_record) {
+	TAILQ_FOREACH_SAFE(record, &nbl_map_list, next, tmp_record) {
 		if (record->vaddr != vaddr)
 			continue;
 		nbl_vfio_dma_mem_map(nbl_default_container, vaddr, record->len, 0);
@@ -296,7 +296,7 @@ static void nbl_userdev_dma_free(void)
 {
 	struct nbl_userdev_map_record *record, *tmp_record;
 
-	RTE_TAILQ_FOREACH_SAFE(record, &nbl_map_list, next, tmp_record) {
+	TAILQ_FOREACH_SAFE(record, &nbl_map_list, next, tmp_record) {
 		TAILQ_REMOVE(&nbl_map_list, record, next);
 		free(record);
 	}
diff --git a/drivers/net/nfb/nfb_ethdev.c b/drivers/net/nfb/nfb_ethdev.c
index 9ad93c6766..672a443dd9 100644
--- a/drivers/net/nfb/nfb_ethdev.c
+++ b/drivers/net/nfb/nfb_ethdev.c
@@ -1127,7 +1127,7 @@ nfb_eth_common_remove(struct rte_device *dev)
 {
 	struct pmd_internals *entry, *temp;
 
-	RTE_TAILQ_FOREACH_SAFE(entry, &nfb_eth_dev_list, eth_dev_list, temp) {
+	TAILQ_FOREACH_SAFE(entry, &nfb_eth_dev_list, eth_dev_list, temp) {
 		if (dev == entry->eth_dev->device)
 			rte_eth_dev_destroy(entry->eth_dev, nfb_eth_dev_uninit);
 	}
diff --git a/drivers/net/sfc/sfc_flow.c b/drivers/net/sfc/sfc_flow.c
index 1006243539..8a599e0726 100644
--- a/drivers/net/sfc/sfc_flow.c
+++ b/drivers/net/sfc/sfc_flow.c
@@ -2666,7 +2666,7 @@ sfc_flow_flush(struct rte_eth_dev *dev,
 
 	sfc_adapter_lock(sa);
 
-	RTE_TAILQ_FOREACH_SAFE(flow, &sa->flow_list, entries, tmp) {
+	TAILQ_FOREACH_SAFE(flow, &sa->flow_list, entries, tmp) {
 		if (flow->internal)
 			continue;
 
@@ -2962,7 +2962,7 @@ sfc_flow_fini(struct sfc_adapter *sa)
 
 	SFC_ASSERT(sfc_adapter_is_locked(sa));
 
-	RTE_TAILQ_FOREACH_SAFE(flow, &sa->flow_list, entries, tmp) {
+	TAILQ_FOREACH_SAFE(flow, &sa->flow_list, entries, tmp) {
 		if (flow->internal)
 			continue;
 
diff --git a/drivers/net/softnic/rte_eth_softnic_swq.c b/drivers/net/softnic/rte_eth_softnic_swq.c
index afe6f05e29..2083d0a976 100644
--- a/drivers/net/softnic/rte_eth_softnic_swq.c
+++ b/drivers/net/softnic/rte_eth_softnic_swq.c
@@ -39,7 +39,7 @@ softnic_softnic_swq_free_keep_rxq_txq(struct pmd_internals *p)
 {
 	struct softnic_swq *swq, *tswq;
 
-	RTE_TAILQ_FOREACH_SAFE(swq, &p->swq_list, node, tswq) {
+	TAILQ_FOREACH_SAFE(swq, &p->swq_list, node, tswq) {
 		if ((strncmp(swq->name, "RXQ", strlen("RXQ")) == 0) ||
 			(strncmp(swq->name, "TXQ", strlen("TXQ")) == 0))
 			continue;
diff --git a/drivers/net/sxe2/sxe2_dump.c b/drivers/net/sxe2/sxe2_dump.c
index d43473e083..3d003bb34e 100644
--- a/drivers/net/sxe2/sxe2_dump.c
+++ b/drivers/net/sxe2/sxe2_dump.c
@@ -132,7 +132,7 @@ static void sxe2_dump_filter_info(FILE *file, struct rte_eth_dev *dev)
 	if (adapter->filter_ctxt.uc_num > 0) {
 		fprintf(file,
 			"\t  -- Unicast entry:\n");
-		RTE_TAILQ_FOREACH_SAFE(mac_entry, &adapter->filter_ctxt.uc_list, next,
+		TAILQ_FOREACH_SAFE(mac_entry, &adapter->filter_ctxt.uc_list, next,
 				       next_mac_entry) {
 			fprintf(file,
 				"\t  -- addr: %02x:%02x:%02x:%02x:%02x:%02x hw status:%u "
@@ -151,7 +151,7 @@ static void sxe2_dump_filter_info(FILE *file, struct rte_eth_dev *dev)
 	if (adapter->filter_ctxt.mc_num > 0) {
 		fprintf(file,
 			"\t  -- Multicast entry:\n");
-		RTE_TAILQ_FOREACH_SAFE(mac_entry, &adapter->filter_ctxt.mc_list,
+		TAILQ_FOREACH_SAFE(mac_entry, &adapter->filter_ctxt.mc_list,
 				       next, next_mac_entry) {
 			fprintf(file,
 				"\t  -- addr: %02x:%02x:%02x:%02x:%02x:%02x "
@@ -170,7 +170,7 @@ static void sxe2_dump_filter_info(FILE *file, struct rte_eth_dev *dev)
 	if (adapter->filter_ctxt.vlan_num > 0) {
 		fprintf(file,
 			"\t  -- Vlan entry:\n");
-		RTE_TAILQ_FOREACH_SAFE(vlan_entry, &adapter->filter_ctxt.vlan_list,
+		TAILQ_FOREACH_SAFE(vlan_entry, &adapter->filter_ctxt.vlan_list,
 			next, next_vlan_entry) {
 			fprintf(file,
 				"\t  -- vlan tpid:0x%04x vid:0x%04x prio:%d "
diff --git a/drivers/net/sxe2/sxe2_filter.c b/drivers/net/sxe2/sxe2_filter.c
index 175b886aa3..c581339f78 100644
--- a/drivers/net/sxe2/sxe2_filter.c
+++ b/drivers/net/sxe2/sxe2_filter.c
@@ -19,7 +19,7 @@ static struct sxe2_mac_filter *sxe2_uc_filter_find(struct sxe2_adapter *adapter,
 	struct sxe2_mac_filter *next_entry  = NULL;
 
 	rte_spinlock_lock(&adapter->filter_ctxt.filter_lock);
-	RTE_TAILQ_FOREACH_SAFE(entry, &adapter->filter_ctxt.uc_list, next, next_entry) {
+	TAILQ_FOREACH_SAFE(entry, &adapter->filter_ctxt.uc_list, next, next_entry) {
 		if (rte_is_same_ether_addr(macaddr, &entry->mac_addr)) {
 			filter = entry;
 			break;
@@ -125,7 +125,7 @@ void sxe2_uc_filter_clear(struct sxe2_adapter *adapter, bool default_config)
 	struct sxe2_mac_filter *entry;
 	struct sxe2_mac_filter *next_entry;
 
-	RTE_TAILQ_FOREACH_SAFE(entry, &adapter->filter_ctxt.uc_list, next, next_entry) {
+	TAILQ_FOREACH_SAFE(entry, &adapter->filter_ctxt.uc_list, next, next_entry) {
 		if (entry->default_config && !default_config)
 			continue;
 
@@ -142,7 +142,7 @@ static struct sxe2_mac_filter *sxe2_mc_filter_find(struct sxe2_adapter *adapter,
 	struct sxe2_mac_filter *next_entry  = NULL;
 
 	rte_spinlock_lock(&adapter->filter_ctxt.filter_lock);
-	RTE_TAILQ_FOREACH_SAFE(entry, &adapter->filter_ctxt.mc_list, next, next_entry) {
+	TAILQ_FOREACH_SAFE(entry, &adapter->filter_ctxt.mc_list, next, next_entry) {
 		if (rte_is_same_ether_addr(macaddr, &entry->mac_addr)) {
 			filter = entry;
 			break;
@@ -249,7 +249,7 @@ void sxe2_mc_filter_clear(struct sxe2_adapter *adapter, bool default_config)
 	struct sxe2_mac_filter *entry;
 	struct sxe2_mac_filter *next_entry;
 
-	RTE_TAILQ_FOREACH_SAFE(entry, &adapter->filter_ctxt.mc_list, next, next_entry) {
+	TAILQ_FOREACH_SAFE(entry, &adapter->filter_ctxt.mc_list, next, next_entry) {
 		if (entry->default_config && !default_config)
 			continue;
 		if (sxe2_mc_filter_del(adapter, &entry->mac_addr))
@@ -388,7 +388,7 @@ void sxe2_vlan_filters_clear(struct sxe2_adapter *adapter, bool default_config)
 	if (adapter->filter_ctxt.vlan_num == 0)
 		return;
 
-	RTE_TAILQ_FOREACH_SAFE(v_f, &adapter->filter_ctxt.vlan_list, next, temp)
+	TAILQ_FOREACH_SAFE(v_f, &adapter->filter_ctxt.vlan_list, next, temp)
 	{
 		if (v_f->default_config && !default_config)
 			continue;
@@ -521,7 +521,7 @@ static int32_t sxe2_all_filter_hw_clear(struct sxe2_adapter *adapter)
 	struct sxe2_vlan_filter *next_vlan_entry;
 
 	if (adapter->filter_ctxt.uc_num > 0) {
-		RTE_TAILQ_FOREACH_SAFE(mac_entry, &adapter->filter_ctxt.uc_list, next,
+		TAILQ_FOREACH_SAFE(mac_entry, &adapter->filter_ctxt.uc_list, next,
 			    next_mac_entry) {
 			if (mac_entry->hw_config) {
 				ret = sxe2_drv_uc_config(adapter, &mac_entry->mac_addr, false);
@@ -536,7 +536,7 @@ static int32_t sxe2_all_filter_hw_clear(struct sxe2_adapter *adapter)
 	}
 
 	if (adapter->filter_ctxt.mc_num > 0) {
-		RTE_TAILQ_FOREACH_SAFE(mac_entry, &adapter->filter_ctxt.mc_list, next,
+		TAILQ_FOREACH_SAFE(mac_entry, &adapter->filter_ctxt.mc_list, next,
 			    next_mac_entry) {
 			if (mac_entry->hw_config) {
 				ret = sxe2_drv_mc_config(adapter, &mac_entry->mac_addr, false);
@@ -551,7 +551,7 @@ static int32_t sxe2_all_filter_hw_clear(struct sxe2_adapter *adapter)
 	}
 
 	if (adapter->filter_ctxt.vlan_num > 0) {
-		RTE_TAILQ_FOREACH_SAFE(vlan_entry, &adapter->filter_ctxt.vlan_list, next,
+		TAILQ_FOREACH_SAFE(vlan_entry, &adapter->filter_ctxt.vlan_list, next,
 			    next_vlan_entry) {
 			if (vlan_entry->hw_config) {
 				ret = sxe2_drv_vlan_filter_id_config(adapter,
@@ -606,7 +606,7 @@ static int32_t sxe2_all_filter_hw_set(struct sxe2_adapter *adapter)
 	struct sxe2_vlan_filter *next_vlan_entry;
 
 	if (adapter->filter_ctxt.uc_num > 0) {
-		RTE_TAILQ_FOREACH_SAFE(mac_entry, &adapter->filter_ctxt.uc_list, next,
+		TAILQ_FOREACH_SAFE(mac_entry, &adapter->filter_ctxt.uc_list, next,
 				       next_mac_entry) {
 			if (!mac_entry->hw_config) {
 				ret = sxe2_drv_uc_config(adapter, &mac_entry->mac_addr,
@@ -624,7 +624,7 @@ static int32_t sxe2_all_filter_hw_set(struct sxe2_adapter *adapter)
 	}
 
 	if (adapter->filter_ctxt.mc_num > 0) {
-		RTE_TAILQ_FOREACH_SAFE(mac_entry, &adapter->filter_ctxt.mc_list, next,
+		TAILQ_FOREACH_SAFE(mac_entry, &adapter->filter_ctxt.mc_list, next,
 				       next_mac_entry) {
 			if (!mac_entry->hw_config) {
 				ret = sxe2_drv_mc_config(adapter, &mac_entry->mac_addr, true);
@@ -641,7 +641,7 @@ static int32_t sxe2_all_filter_hw_set(struct sxe2_adapter *adapter)
 	}
 
 	if (adapter->filter_ctxt.vlan_num > 0) {
-		RTE_TAILQ_FOREACH_SAFE(vlan_entry, &adapter->filter_ctxt.vlan_list, next,
+		TAILQ_FOREACH_SAFE(vlan_entry, &adapter->filter_ctxt.vlan_list, next,
 				       next_vlan_entry) {
 			if (!vlan_entry->hw_config) {
 				ret = sxe2_drv_vlan_filter_id_config(adapter,
diff --git a/drivers/net/sxe2/sxe2_vsi.c b/drivers/net/sxe2/sxe2_vsi.c
index d29480b931..7d2252725b 100644
--- a/drivers/net/sxe2/sxe2_vsi.c
+++ b/drivers/net/sxe2/sxe2_vsi.c
@@ -287,7 +287,7 @@ void sxe2_vsi_uninit(struct rte_eth_dev *dev)
 		PMD_LOG_ERR(DRV, "Failed to del vsi from fw, ret=%d", ret);
 		goto l_end;
 	}
-	RTE_TAILQ_FOREACH_SAFE(var, &adapter->vsi_ctxt.other_vsi_list, next, tvar) {
+	TAILQ_FOREACH_SAFE(var, &adapter->vsi_ctxt.other_vsi_list, next, tvar) {
 		ret = sxe2_vsi_destroy(adapter, var);
 		if (ret) {
 			PMD_LOG_ERR(DRV, "Failed to del vsi from fw, ret=%d", ret);
diff --git a/drivers/net/zxdh/zxdh_flow.c b/drivers/net/zxdh/zxdh_flow.c
index c138712635..5da939ec03 100644
--- a/drivers/net/zxdh/zxdh_flow.c
+++ b/drivers/net/zxdh/zxdh_flow.c
@@ -288,7 +288,7 @@ static struct dh_flow_engine *zxdh_get_flow_engine(struct rte_eth_dev *dev __rte
 	struct dh_flow_engine *engine = NULL;
 	void *temp;
 
-	RTE_TAILQ_FOREACH_SAFE(engine, &flow_engine_list, node, temp) {
+	TAILQ_FOREACH_SAFE(engine, &flow_engine_list, node, temp) {
 		if (engine->type  == FLOW_TYPE_FD_TCAM)
 			break;
 	}
diff --git a/drivers/net/zxdh/zxdh_mtr.c b/drivers/net/zxdh/zxdh_mtr.c
index b23f6535a8..e49e88b64b 100644
--- a/drivers/net/zxdh/zxdh_mtr.c
+++ b/drivers/net/zxdh/zxdh_mtr.c
@@ -1209,13 +1209,13 @@ zxdh_mtr_release(struct rte_eth_dev *dev)
 	struct rte_mtr_error error = {0};
 	struct zxdh_mtr_object *mtr_obj;
 
-	RTE_TAILQ_FOREACH(mtr_obj, &zxdh_shared_data->mtr_list, next) {
+	TAILQ_FOREACH(mtr_obj, &zxdh_shared_data->mtr_list, next) {
 		if (mtr_obj->port_id == priv->port_id)
 			zxdh_mtr_obj_free(dev, mtr_obj);
 	}
 
 
-	RTE_TAILQ_FOREACH(profile, &zxdh_shared_data->meter_profile_list, next) {
+	TAILQ_FOREACH(profile, &zxdh_shared_data->meter_profile_list, next) {
 		if (profile->dpdk_port_id == priv->port_id)
 			zxdh_mtr_profile_res_free(dev,
 				zxdh_shared_data->mtr_profile_mp,
@@ -1226,7 +1226,7 @@ zxdh_mtr_release(struct rte_eth_dev *dev)
 
 	struct zxdh_meter_policy *policy;
 
-	RTE_TAILQ_FOREACH(policy, &zxdh_shared_data->mtr_policy_list, next) {
+	TAILQ_FOREACH(policy, &zxdh_shared_data->mtr_policy_list, next) {
 		if (policy->dpdk_port_id == priv->port_id)
 			zxdh_mtr_policy_res_free(zxdh_shared_data->mtr_policy_mp, policy);
 	}
diff --git a/examples/vm_power_manager/channel_manager.c b/examples/vm_power_manager/channel_manager.c
index e162fe5da6..5c41219827 100644
--- a/examples/vm_power_manager/channel_manager.c
+++ b/examples/vm_power_manager/channel_manager.c
@@ -59,16 +59,16 @@ struct virtual_machine_info {
 	virDomainInfo info;
 	rte_spinlock_t config_spinlock;
 	int allow_query;
-	RTE_TAILQ_ENTRY(virtual_machine_info) vms_info;
+	TAILQ_ENTRY(virtual_machine_info) vms_info;
 };
 
-RTE_TAILQ_HEAD(, virtual_machine_info) vm_list_head;
+TAILQ_HEAD(, virtual_machine_info) vm_list_head;
 
 static struct virtual_machine_info *
 find_domain_by_name(const char *name)
 {
 	struct virtual_machine_info *info;
-	RTE_TAILQ_FOREACH(info, &vm_list_head, vms_info) {
+	TAILQ_FOREACH(info, &vm_list_head, vms_info) {
 		if (!strncmp(info->name, name, CHANNEL_MGR_MAX_NAME_LEN-1))
 			return info;
 	}
@@ -1015,7 +1015,7 @@ channel_manager_exit(void)
 	char mask[RTE_MAX_LCORE];
 	struct virtual_machine_info *vm_info, *tmp;
 
-	RTE_TAILQ_FOREACH_SAFE(vm_info, &vm_list_head, vms_info, tmp) {
+	TAILQ_FOREACH_SAFE(vm_info, &vm_list_head, vms_info, tmp) {
 
 		rte_spinlock_lock(&(vm_info->config_spinlock));
 
diff --git a/lib/bbdev/rte_bbdev.h b/lib/bbdev/rte_bbdev.h
index 36dabf8fa6..e8de3fe265 100644
--- a/lib/bbdev/rte_bbdev.h
+++ b/lib/bbdev/rte_bbdev.h
@@ -501,7 +501,7 @@ struct rte_bbdev_callback;
 struct rte_intr_handle;
 
 /** Structure to keep track of registered callbacks */
-RTE_TAILQ_HEAD(rte_bbdev_cb_list, rte_bbdev_callback);
+TAILQ_HEAD(rte_bbdev_cb_list, rte_bbdev_callback);
 
 /**
  * @internal The data structure associated with a device. Drivers can access
diff --git a/lib/cryptodev/cryptodev_pmd.h b/lib/cryptodev/cryptodev_pmd.h
index 929c6defe9..c60b60c767 100644
--- a/lib/cryptodev/cryptodev_pmd.h
+++ b/lib/cryptodev/cryptodev_pmd.h
@@ -131,7 +131,7 @@ struct rte_cryptodev_global {
 
 /* Cryptodev driver, containing the driver ID */
 struct cryptodev_driver {
-	RTE_TAILQ_ENTRY(cryptodev_driver) next; /**< Next in list. */
+	TAILQ_ENTRY(cryptodev_driver) next; /**< Next in list. */
 	const struct rte_driver *driver;
 	uint8_t id;
 };
diff --git a/lib/cryptodev/rte_cryptodev.h b/lib/cryptodev/rte_cryptodev.h
index 37a6a5e49b..1fc2282894 100644
--- a/lib/cryptodev/rte_cryptodev.h
+++ b/lib/cryptodev/rte_cryptodev.h
@@ -1049,7 +1049,7 @@ rte_cryptodev_queue_pair_event_error_query(uint8_t dev_id, uint16_t qp_id);
 struct rte_cryptodev_callback;
 
 /** Structure to keep track of registered callbacks */
-RTE_TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback);
+TAILQ_HEAD(rte_cryptodev_cb_list, rte_cryptodev_callback);
 
 /**
  * Structure used to hold information about the callbacks to be called for a
diff --git a/lib/eal/common/eal_common_devargs.c b/lib/eal/common/eal_common_devargs.c
index c523429d67..c5936ae6bd 100644
--- a/lib/eal/common/eal_common_devargs.c
+++ b/lib/eal/common/eal_common_devargs.c
@@ -303,7 +303,7 @@ rte_devargs_insert(struct rte_devargs **da)
 	if (*da == NULL || (*da)->bus == NULL)
 		return -1;
 
-	RTE_TAILQ_FOREACH_SAFE(listed_da, &devargs_list, next, tmp) {
+	TAILQ_FOREACH_SAFE(listed_da, &devargs_list, next, tmp) {
 		if (listed_da == *da)
 			/* devargs already in the list */
 			return 0;
@@ -372,7 +372,7 @@ rte_devargs_remove(struct rte_devargs *devargs)
 	if (devargs == NULL || devargs->bus == NULL)
 		return -1;
 
-	RTE_TAILQ_FOREACH_SAFE(d, &devargs_list, next, tmp) {
+	TAILQ_FOREACH_SAFE(d, &devargs_list, next, tmp) {
 		if (strcmp(d->bus->name, devargs->bus->name) == 0 &&
 		    strcmp(d->name, devargs->name) == 0) {
 			TAILQ_REMOVE(&devargs_list, d, next);
diff --git a/lib/eal/common/eal_common_options.c b/lib/eal/common/eal_common_options.c
index 9c5d6df36f..26f3e4e931 100644
--- a/lib/eal/common/eal_common_options.c
+++ b/lib/eal/common/eal_common_options.c
@@ -482,7 +482,7 @@ eal_option_device_parse(void)
 	void *tmp;
 	int ret = 0;
 
-	RTE_TAILQ_FOREACH_SAFE(devopt, &devopt_list, next, tmp) {
+	TAILQ_FOREACH_SAFE(devopt, &devopt_list, next, tmp) {
 		if (ret == 0) {
 			ret = rte_devargs_add(devopt->type, devopt->arg);
 			if (ret)
diff --git a/lib/eal/common/eal_common_proc.c b/lib/eal/common/eal_common_proc.c
index 5133eaaa47..aded70b9cb 100644
--- a/lib/eal/common/eal_common_proc.c
+++ b/lib/eal/common/eal_common_proc.c
@@ -1266,7 +1266,7 @@ rte_mp_request_async(struct rte_mp_msg *req, const struct timespec *ts,
 	if (ret != 0 && reply->nb_sent > 0) {
 		struct pending_request *r, *tmp;
 
-		RTE_TAILQ_FOREACH_SAFE(r, &pending_requests.requests, next, tmp) {
+		TAILQ_FOREACH_SAFE(r, &pending_requests.requests, next, tmp) {
 			if (r->type == REQUEST_TYPE_ASYNC && r->async.param == param) {
 				TAILQ_REMOVE(&pending_requests.requests, r, next);
 				free(r->reply);
diff --git a/lib/eal/freebsd/include/rte_os.h b/lib/eal/freebsd/include/rte_os.h
index ddc3b4fd2e..05ff038e1d 100644
--- a/lib/eal/freebsd/include/rte_os.h
+++ b/lib/eal/freebsd/include/rte_os.h
@@ -12,17 +12,11 @@
 
 #include <pthread_np.h>
 #include <stdlib.h>            /* Declares alloca() */
+/* Not used here, but included so that rte_queue.h wins the multiple
+ * inclusion guard race against a system <sys/queue.h>. See rte_queue.h.
+ */
 #include <rte_queue.h>
 
-/* These macros are compatible with system's sys/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)
-#define RTE_TAILQ_FIRST(head) TAILQ_FIRST(head)
-#define RTE_TAILQ_NEXT(elem, field) TAILQ_NEXT(elem, field)
-#define RTE_STAILQ_HEAD(name, type) STAILQ_HEAD(name, type)
-#define RTE_STAILQ_ENTRY(type) STAILQ_ENTRY(type)
-
 typedef cpuset_t rte_cpuset_t;
 #define RTE_HAS_CPUSET
 
diff --git a/lib/eal/include/bus_driver.h b/lib/eal/include/bus_driver.h
index fa4d711a90..34f4cfdc4d 100644
--- a/lib/eal/include/bus_driver.h
+++ b/lib/eal/include/bus_driver.h
@@ -20,7 +20,7 @@ struct rte_device;
 struct rte_driver;
 
 /** Double linked list of buses */
-RTE_TAILQ_HEAD(rte_bus_list, rte_bus);
+TAILQ_HEAD(rte_bus_list, rte_bus);
 
 /**
  * Bus specific scan for devices attached on the bus.
@@ -351,7 +351,7 @@ typedef void *(*rte_bus_dev_iterate_t)(const struct rte_bus *bus,
  * A structure describing a generic bus.
  */
 struct rte_bus {
-	RTE_TAILQ_ENTRY(rte_bus) next; /**< Next bus object in linked list */
+	TAILQ_ENTRY(rte_bus) next; /**< Next bus object in linked list */
 	const char *name;            /**< Name of the bus */
 	bool allow_multi_probe;      /**< Allow probing devices multiple times */
 	rte_bus_scan_t scan;         /**< Scan for devices attached to bus */
@@ -374,8 +374,8 @@ struct rte_bus {
 					/**< handle sigbus error on the bus */
 	rte_bus_free_device_t free_device; /**< Free bus-specific device */
 	rte_bus_cleanup_t cleanup;   /**< Cleanup devices on bus */
-	RTE_TAILQ_HEAD(, rte_device) device_list; /**< List of devices on the bus */
-	RTE_TAILQ_HEAD(, rte_driver) driver_list; /**< List of drivers on the bus */
+	TAILQ_HEAD(, rte_device) device_list; /**< List of devices on the bus */
+	TAILQ_HEAD(, rte_driver) driver_list; /**< List of drivers on the bus */
 };
 
 /**
diff --git a/lib/eal/include/dev_driver.h b/lib/eal/include/dev_driver.h
index 2052e3ecb2..2732401dfd 100644
--- a/lib/eal/include/dev_driver.h
+++ b/lib/eal/include/dev_driver.h
@@ -12,7 +12,7 @@
  * A structure describing a device driver.
  */
 struct rte_driver {
-	RTE_TAILQ_ENTRY(rte_driver) next; /**< Next in list. */
+	TAILQ_ENTRY(rte_driver) next; /**< Next in list. */
 	const char *name;                   /**< Driver name. */
 	const char *alias;              /**< Driver alias. */
 	const struct rte_bus *bus;      /**< Bus reference. */
@@ -22,7 +22,7 @@ struct rte_driver {
  * A structure describing a generic device.
  */
 struct rte_device {
-	RTE_TAILQ_ENTRY(rte_device) next; /**< Next device */
+	TAILQ_ENTRY(rte_device) next; /**< Next device */
 	const char *name;             /**< Device name */
 	const char *bus_info;         /**< Device bus specific information */
 	const struct rte_driver *driver; /**< Driver assigned after probing */
diff --git a/lib/eal/include/rte_class.h b/lib/eal/include/rte_class.h
index 7631e36e82..216474ff43 100644
--- a/lib/eal/include/rte_class.h
+++ b/lib/eal/include/rte_class.h
@@ -25,13 +25,13 @@ extern "C" {
 #endif
 
 /** Double linked list of classes */
-RTE_TAILQ_HEAD(rte_class_list, rte_class);
+TAILQ_HEAD(rte_class_list, rte_class);
 
 /**
  * A structure describing a generic device class.
  */
 struct rte_class {
-	RTE_TAILQ_ENTRY(rte_class) next; /**< Next device class in linked list */
+	TAILQ_ENTRY(rte_class) next; /**< Next device class in linked list */
 	const char *name; /**< Name of the class */
 	rte_dev_iterate_t dev_iterate; /**< Device iterator. */
 };
diff --git a/lib/eal/include/rte_devargs.h b/lib/eal/include/rte_devargs.h
index ed5a4675d9..0c64a98214 100644
--- a/lib/eal/include/rte_devargs.h
+++ b/lib/eal/include/rte_devargs.h
@@ -71,7 +71,7 @@ enum rte_devtype {
  */
 struct rte_devargs {
 	/** Next in list. */
-	RTE_TAILQ_ENTRY(rte_devargs) next;
+	TAILQ_ENTRY(rte_devargs) next;
 	/** Type of device. */
 	enum rte_devtype type;
 	/** Device policy. */
diff --git a/lib/eal/include/rte_queue.h b/lib/eal/include/rte_queue.h
index a847670470..635e7797cf 100644
--- a/lib/eal/include/rte_queue.h
+++ b/lib/eal/include/rte_queue.h
@@ -26,6 +26,11 @@
  * _FOREACH_SAFE, _FOREACH_FROM or _SWAP. Conversely, when this header wins,
  * the glibc-only CIRCLEQ_ and SIMPLEQ_ families are not defined.
  *
+ * Within DPDK this is not a problem: rte_os.h includes this header and is
+ * reached from rte_common.h, so any DPDK header included first wins the
+ * race. Note that the include in rte_os.h is load bearing for that reason,
+ * even though nothing in rte_os.h itself uses the list macros.
+ *
  * The FreeBSD QUEUE_MACRO_DEBUG and INVARIANTS facilities are omitted: they
  * are there to debug the macros themselves, which is not something DPDK does.
  */
diff --git a/lib/eal/include/rte_tailq.h b/lib/eal/include/rte_tailq.h
index e7caed6812..decd833b0d 100644
--- a/lib/eal/include/rte_tailq.h
+++ b/lib/eal/include/rte_tailq.h
@@ -12,6 +12,7 @@
 
 #include <stdio.h>
 #include <rte_debug.h>
+#include <rte_queue.h>
 
 #ifdef __cplusplus
 extern "C" {
@@ -19,11 +20,11 @@ extern "C" {
 
 /** dummy structure type used by the rte_tailq APIs */
 struct rte_tailq_entry {
-	RTE_TAILQ_ENTRY(rte_tailq_entry) next; /**< Pointer entries for a tailq list */
+	TAILQ_ENTRY(rte_tailq_entry) next; /**< Pointer entries for a tailq list */
 	void *data; /**< Pointer to the data referenced by this tailq entry */
 };
 /** dummy */
-RTE_TAILQ_HEAD(rte_tailq_entry_head, rte_tailq_entry);
+TAILQ_HEAD(rte_tailq_entry_head, rte_tailq_entry);
 
 #define RTE_TAILQ_NAMESIZE 32
 
@@ -46,7 +47,7 @@ struct rte_tailq_elem {
 	 * rte_eal_tailqs_init()
 	 */
 	struct rte_tailq_head *head;
-	RTE_TAILQ_ENTRY(rte_tailq_elem) next;
+	TAILQ_ENTRY(rte_tailq_elem) next;
 	const char name[RTE_TAILQ_NAMESIZE];
 };
 
@@ -124,10 +125,32 @@ RTE_INIT(tailqinitfn_ ##t) \
 		rte_panic("Cannot initialize tailq: %s\n", t.name); \
 }
 
-/* This macro permits both remove and free var within the loop safely.*/
+/*
+ * Compatibility wrappers, deprecated.
+ *
+ * These existed only because Windows had no <sys/queue.h>. Use the plain
+ * macros from <rte_queue.h> instead; these are kept for out of tree code
+ * and will be removed in a future release.
+ *
+ * They are defined in terms of the plain TAILQ_ and STAILQ_ macros only,
+ * never the extended ones, so that they keep working in a translation unit
+ * that included a system <sys/queue.h> before any DPDK header, in which
+ * case rte_queue.h is suppressed and only the subset the system provides
+ * is defined. That is why RTE_TAILQ_FOREACH_SAFE is open coded rather than
+ * mapped to TAILQ_FOREACH_SAFE, which glibc does not have.
+ */
+#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)
+#define RTE_TAILQ_FIRST(head) TAILQ_FIRST(head)
+#define RTE_TAILQ_NEXT(elem, field) TAILQ_NEXT(elem, field)
+#define RTE_STAILQ_HEAD(name, type) STAILQ_HEAD(name, type)
+#define RTE_STAILQ_ENTRY(type) STAILQ_ENTRY(type)
+
+/* This macro permits both remove and free var within the loop safely. */
 #define RTE_TAILQ_FOREACH_SAFE(var, head, field, tvar) \
-	for ((var) = RTE_TAILQ_FIRST((head)); \
-	    (var) && ((tvar) = RTE_TAILQ_NEXT((var), field), 1); \
+	for ((var) = TAILQ_FIRST((head)); \
+	    (var) && ((tvar) = TAILQ_NEXT((var), field), 1); \
 	    (var) = (tvar))
 
 #ifdef __cplusplus
diff --git a/lib/eal/linux/include/rte_os.h b/lib/eal/linux/include/rte_os.h
index 3c87f52b33..e8b35d265e 100644
--- a/lib/eal/linux/include/rte_os.h
+++ b/lib/eal/linux/include/rte_os.h
@@ -12,17 +12,11 @@
 
 #include <alloca.h>
 #include <sched.h>
+/* Not used here, but included so that rte_queue.h wins the multiple
+ * inclusion guard race against a system <sys/queue.h>. See rte_queue.h.
+ */
 #include <rte_queue.h>
 
-/* These macros are compatible with system's sys/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)
-#define RTE_TAILQ_FIRST(head) TAILQ_FIRST(head)
-#define RTE_TAILQ_NEXT(elem, field) TAILQ_NEXT(elem, field)
-#define RTE_STAILQ_HEAD(name, type) STAILQ_HEAD(name, type)
-#define RTE_STAILQ_ENTRY(type) STAILQ_ENTRY(type)
-
 #ifdef CPU_SETSIZE /* may require _GNU_SOURCE */
 typedef cpu_set_t rte_cpuset_t;
 #define RTE_HAS_CPUSET
diff --git a/lib/eal/windows/include/rte_os.h b/lib/eal/windows/include/rte_os.h
index 2a43cb1f9b..3f2a57c325 100644
--- a/lib/eal/windows/include/rte_os.h
+++ b/lib/eal/windows/include/rte_os.h
@@ -16,33 +16,10 @@
 #include <malloc.h>
 
 #include <sched.h>
-
-/* These macros are compatible with bundled sys/queue.h. */
-#define RTE_TAILQ_HEAD(name, type) \
-struct name { \
-	struct type *tqh_first; \
-	struct type **tqh_last; \
-}
-#define RTE_TAILQ_ENTRY(type) \
-struct { \
-	struct type *tqe_next; \
-	struct type **tqe_prev; \
-}
-#define RTE_TAILQ_FOREACH(var, head, field) \
-	for ((var) = RTE_TAILQ_FIRST((head)); \
-	    (var); \
-	    (var) = RTE_TAILQ_NEXT((var), field))
-#define RTE_TAILQ_FIRST(head) ((head)->tqh_first)
-#define RTE_TAILQ_NEXT(elm, field) ((elm)->field.tqe_next)
-#define RTE_STAILQ_HEAD(name, type) \
-struct name { \
-	struct type *stqh_first; \
-	struct type **stqh_last; \
-}
-#define RTE_STAILQ_ENTRY(type) \
-struct { \
-	struct type *stqe_next; \
-}
+/* Not used here, but included so that rte_queue.h wins the multiple
+ * inclusion guard race against a system <sys/queue.h>. See rte_queue.h.
+ */
+#include <rte_queue.h>
 
 /* cpu_set macros implementation */
 #define RTE_CPU_AND(dst, src1, src2) CPU_AND(dst, src1, src2)
diff --git a/lib/efd/rte_efd.c b/lib/efd/rte_efd.c
index 34b9585cb8..e184fc10f6 100644
--- a/lib/efd/rte_efd.c
+++ b/lib/efd/rte_efd.c
@@ -777,7 +777,7 @@ rte_efd_free(struct rte_efd_table *table)
 	efd_list = RTE_TAILQ_CAST(rte_efd_tailq.head, rte_efd_list);
 	rte_mcfg_tailq_write_lock();
 
-	RTE_TAILQ_FOREACH_SAFE(te, efd_list, next, temp) {
+	TAILQ_FOREACH_SAFE(te, efd_list, next, temp) {
 		if (te->data == (void *) table) {
 			TAILQ_REMOVE(efd_list, te, next);
 			rte_free(te);
diff --git a/lib/ethdev/rte_ethdev_core.h b/lib/ethdev/rte_ethdev_core.h
index 4ffae4921a..e8497301f2 100644
--- a/lib/ethdev/rte_ethdev_core.h
+++ b/lib/ethdev/rte_ethdev_core.h
@@ -18,7 +18,7 @@
 
 struct rte_eth_dev_callback;
 /** @internal Structure to keep track of registered callbacks */
-RTE_TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
+TAILQ_HEAD(rte_eth_dev_cb_list, rte_eth_dev_callback);
 
 struct rte_eth_dev;
 
diff --git a/lib/eventdev/rte_event_vector_adapter.c b/lib/eventdev/rte_event_vector_adapter.c
index 9a839517c8..3e1ef8bf44 100644
--- a/lib/eventdev/rte_event_vector_adapter.c
+++ b/lib/eventdev/rte_event_vector_adapter.c
@@ -506,7 +506,7 @@ struct sw_vector_adapter_data {
 	struct rte_event_vector_adapter *adapter;
 	struct rte_event_vector_adapter_stats stats;
 	struct sw_vector_adapter_service_data *service_data;
-	RTE_TAILQ_ENTRY(sw_vector_adapter_data) next;
+	TAILQ_ENTRY(sw_vector_adapter_data) next;
 };
 
 struct sw_vector_adapter_service_data {
diff --git a/lib/gpudev/gpudev.c b/lib/gpudev/gpudev.c
index b44f92a04c..d67878a999 100644
--- a/lib/gpudev/gpudev.c
+++ b/lib/gpudev/gpudev.c
@@ -476,7 +476,7 @@ rte_gpu_callback_unregister(int16_t dev_id, enum rte_gpu_event event,
 	rte_rwlock_write_lock(&gpu_callback_lock);
 	do {
 		callbacks = &gpus[next_dev].callbacks;
-		RTE_TAILQ_FOREACH_SAFE(callback, callbacks, next, nextcb) {
+		TAILQ_FOREACH_SAFE(callback, callbacks, next, nextcb) {
 			if (callback->event != event ||
 					callback->function != function ||
 					(callback->user_data != user_data &&
@@ -499,7 +499,7 @@ gpu_free_callbacks(struct rte_gpu *dev)
 
 	callbacks = &dev->callbacks;
 	rte_rwlock_write_lock(&gpu_callback_lock);
-	RTE_TAILQ_FOREACH_SAFE(callback, callbacks, next, nextcb) {
+	TAILQ_FOREACH_SAFE(callback, callbacks, next, nextcb) {
 		TAILQ_REMOVE(callbacks, callback, next);
 		free(callback);
 	}
diff --git a/lib/gpudev/gpudev_driver.h b/lib/gpudev/gpudev_driver.h
index b7621f6e5a..956deb8935 100644
--- a/lib/gpudev/gpudev_driver.h
+++ b/lib/gpudev/gpudev_driver.h
@@ -80,7 +80,7 @@ struct __rte_cache_aligned rte_gpu {
 	/* Driver functions. */
 	struct rte_gpu_ops ops;
 	/* Event callback list. */
-	RTE_TAILQ_HEAD(rte_gpu_callback_list, rte_gpu_callback) callbacks;
+	TAILQ_HEAD(rte_gpu_callback_list, rte_gpu_callback) callbacks;
 	/* Current state (used or not) in the running process. */
 	enum rte_gpu_state process_state; /* Updated by this library. */
 	/* Driver-specific private data for the running process. */
diff --git a/lib/ip_frag/ip_reassembly.h b/lib/ip_frag/ip_reassembly.h
index 9e1666ef67..001a0d6e5b 100644
--- a/lib/ip_frag/ip_reassembly.h
+++ b/lib/ip_frag/ip_reassembly.h
@@ -48,7 +48,7 @@ struct ip_frag_key {
  * First two entries in the frags[] array are for the last and first fragments.
  */
 struct __rte_cache_aligned ip_frag_pkt {
-	RTE_TAILQ_ENTRY(ip_frag_pkt) lru;      /* LRU list */
+	TAILQ_ENTRY(ip_frag_pkt) lru;      /* LRU list */
 	struct ip_frag_key key;                /* fragmentation key */
 	uint64_t start;                        /* creation timestamp */
 	uint32_t total_size;                   /* expected reassembled size */
@@ -58,7 +58,7 @@ struct __rte_cache_aligned ip_frag_pkt {
 };
 
  /* fragments tailq */
-RTE_TAILQ_HEAD(ip_pkt_list, ip_frag_pkt);
+TAILQ_HEAD(ip_pkt_list, ip_frag_pkt);
 
 /* fragmentation table statistics */
 struct __rte_cache_aligned ip_frag_tbl_stat {
diff --git a/lib/ip_frag/rte_ip_frag_common.c b/lib/ip_frag/rte_ip_frag_common.c
index 00bf9476de..31556f82e7 100644
--- a/lib/ip_frag/rte_ip_frag_common.c
+++ b/lib/ip_frag/rte_ip_frag_common.c
@@ -140,7 +140,7 @@ rte_ip_frag_table_del_expired_entries(struct rte_ip_frag_tbl *tbl,
 
 	max_cycles = tbl->max_cycles;
 
-	RTE_TAILQ_FOREACH_SAFE(fp, &tbl->lru, lru, tmp) {
+	TAILQ_FOREACH_SAFE(fp, &tbl->lru, lru, tmp) {
 		if (max_cycles + fp->start >= tms)
 			return;
 
diff --git a/lib/mempool/rte_mempool.c b/lib/mempool/rte_mempool.c
index 57fd282970..287cd4e331 100644
--- a/lib/mempool/rte_mempool.c
+++ b/lib/mempool/rte_mempool.c
@@ -1437,7 +1437,7 @@ void rte_mempool_walk(void (*func)(struct rte_mempool *, void *),
 
 	rte_mcfg_mempool_read_lock();
 
-	RTE_TAILQ_FOREACH_SAFE(te, mempool_list, next, tmp_te) {
+	TAILQ_FOREACH_SAFE(te, mempool_list, next, tmp_te) {
 		(*func)((struct rte_mempool *) te->data, arg);
 	}
 
@@ -1505,7 +1505,7 @@ mempool_event_callback_invoke(enum rte_mempool_event event,
 	void *tmp_te;
 
 	rte_mcfg_tailq_read_lock();
-	RTE_TAILQ_FOREACH_SAFE(cb, &callback_tailq, callbacks, tmp_te) {
+	TAILQ_FOREACH_SAFE(cb, &callback_tailq, callbacks, tmp_te) {
 		rte_mcfg_tailq_read_unlock();
 		cb->func(event, mp, cb->user_data);
 		rte_mcfg_tailq_read_lock();
diff --git a/lib/mempool/rte_mempool.h b/lib/mempool/rte_mempool.h
index 50d958c7c6..cbe74b65c3 100644
--- a/lib/mempool/rte_mempool.h
+++ b/lib/mempool/rte_mempool.h
@@ -153,7 +153,7 @@ struct rte_mempool_objsz {
  * double-frees.
  */
 struct rte_mempool_objhdr {
-	RTE_STAILQ_ENTRY(rte_mempool_objhdr) next; /**< Next in list. */
+	STAILQ_ENTRY(rte_mempool_objhdr) next; /**< Next in list. */
 	struct rte_mempool *mp;          /**< The mempool owning the object. */
 	rte_iova_t iova;                 /**< IO address of the object. */
 #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
@@ -164,7 +164,7 @@ struct rte_mempool_objhdr {
 /**
  * A list of object headers type
  */
-RTE_STAILQ_HEAD(rte_mempool_objhdr_list, rte_mempool_objhdr);
+STAILQ_HEAD(rte_mempool_objhdr_list, rte_mempool_objhdr);
 
 #ifdef RTE_LIBRTE_MEMPOOL_DEBUG
 
@@ -191,7 +191,7 @@ extern int rte_mempool_logtype;
 /**
  * A list of memory where objects are stored
  */
-RTE_STAILQ_HEAD(rte_mempool_memhdr_list, rte_mempool_memhdr);
+STAILQ_HEAD(rte_mempool_memhdr_list, rte_mempool_memhdr);
 
 /**
  * Callback used to free a memory chunk
@@ -206,7 +206,7 @@ typedef void (rte_mempool_memchunk_free_cb_t)(struct rte_mempool_memhdr *memhdr,
  * and physically contiguous.
  */
 struct rte_mempool_memhdr {
-	RTE_STAILQ_ENTRY(rte_mempool_memhdr) next; /**< Next in list. */
+	STAILQ_ENTRY(rte_mempool_memhdr) next; /**< Next in list. */
 	struct rte_mempool *mp;  /**< The mempool owning the chunk */
 	void *addr;              /**< Virtual address of the chunk */
 	rte_iova_t iova;         /**< IO address of the chunk */
diff --git a/lib/pmu/pmu.c b/lib/pmu/pmu.c
index d372ecf4f1..ea69beab13 100644
--- a/lib/pmu/pmu.c
+++ b/lib/pmu/pmu.c
@@ -460,7 +460,7 @@ rte_pmu_fini(void)
 	if (!rte_pmu.initialized)
 		return;
 
-	RTE_TAILQ_FOREACH_SAFE(event, &rte_pmu.event_list, next, tmp_event) {
+	TAILQ_FOREACH_SAFE(event, &rte_pmu.event_list, next, tmp_event) {
 		TAILQ_REMOVE(&rte_pmu.event_list, event, next);
 		free_event(event);
 	}
diff --git a/lib/power/power_cpufreq.h b/lib/power/power_cpufreq.h
index 41bfaed7bb..9847cb52db 100644
--- a/lib/power/power_cpufreq.h
+++ b/lib/power/power_cpufreq.h
@@ -147,7 +147,7 @@ typedef int (*rte_power_get_capabilities_t)(unsigned int lcore_id,
 
 /** Structure defining core power operations structure */
 struct rte_power_cpufreq_ops {
-	RTE_TAILQ_ENTRY(rte_power_cpufreq_ops) next;	/**< Next in list. */
+	TAILQ_ENTRY(rte_power_cpufreq_ops) next;	/**< Next in list. */
 	char name[RTE_POWER_DRIVER_NAMESZ];             /**< power mgmt driver. */
 	rte_power_cpufreq_init_t init;                  /**< Initialize power management. */
 	rte_power_cpufreq_exit_t exit;                  /**< Exit power management. */
diff --git a/lib/power/power_uncore_ops.h b/lib/power/power_uncore_ops.h
index 025a55cb97..62bc65dcc7 100644
--- a/lib/power/power_uncore_ops.h
+++ b/lib/power/power_uncore_ops.h
@@ -185,7 +185,7 @@ typedef void (*rte_power_uncore_driver_cb_t)(void);
 
 /** Structure defining uncore power operations structure */
 struct rte_power_uncore_ops {
-	RTE_TAILQ_ENTRY(rte_power_uncore_ops) next;     /**< Next in list. */
+	TAILQ_ENTRY(rte_power_uncore_ops) next;     /**< Next in list. */
 	char name[RTE_POWER_UNCORE_DRIVER_NAMESZ];      /**< power mgmt driver. */
 	rte_power_uncore_driver_cb_t cb;                /**< Driver specific callbacks. */
 	rte_power_uncore_init_t init;                   /**< Initialize power management. */
diff --git a/lib/power/rte_power_cpufreq.c b/lib/power/rte_power_cpufreq.c
index 8394cbc77f..dafacbae19 100644
--- a/lib/power/rte_power_cpufreq.c
+++ b/lib/power/rte_power_cpufreq.c
@@ -13,7 +13,7 @@ static enum power_management_env global_default_env = PM_ENV_NOT_SET;
 static struct rte_power_cpufreq_ops *global_cpufreq_ops;
 
 static rte_spinlock_t global_env_cfg_lock = RTE_SPINLOCK_INITIALIZER;
-static RTE_TAILQ_HEAD(, rte_power_cpufreq_ops) cpufreq_ops_list =
+static TAILQ_HEAD(, rte_power_cpufreq_ops) cpufreq_ops_list =
 			TAILQ_HEAD_INITIALIZER(cpufreq_ops_list);
 
 const char *power_env_str[] = {
@@ -55,7 +55,7 @@ rte_power_check_env_supported(enum power_management_env env)
 	if (env >= RTE_DIM(power_env_str))
 		return 0;
 
-	RTE_TAILQ_FOREACH(ops, &cpufreq_ops_list, next)
+	TAILQ_FOREACH(ops, &cpufreq_ops_list, next)
 		if (strncmp(ops->name, power_env_str[env],
 				RTE_POWER_DRIVER_NAMESZ) == 0)
 			return ops->check_env_support();
@@ -77,7 +77,7 @@ rte_power_set_env(enum power_management_env env)
 		goto out;
 	}
 
-	RTE_TAILQ_FOREACH(ops, &cpufreq_ops_list, next)
+	TAILQ_FOREACH(ops, &cpufreq_ops_list, next)
 		if (strncmp(ops->name, power_env_str[env],
 				RTE_POWER_DRIVER_NAMESZ) == 0) {
 			global_cpufreq_ops = ops;
@@ -123,7 +123,7 @@ rte_power_init(unsigned int lcore_id)
 	POWER_LOG(INFO, "Env isn't set yet!");
 
 	/* Auto detect Environment */
-	RTE_TAILQ_FOREACH(ops, &cpufreq_ops_list, next) {
+	TAILQ_FOREACH(ops, &cpufreq_ops_list, next) {
 		POWER_LOG(INFO,
 			"Attempting to initialise %s cpufreq power management...",
 			ops->name);
diff --git a/lib/power/rte_power_uncore.c b/lib/power/rte_power_uncore.c
index b50e09a2ad..15f3e1f3ab 100644
--- a/lib/power/rte_power_uncore.c
+++ b/lib/power/rte_power_uncore.c
@@ -14,7 +14,7 @@ static enum rte_uncore_power_mgmt_env global_uncore_env = RTE_UNCORE_PM_ENV_NOT_
 static struct rte_power_uncore_ops *global_uncore_ops;
 
 static rte_spinlock_t global_env_cfg_lock = RTE_SPINLOCK_INITIALIZER;
-static RTE_TAILQ_HEAD(, rte_power_uncore_ops) uncore_ops_list =
+static TAILQ_HEAD(, rte_power_uncore_ops) uncore_ops_list =
 			TAILQ_HEAD_INITIALIZER(uncore_ops_list);
 
 const char *uncore_env_str[] = {
@@ -68,7 +68,7 @@ rte_power_set_uncore_env(enum rte_uncore_power_mgmt_env env)
 		env = RTE_UNCORE_PM_ENV_INTEL_UNCORE;
 
 	if (env < RTE_DIM(uncore_env_str)) {
-		RTE_TAILQ_FOREACH(ops, &uncore_ops_list, next)
+		TAILQ_FOREACH(ops, &uncore_ops_list, next)
 			if (strncmp(ops->name, uncore_env_str[env],
 				RTE_POWER_UNCORE_DRIVER_NAMESZ) == 0) {
 				global_uncore_env = env;
@@ -115,7 +115,7 @@ rte_power_uncore_init(unsigned int pkg, unsigned int die)
 		return global_uncore_ops->init(pkg, die);
 
 	/* Auto Detect Environment */
-	RTE_TAILQ_FOREACH(ops, &uncore_ops_list, next)
+	TAILQ_FOREACH(ops, &uncore_ops_list, next)
 		if (ops) {
 			POWER_LOG(INFO,
 				"Attempting to initialise %s power management...",
diff --git a/lib/table/rte_swx_table.h b/lib/table/rte_swx_table.h
index cf7dcea8a1..b6ab2c59d7 100644
--- a/lib/table/rte_swx_table.h
+++ b/lib/table/rte_swx_table.h
@@ -73,7 +73,7 @@ struct rte_swx_table_entry {
 	/** Used to facilitate the membership of this table entry to a
 	 * linked list.
 	 */
-	RTE_TAILQ_ENTRY(rte_swx_table_entry) node;
+	TAILQ_ENTRY(rte_swx_table_entry) node;
 
 	/** Key value for the current entry. Array of *key_size* bytes or NULL
 	 * if the *key_size* for the current table is 0.
@@ -116,7 +116,7 @@ struct rte_swx_table_entry {
 };
 
 /** List of table entries. */
-RTE_TAILQ_HEAD(rte_swx_table_entry_list, rte_swx_table_entry);
+TAILQ_HEAD(rte_swx_table_entry_list, rte_swx_table_entry);
 
 /**
  * Table memory footprint get
diff --git a/lib/table/rte_swx_table_selector.h b/lib/table/rte_swx_table_selector.h
index ef29bdb6b0..52d4dbe568 100644
--- a/lib/table/rte_swx_table_selector.h
+++ b/lib/table/rte_swx_table_selector.h
@@ -55,7 +55,7 @@ struct rte_swx_table_selector_params {
 /** Group member parameters. */
 struct rte_swx_table_selector_member {
 	/** Linked list connectivity. */
-	RTE_TAILQ_ENTRY(rte_swx_table_selector_member) node;
+	TAILQ_ENTRY(rte_swx_table_selector_member) node;
 
 	/** Member ID. */
 	uint32_t member_id;
@@ -65,7 +65,7 @@ struct rte_swx_table_selector_member {
 };
 
 /** List of group members. */
-RTE_TAILQ_HEAD(rte_swx_table_selector_member_list, rte_swx_table_selector_member);
+TAILQ_HEAD(rte_swx_table_selector_member_list, rte_swx_table_selector_member);
 
 /** Group parameters. */
 struct rte_swx_table_selector_group {
diff --git a/lib/vhost/iotlb.c b/lib/vhost/iotlb.c
index f2c275a7d7..2198eeb080 100644
--- a/lib/vhost/iotlb.c
+++ b/lib/vhost/iotlb.c
@@ -115,7 +115,7 @@ vhost_user_iotlb_pending_remove_all(struct virtio_net *dev)
 
 	rte_rwlock_write_lock(&dev->iotlb_pending_lock);
 
-	RTE_TAILQ_FOREACH_SAFE(node, &dev->iotlb_pending_list, next, temp_node) {
+	TAILQ_FOREACH_SAFE(node, &dev->iotlb_pending_list, next, temp_node) {
 		TAILQ_REMOVE(&dev->iotlb_pending_list, node, next);
 		vhost_user_iotlb_pool_put(dev, node);
 	}
@@ -181,7 +181,7 @@ vhost_user_iotlb_pending_remove(struct virtio_net *dev, uint64_t iova, uint64_t
 
 	rte_rwlock_write_lock(&dev->iotlb_pending_lock);
 
-	RTE_TAILQ_FOREACH_SAFE(node, &dev->iotlb_pending_list, next,
+	TAILQ_FOREACH_SAFE(node, &dev->iotlb_pending_list, next,
 				temp_node) {
 		if (node->iova < iova)
 			continue;
@@ -203,7 +203,7 @@ vhost_user_iotlb_cache_remove_all(struct virtio_net *dev)
 
 	vhost_user_iotlb_wr_lock_all(dev);
 
-	RTE_TAILQ_FOREACH_SAFE(node, &dev->iotlb_list, next, temp_node) {
+	TAILQ_FOREACH_SAFE(node, &dev->iotlb_list, next, temp_node) {
 		vhost_user_iotlb_clear_dump(dev, node, NULL, NULL);
 
 		TAILQ_REMOVE(&dev->iotlb_list, node, next);
@@ -226,9 +226,9 @@ vhost_user_iotlb_cache_random_evict(struct virtio_net *dev)
 
 	entry_idx = rte_rand() % dev->iotlb_cache_nr;
 
-	RTE_TAILQ_FOREACH_SAFE(node, &dev->iotlb_list, next, temp_node) {
+	TAILQ_FOREACH_SAFE(node, &dev->iotlb_list, next, temp_node) {
 		if (!entry_idx) {
-			struct vhost_iotlb_entry *next_node = RTE_TAILQ_NEXT(node, next);
+			struct vhost_iotlb_entry *next_node = TAILQ_NEXT(node, next);
 
 			vhost_user_iotlb_clear_dump(dev, node, prev_node, next_node);
 
@@ -314,13 +314,13 @@ vhost_user_iotlb_cache_remove(struct virtio_net *dev, uint64_t iova, uint64_t si
 
 	vhost_user_iotlb_wr_lock_all(dev);
 
-	RTE_TAILQ_FOREACH_SAFE(node, &dev->iotlb_list, next, temp_node) {
+	TAILQ_FOREACH_SAFE(node, &dev->iotlb_list, next, temp_node) {
 		/* Sorted list */
 		if (unlikely(iova + size < node->iova))
 			break;
 
 		if (iova < node->iova + node->size) {
-			struct vhost_iotlb_entry *next_node = RTE_TAILQ_NEXT(node, next);
+			struct vhost_iotlb_entry *next_node = TAILQ_NEXT(node, next);
 
 			vhost_user_iotlb_clear_dump(dev, node, prev_node, next_node);
 
diff --git a/lib/vhost/vdpa.c b/lib/vhost/vdpa.c
index 4f2b7e0013..75c34f4d66 100644
--- a/lib/vhost/vdpa.c
+++ b/lib/vhost/vdpa.c
@@ -137,7 +137,7 @@ rte_vdpa_unregister_device(struct rte_vdpa_device *dev)
 	int ret = -1;
 
 	rte_spinlock_lock(&vdpa_device_list_lock);
-	RTE_TAILQ_FOREACH_SAFE(cur_dev, vdpa_device_list, next, tmp_dev) {
+	TAILQ_FOREACH_SAFE(cur_dev, vdpa_device_list, next, tmp_dev) {
 		if (dev != cur_dev)
 			continue;
 
diff --git a/lib/vhost/vdpa_driver.h b/lib/vhost/vdpa_driver.h
index 42392a0d14..db640013ef 100644
--- a/lib/vhost/vdpa_driver.h
+++ b/lib/vhost/vdpa_driver.h
@@ -87,7 +87,7 @@ struct rte_vdpa_dev_ops {
  * vdpa device structure includes device address and device operations.
  */
 struct rte_vdpa_device {
-	RTE_TAILQ_ENTRY(rte_vdpa_device) next;
+	TAILQ_ENTRY(rte_vdpa_device) next;
 	/** Generic device information */
 	struct rte_device *device;
 	/** vdpa device operations */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* [PATCH 6/6] devtools: forbid direct use of sys/queue.h
  2026-09-17 17:19 [PATCH 0/6] provide a complete set of BSD list macros Stephen Hemminger
                   ` (4 preceding siblings ...)
  2026-09-17 17:19 ` [PATCH 5/6] eal: deprecate RTE_TAILQ and RTE_STAILQ macro wrappers Stephen Hemminger
@ 2026-09-17 17:19 ` Stephen Hemminger
  2026-09-18 11:34 ` [PATCH 0/6] provide a complete set of BSD list macros Marat Khalili
  6 siblings, 0 replies; 9+ messages in thread
From: Stephen Hemminger @ 2026-09-17 17:19 UTC (permalink / raw)
  To: dev; +Cc: Stephen Hemminger, Thomas Monjalon

The set of list macros provided by <sys/queue.h> differs per platform:
glibc lacks the _FOREACH_SAFE variants, and musl and Windows have no such
header. DPDK now provides rte_queue.h with the complete set.

Both headers use the same multiple inclusion guard, so a single direct
include of <sys/queue.h> anywhere in a translation unit disables
rte_queue.h for all of it. Reject new occurrences.

Signed-off-by: Stephen Hemminger <stephen@networkplumber.org>
---
 devtools/checkpatches.sh                 | 9 +++++++++
 doc/guides/contributing/coding_style.rst | 5 ++++-
 2 files changed, 13 insertions(+), 1 deletion(-)

diff --git a/devtools/checkpatches.sh b/devtools/checkpatches.sh
index 18bd825372..a8ff4bfe82 100755
--- a/devtools/checkpatches.sh
+++ b/devtools/checkpatches.sh
@@ -105,6 +105,15 @@ check_forbidden_additions() { # <patch>
 		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
 		"$1" || res=1
 
+	# include rte_queue.h, the system header has fewer macros
+	awk -v FOLDERS="lib drivers app examples" \
+		-v SKIP_FILES='lib/eal/include/rte_queue.h' \
+		-v EXPRESSIONS='include.*<sys/queue.h>' \
+		-v RET_ON_FAIL=1 \
+		-v MESSAGE='Using <sys/queue.h>, prefer <rte_queue.h>' \
+		-f $(dirname $(readlink -f $0))/check-forbidden-tokens.awk \
+		"$1" || res=1
+
 	# check %l or %ll format specifier
 	awk -v FOLDERS='lib drivers app examples' \
 		-v EXPRESSIONS='%ll*[xud]' \
diff --git a/doc/guides/contributing/coding_style.rst b/doc/guides/contributing/coding_style.rst
index 11de3bb39a..f2c2cd8503 100644
--- a/doc/guides/contributing/coding_style.rst
+++ b/doc/guides/contributing/coding_style.rst
@@ -317,11 +317,14 @@ Queues
 ~~~~~~
 
 Use queue(3) macros rather than rolling your own lists, whenever possible.
+Include ``<rte_queue.h>`` rather than ``<sys/queue.h>``:
+the set of macros provided by the system header differs per platform,
+and the DPDK one provides the same complete set everywhere.
 Thus, the previous example would be better written:
 
 .. code-block:: c
 
- #include <sys/queue.h>
+ #include <rte_queue.h>
 
  struct foo {
          LIST_ENTRY(foo) link;      /* Use queue macros for foo lists. */
-- 
2.53.0


^ permalink raw reply related	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/6] provide a complete set of BSD list macros
  2026-09-17 17:19 [PATCH 0/6] provide a complete set of BSD list macros Stephen Hemminger
                   ` (5 preceding siblings ...)
  2026-09-17 17:19 ` [PATCH 6/6] devtools: forbid direct use of sys/queue.h Stephen Hemminger
@ 2026-09-18 11:34 ` Marat Khalili
  2026-09-18 11:50   ` Bruce Richardson
  6 siblings, 1 reply; 9+ messages in thread
From: Marat Khalili @ 2026-09-18 11:34 UTC (permalink / raw)
  To: dev

The patch set generally looks good to me, and ensures that DPDK itself 
builds. However, there might be a problem with building external 
applications IIUC: if DPDK header using any of the macros missing in 
system <sys/queue.h> is included after <sys/queue.h> the build will fail 
for reasons not immediately clear to the user.

I think this specific case can be improved in one of the following ways:

1. Remove the _SYS_QUEUE_H_ guard and undef or guard each macro 
independently (the file should still define _SYS_QUEUE_H_ to prevent the 
converse failure).

2. Detect the situation described above and provide more helpful 
diagnostic suggesting a workaround (remove <sys/queue.h> or move it 
after DPDK headers).

I myself prefer #1, since swapping or removing includes might be 
difficult in big projects.


^ permalink raw reply	[flat|nested] 9+ messages in thread

* Re: [PATCH 0/6] provide a complete set of BSD list macros
  2026-09-18 11:34 ` [PATCH 0/6] provide a complete set of BSD list macros Marat Khalili
@ 2026-09-18 11:50   ` Bruce Richardson
  0 siblings, 0 replies; 9+ messages in thread
From: Bruce Richardson @ 2026-09-18 11:50 UTC (permalink / raw)
  To: Marat Khalili; +Cc: dev

On Fri, Sep 18, 2026 at 12:34:47PM +0100, Marat Khalili wrote:
> The patch set generally looks good to me, and ensures that DPDK itself
> builds. However, there might be a problem with building external
> applications IIUC: if DPDK header using any of the macros missing in system
> <sys/queue.h> is included after <sys/queue.h> the build will fail for
> reasons not immediately clear to the user.
> 
> I think this specific case can be improved in one of the following ways:
> 
> 1. Remove the _SYS_QUEUE_H_ guard and undef or guard each macro
> independently (the file should still define _SYS_QUEUE_H_ to prevent the
> converse failure).
> 
> 2. Detect the situation described above and provide more helpful diagnostic
> suggesting a workaround (remove <sys/queue.h> or move it after DPDK
> headers).
> 
> I myself prefer #1, since swapping or removing includes might be difficult
> in big projects.
> 
+1 to option #1. However, it probably doesn't need to be implemented for
everything - just the extra macros not in normal linux queue.h

^ permalink raw reply	[flat|nested] 9+ messages in thread

end of thread, other threads:[~2026-09-18 11:50 UTC | newest]

Thread overview: 9+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-09-17 17:19 [PATCH 0/6] provide a complete set of BSD list macros Stephen Hemminger
2026-09-17 17:19 ` [PATCH 1/6] net/bnxt: fix use after free when freeing filters Stephen Hemminger
2026-09-17 17:19 ` [PATCH 2/6] eal: add rte_queue.h with full set of list macros Stephen Hemminger
2026-09-17 17:19 ` [PATCH 3/6] build: use rte_queue.h instead of sys/queue.h Stephen Hemminger
2026-09-17 17:19 ` [PATCH 4/6] build: remove private FOREACH_SAFE definitions Stephen Hemminger
2026-09-17 17:19 ` [PATCH 5/6] eal: deprecate RTE_TAILQ and RTE_STAILQ macro wrappers Stephen Hemminger
2026-09-17 17:19 ` [PATCH 6/6] devtools: forbid direct use of sys/queue.h Stephen Hemminger
2026-09-18 11:34 ` [PATCH 0/6] provide a complete set of BSD list macros Marat Khalili
2026-09-18 11:50   ` Bruce Richardson

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox