resolve issues with sys/queue.h
Subsystems (8)
cover resolve issues with sys/queue.h
This patchset cleans up the queue.h macro problems in DPDK. The root cause is that sys/queue.h in Linux is an old version from early BSD; my best guess is that it is a BSD GPL license issue that it never got updated. The Linux version is missing several useful macros which leads to redefiniton, bugs, etc.
The patch starts out by introducing a version of the current FreeBSD queue.h named as bsd_queue.h, then uses it across all of DPDK. The file sys/queue.h is no longer used. Ends up doing one line change on lots of files.
Stephen Hemminger (47):
eal: add BSD version of queue.h
net/nfp: fix use after free
eal: use bsd_queue.h
test: remove unnecessary inclusion of sys/queue.h
testpmd: use bsd_queue.h
dumpcap: use bsd_queue.h
proc-info: remove unnecessary sys/queue.h
doc: suggest bsd_queue.h
test-pipeline: remove unnecessary use of sys/queue.h
test-eventdev: use bsd_queue.h
test-bbdev, test-cmdline, test-mldev: don't use sys/queue.h
examples: replace use of sys/queue.h
hash: do not include sys/queue.h
lpm: do not include sys/queue.h
log: replace use of sys/queue.h
ethdev: replace use of sys/queue.h
bpf: replace use of sys/queue.h
mempool: do not need sys/queue.h
lib: remove use of sys/queue.h
bus/fslmc: use rte_tailq.h
drivers/bus: replace use of sys/queue.h
net/qede: use bsd_queue.h
net/bnxt: remove use of sys/queue.h
net/intel: remove use of sys/queue.h
net/mlx5: remove unnecessary include of sys/queue.h net/tap: remove unnecessary include of sys/queue.h net/axgbe: replace use of sys/queue.h
net/bnx2x: replace use of sys/queue.h net/bonding: replace use of sys/queue.h net/cxgbe: replace use of sys/queue.h
net/enic: replace use of sys/queue.h net/failsafe: replace use of sys/queue.h net/memif: replace use of sys/queue.h
net/mlx4: replace use of sys/queue.h
net/ngbe: replace use of sys/queue.h
net/ntnic: replace use of sys/queue.h
net/sfc: replace use of sys/queue.h
net/softnic: replace use of sys/queue.h net/thunderx: replace use of sys/queue.h net/txgbe: replace use of sys/queue.h net/vdev_netvsc: replace use of sys/queue.h net/vmxnet3: replace use of sys/queue.h
net/zxdh: replace use of sys/queue.h
net/dpaa2: replace use of sys/queue.h
eal: remove no longer used windows version of queue.h net/mvpp2: replace local definition of FOREACH_SAFE drivers/raw: replace with TAILQ_FOREACH_SAFE
app/dumpcap/main.c | 2 +-
app/proc-info/main.c | 1 -
app/test-bbdev/main.h | 1 -
app/test-cmdline/cmdline_test.c | 1 -
app/test-eventdev/evt_test.c | 2 +-
app/test-eventdev/evt_test.h | 1 -
app/test-mldev/ml_test.h | 1 -
app/test-pipeline/config.c | 1 -
app/test-pipeline/init.c | 1 -
app/test-pipeline/main.c | 1 -
app/test-pipeline/runtime.c | 1 -
app/test-pmd/5tswap.c | 2 -
app/test-pmd/cmdline.c | 2 +-
app/test-pmd/config.c | 2 +-
app/test-pmd/csumonly.c | 1 -
app/test-pmd/flowgen.c | 1 -
app/test-pmd/hairpin.c | 1 -
app/test-pmd/icmpecho.c | 1 -
app/test-pmd/iofwd.c | 1 -
app/test-pmd/macfwd.c | 1 -
app/test-pmd/macswap.c | 1 -
app/test-pmd/noisy_vnf.c | 1 -
app/test-pmd/parameters.c | 1 -
app/test-pmd/rxonly.c | 1 -
app/test-pmd/testpmd.c | 1 -
app/test-pmd/testpmd.h | 2 +-
app/test-pmd/txonly.c | 1 -
app/test/commands.c | 2 +-
app/test/test.c | 1 -
app/test/test.h | 2 +-
app/test/test_atomic.c | 1 -
app/test/test_cmdline_lib.c | 1 -
app/test/test_func_reentrancy.c | 1 -
app/test/test_hash.c | 1 -
app/test/test_hash_functions.c | 1 -
app/test/test_link_bonding.c | 1 -
app/test/test_link_bonding_mode4.c | 1 -
app/test/test_link_bonding_rssconf.c | 1 -
app/test/test_logs.c | 1 -
app/test/test_malloc.c | 1 -
app/test/test_mbuf.c | 1 -
app/test/test_mcslock.c | 1 -
app/test/test_mempool.c | 1 -
app/test/test_mempool_perf.c | 1 -
app/test/test_memzone.c | 1 -
app/test/test_mp_secondary.c | 1 -
app/test/test_per_lcore.c | 1 -
app/test/test_pflock.c | 1 -
app/test/test_ring.c | 1 -
app/test/test_rwlock.c | 1 -
app/test/test_soring.c | 1 -
app/test/test_spinlock.c | 1 -
app/test/test_tailq.c | 1 -
app/test/test_ticketlock.c | 1 -
app/test/test_timer.c | 1 -
doc/guides/contributing/coding_style.rst | 4 +-
drivers/bus/auxiliary/auxiliary_common.c | 2 +-
drivers/bus/auxiliary/private.h | 2 +-
drivers/bus/fslmc/bus_fslmc_driver.h | 1 -
drivers/bus/fslmc/fslmc_vfio.c | 1 +
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 11 +-
drivers/bus/ifpga/ifpga_bus.c | 2 +-
drivers/bus/pci/bsd/pci.c | 2 +-
drivers/bus/pci/pci_common.c | 1 -
drivers/bus/pci/pci_params.c | 2 -
drivers/bus/pci/windows/pci.c | 3 +-
drivers/bus/pci/windows/pci_netuio.c | 2 -
drivers/bus/platform/platform.c | 2 +-
drivers/bus/vdev/vdev.c | 1 -
drivers/bus/vmbus/vmbus_common.c | 1 -
drivers/net/axgbe/axgbe_common.h | 1 -
drivers/net/bnx2x/bnx2x_ethdev.h | 1 -
drivers/net/bnxt/bnxt.h | 1 -
drivers/net/bnxt/bnxt_filter.c | 7 +-
drivers/net/bnxt/bnxt_flow.c | 1 -
drivers/net/bnxt/bnxt_vnic.h | 1 -
drivers/net/bnxt/tf_ulp/bnxt_ulp.h | 1 -
drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c | 1 -
drivers/net/bonding/eth_bond_private.h | 1 -
drivers/net/bonding/rte_eth_bond_flow.c | 1 -
drivers/net/cxgbe/cxgbe_ethdev.c | 2 +-
drivers/net/cxgbe/cxgbe_main.c | 1 -
drivers/net/cxgbe/sge.c | 1 -
drivers/net/dpaa2/dpaa2_flow.c | 1 -
drivers/net/dpaa2/dpaa2_mux.c | 1 -
drivers/net/dpaa2/dpaa2_ptp.c | 1 -
drivers/net/enic/enic.h | 1 -
drivers/net/failsafe/failsafe_flow.c | 1 -
drivers/net/failsafe/failsafe_private.h | 2 +-
drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c | 1 -
drivers/net/intel/e1000/e1000_ethdev.h | 1 -
drivers/net/intel/e1000/em_ethdev.c | 1 -
drivers/net/intel/e1000/em_rxtx.c | 1 -
drivers/net/intel/e1000/igb_ethdev.c | 2 +-
drivers/net/intel/e1000/igb_flow.c | 2 +-
drivers/net/intel/e1000/igb_rxtx.c | 1 -
drivers/net/intel/i40e/i40e_ethdev.c | 9 +-
drivers/net/intel/i40e/i40e_ethdev.h | 1 -
drivers/net/intel/i40e/i40e_fdir.c | 2 +-
drivers/net/intel/i40e/i40e_flow.c | 1 -
drivers/net/intel/i40e/i40e_hash.c | 1 -
drivers/net/intel/i40e/i40e_pf.c | 1 -
drivers/net/intel/i40e/i40e_rxtx.c | 1 -
drivers/net/intel/iavf/iavf.h | 1 -
drivers/net/intel/iavf/iavf_ethdev.c | 1 -
drivers/net/intel/iavf/iavf_fdir.c | 1 -
drivers/net/intel/iavf/iavf_fsub.c | 1 -
drivers/net/intel/iavf/iavf_generic_flow.c | 1 -
drivers/net/intel/iavf/iavf_hash.c | 1 -
drivers/net/intel/iavf/iavf_rxtx.c | 1 -
drivers/net/intel/iavf/iavf_vchnl.c | 7 -
drivers/net/intel/ice/base/ice_osdep.h | 2 +-
drivers/net/intel/ice/ice_acl_filter.c | 1 -
drivers/net/intel/ice/ice_dcf.c | 2 +-
drivers/net/intel/ice/ice_dcf_ethdev.c | 1 -
drivers/net/intel/ice/ice_ethdev.c | 8 +-
drivers/net/intel/ice/ice_generic_flow.c | 1 -
drivers/net/intel/ice/ice_hash.c | 1 -
drivers/net/intel/ice/ice_switch_filter.c | 1 -
drivers/net/intel/idpf/base/idpf_osdep.h | 9 +-
drivers/net/intel/ipn3ke/ipn3ke_ethdev.h | 1 -
drivers/net/intel/ipn3ke/ipn3ke_flow.c | 1 -
drivers/net/intel/ixgbe/ixgbe_ethdev.c | 2 +-
drivers/net/intel/ixgbe/ixgbe_ethdev.h | 1 -
drivers/net/intel/ixgbe/ixgbe_fdir.c | 2 +-
drivers/net/intel/ixgbe/ixgbe_flow.c | 2 +-
drivers/net/intel/ixgbe/ixgbe_rxtx.c | 1 -
drivers/net/memif/memif_socket.h | 1 -
drivers/net/memif/rte_eth_memif.h | 1 -
drivers/net/mlx4/mlx4.h | 1 -
drivers/net/mlx4/mlx4_flow.c | 2 +-
drivers/net/mlx4/mlx4_flow.h | 1 -
drivers/net/mlx4/mlx4_mr.h | 1 -
drivers/net/mlx4/mlx4_rxtx.h | 1 -
drivers/net/mlx5/hws/mlx5dr_internal.h | 1 -
drivers/net/mlx5/linux/mlx5_verbs.c | 1 -
drivers/net/mlx5/mlx5.h | 2 +-
drivers/net/mlx5/mlx5_devx.c | 1 -
drivers/net/mlx5/mlx5_flow.c | 2 +-
drivers/net/mlx5/mlx5_flow.h | 2 +-
drivers/net/mlx5/mlx5_flow_dv.c | 1 -
drivers/net/mlx5/mlx5_flow_verbs.c | 2 +-
drivers/net/mlx5/mlx5_rx.h | 1 -
drivers/net/mlx5/mlx5_rxq.c | 2 +-
drivers/net/mlx5/mlx5_rxtx.h | 1 -
drivers/net/mlx5/mlx5_tx.h | 1 -
drivers/net/mvpp2/mrvl_mtr.c | 8 +-
drivers/net/nfp/nfp_mtr.c | 12 +-
drivers/net/ngbe/ngbe_ethdev_vf.c | 1 -
drivers/net/ngbe/ngbe_rxtx.c | 1 -
drivers/net/ntnic/ntnic_ethdev.c | 1 -
drivers/net/qede/qede_ethdev.h | 3 +-
drivers/net/qede/qede_filter.c | 6 -
drivers/net/sfc/sfc_dp.c | 2 +-
drivers/net/sfc/sfc_dp.h | 1 -
.../net/softnic/rte_eth_softnic_internals.h | 1 -
drivers/net/tap/rte_eth_tap.h | 1 -
drivers/net/tap/tap_flow.c | 1 -
drivers/net/thunderx/base/nicvf_bsvf.h | 2 +-
drivers/net/thunderx/base/nicvf_plat.h | 1 +
drivers/net/thunderx/nicvf_ethdev.c | 1 -
drivers/net/txgbe/txgbe_ethdev_vf.c | 1 -
drivers/net/txgbe/txgbe_fdir.c | 2 +-
drivers/net/txgbe/txgbe_flow.c | 2 +-
drivers/net/txgbe/txgbe_rxtx.c | 1 -
drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 -
drivers/net/vmxnet3/vmxnet3_rxtx.c | 1 -
drivers/net/zxdh/zxdh_mtr.h | 1 -
drivers/raw/ifpga/base/ifpga_enumerate.c | 6 +-
drivers/raw/ifpga/base/opae_intel_max10.c | 8 +-
examples/bbdev_app/main.c | 2 +-
examples/bond/main.c | 2 +-
examples/cmdline/main.c | 1 -
examples/cmdline/parse_obj_list.h | 2 +-
examples/flow_filtering/main.c | 1 -
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 | 1 -
examples/l2fwd-keepalive/ka-agent/main.c | 1 -
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 | 1 -
examples/l3fwd/l3fwd_lpm.c | 1 -
examples/l3fwd/main.c | 2 +-
examples/link_status_interrupt/main.c | 2 +-
.../client_server_mp/mp_client/client.c | 1 -
.../client_server_mp/mp_server/init.c | 1 -
.../client_server_mp/mp_server/main.c | 2 +-
examples/multi_process/hotplug_mp/main.c | 1 -
examples/multi_process/simple_mp/main.c | 2 +-
examples/multi_process/symmetric_mp/main.c | 2 +-
examples/server_node_efd/efd_node/node.c | 1 -
examples/server_node_efd/efd_server/init.c | 1 -
examples/server_node_efd/efd_server/main.c | 1 -
examples/service_cores/main.c | 1 -
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 | 1 -
lib/bbdev/rte_bbdev.c | 2 +-
lib/bpf/bpf_load_elf.c | 1 -
lib/bpf/bpf_pkt.c | 3 +-
lib/cryptodev/cryptodev_pmd.c | 1 -
lib/cryptodev/rte_cryptodev.c | 1 -
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_tailqs.c | 2 +-
lib/eal/common/eal_common_trace.c | 2 +-
lib/eal/common/eal_private.h | 2 +-
lib/eal/common/malloc_elem.c | 2 +-
lib/eal/common/malloc_heap.c | 2 +-
lib/eal/common/malloc_heap.h | 2 +-
lib/eal/common/rte_malloc.c | 2 +-
lib/eal/freebsd/eal.c | 2 +-
lib/eal/freebsd/eal_interrupts.c | 2 +-
lib/eal/freebsd/eal_thread.c | 2 +-
lib/eal/freebsd/include/rte_os.h | 6 +-
.../sys/queue.h => include/bsd_queue.h} | 683 ++++++++++++------
lib/eal/linux/eal_alarm.c | 2 +-
lib/eal/linux/eal_interrupts.c | 2 +-
lib/eal/linux/include/rte_os.h | 3 +-
lib/eal/windows/eal_alarm.c | 2 +-
lib/efd/rte_efd.c | 1 -
lib/ethdev/ethdev_private.h | 3 +-
lib/ethdev/rte_ethdev.c | 2 +-
lib/fib/rte_fib.c | 1 -
lib/fib/rte_fib6.c | 1 -
lib/gpudev/gpudev_driver.h | 1 -
lib/graph/graph_private.h | 1 -
lib/hash/rte_cuckoo_hash.c | 1 -
lib/hash/rte_fbk_hash.c | 1 -
lib/hash/rte_thash.c | 1 -
lib/ip_frag/ip_frag_common.h | 3 +-
lib/log/log.c | 2 +-
lib/lpm/rte_lpm.c | 1 -
lib/lpm/rte_lpm6.c | 1 -
lib/mbuf/rte_mbuf_dyn.c | 1 -
lib/mempool/rte_mempool.c | 1 -
lib/pipeline/rte_swx_ctl.c | 1 -
lib/pipeline/rte_swx_pipeline_internal.h | 3 +-
lib/pmu/pmu.c | 1 -
lib/reorder/rte_reorder.c | 1 -
lib/rib/rte_rib.c | 1 -
lib/rib/rte_rib6.c | 1 -
lib/ring/rte_ring.c | 1 -
lib/stack/rte_stack.c | 1 -
lib/vhost/fd_man.h | 1 -
lib/vhost/socket.c | 2 +-
lib/vhost/vdpa.c | 2 -
lib/vhost/vhost.h | 2 +-
273 files changed, 589 insertions(+), 562 deletions(-)
rename lib/eal/{windows/include/sys/queue.h => include/bsd_queue.h} (52%)Signature · 332 lines
2.47.2
Stephen Hemminger (47):
eal: add BSD version of queue.h
net/nfp: fix use after free
eal: use bsd_queue.h
test: remove unnecessary inclusion of sys/queue.h
testpmd: use bsd_queue.h
dumpcap: use bsd_queue.h
proc-info: remove unnecessary sys/queue.h
doc: suggest bsd_queue.h
test-pipeline: remove unnecessary use of sys/queue.h
test-eventdev: use bsd_queue.h
test-bbdev, test-cmdline, test-mldev: don't use sys/queue.h
examples: replace use of sys/queue.h
hash: do not include sys/queue.h
lpm: do not include sys/queue.h
log: replace use of sys/queue.h
ethdev: replace use of sys/queue.h
bpf: replace use of sys/queue.h
mempool: do not need sys/queue.h
lib: remove use of sys/queue.h
bus/fslmc: use rte_tailq.h
drivers/bus: replace use of sys/queue.h
net/qede: use bsd_queue.h
net/bnxt: remove use of sys/queue.h
net/intel: remove use of sys/queue.h
net/mlx5: remove unnecessary include of sys/queue.h
net/tap: remove unnecessary include of sys/queue.h
net/axgbe: replace use of sys/queue.h
net/bnx2x: replace use of sys/queue.h
net/bonding: replace use of sys/queue.h
net/cxgbe: replace use of sys/queue.h
net/enic: replace use of sys/queue.h
net/failsafe: replace use of sys/queue.h
net/memif: replace use of sys/queue.h
net/mlx4: replace use of sys/queue.h
net/ngbe: replace use of sys/queue.h
net/ntnic: replace use of sys/queue.h
net/sfc: replace use of sys/queue.h
net/softnic: replace use of sys/queue.h
net/thunderx: replace use of sys/queue.h
net/txgbe: replace use of sys/queue.h
net/vdev_netvsc: replace use of sys/queue.h
net/vmxnet3: replace use of sys/queue.h
net/zxdh: replace use of sys/queue.h
net/dpaa2: replace use of sys/queue.h
eal: remove no longer used windows version of queue.h
net/mvpp2: replace local definition of FOREACH_SAFE
drivers/raw: replace with TAILQ_FOREACH_SAFE
app/dumpcap/main.c | 2 +-
app/proc-info/main.c | 1 -
app/test-bbdev/main.h | 1 -
app/test-cmdline/cmdline_test.c | 1 -
app/test-eventdev/evt_test.c | 2 +-
app/test-eventdev/evt_test.h | 1 -
app/test-mldev/ml_test.h | 1 -
app/test-pipeline/config.c | 1 -
app/test-pipeline/init.c | 1 -
app/test-pipeline/main.c | 1 -
app/test-pipeline/runtime.c | 1 -
app/test-pmd/5tswap.c | 2 -
app/test-pmd/cmdline.c | 2 +-
app/test-pmd/config.c | 2 +-
app/test-pmd/csumonly.c | 1 -
app/test-pmd/flowgen.c | 1 -
app/test-pmd/hairpin.c | 1 -
app/test-pmd/icmpecho.c | 1 -
app/test-pmd/iofwd.c | 1 -
app/test-pmd/macfwd.c | 1 -
app/test-pmd/macswap.c | 1 -
app/test-pmd/noisy_vnf.c | 1 -
app/test-pmd/parameters.c | 1 -
app/test-pmd/rxonly.c | 1 -
app/test-pmd/testpmd.c | 1 -
app/test-pmd/testpmd.h | 2 +-
app/test-pmd/txonly.c | 1 -
app/test/commands.c | 2 +-
app/test/test.c | 1 -
app/test/test.h | 2 +-
app/test/test_atomic.c | 1 -
app/test/test_cmdline_lib.c | 1 -
app/test/test_func_reentrancy.c | 1 -
app/test/test_hash.c | 1 -
app/test/test_hash_functions.c | 1 -
app/test/test_link_bonding.c | 1 -
app/test/test_link_bonding_mode4.c | 1 -
app/test/test_link_bonding_rssconf.c | 1 -
app/test/test_logs.c | 1 -
app/test/test_malloc.c | 1 -
app/test/test_mbuf.c | 1 -
app/test/test_mcslock.c | 1 -
app/test/test_mempool.c | 1 -
app/test/test_mempool_perf.c | 1 -
app/test/test_memzone.c | 1 -
app/test/test_mp_secondary.c | 1 -
app/test/test_per_lcore.c | 1 -
app/test/test_pflock.c | 1 -
app/test/test_ring.c | 1 -
app/test/test_rwlock.c | 1 -
app/test/test_soring.c | 1 -
app/test/test_spinlock.c | 1 -
app/test/test_tailq.c | 1 -
app/test/test_ticketlock.c | 1 -
app/test/test_timer.c | 1 -
doc/guides/contributing/coding_style.rst | 4 +-
drivers/bus/auxiliary/auxiliary_common.c | 2 +-
drivers/bus/auxiliary/private.h | 2 +-
drivers/bus/fslmc/bus_fslmc_driver.h | 1 -
drivers/bus/fslmc/fslmc_vfio.c | 1 +
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 11 +-
drivers/bus/ifpga/ifpga_bus.c | 2 +-
drivers/bus/pci/bsd/pci.c | 2 +-
drivers/bus/pci/pci_common.c | 1 -
drivers/bus/pci/pci_params.c | 2 -
drivers/bus/pci/windows/pci.c | 3 +-
drivers/bus/pci/windows/pci_netuio.c | 2 -
drivers/bus/platform/platform.c | 2 +-
drivers/bus/vdev/vdev.c | 1 -
drivers/bus/vmbus/vmbus_common.c | 1 -
drivers/net/axgbe/axgbe_common.h | 1 -
drivers/net/bnx2x/bnx2x_ethdev.h | 1 -
drivers/net/bnxt/bnxt.h | 1 -
drivers/net/bnxt/bnxt_filter.c | 7 +-
drivers/net/bnxt/bnxt_flow.c | 1 -
drivers/net/bnxt/bnxt_vnic.h | 1 -
drivers/net/bnxt/tf_ulp/bnxt_ulp.h | 1 -
drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c | 1 -
drivers/net/bonding/eth_bond_private.h | 1 -
drivers/net/bonding/rte_eth_bond_flow.c | 1 -
drivers/net/cxgbe/cxgbe_ethdev.c | 2 +-
drivers/net/cxgbe/cxgbe_main.c | 1 -
drivers/net/cxgbe/sge.c | 1 -
drivers/net/dpaa2/dpaa2_flow.c | 1 -
drivers/net/dpaa2/dpaa2_mux.c | 1 -
drivers/net/dpaa2/dpaa2_ptp.c | 1 -
drivers/net/enic/enic.h | 1 -
drivers/net/failsafe/failsafe_flow.c | 1 -
drivers/net/failsafe/failsafe_private.h | 2 +-
drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c | 1 -
drivers/net/intel/e1000/e1000_ethdev.h | 1 -
drivers/net/intel/e1000/em_ethdev.c | 1 -
drivers/net/intel/e1000/em_rxtx.c | 1 -
drivers/net/intel/e1000/igb_ethdev.c | 2 +-
drivers/net/intel/e1000/igb_flow.c | 2 +-
drivers/net/intel/e1000/igb_rxtx.c | 1 -
drivers/net/intel/i40e/i40e_ethdev.c | 9 +-
drivers/net/intel/i40e/i40e_ethdev.h | 1 -
drivers/net/intel/i40e/i40e_fdir.c | 2 +-
drivers/net/intel/i40e/i40e_flow.c | 1 -
drivers/net/intel/i40e/i40e_hash.c | 1 -
drivers/net/intel/i40e/i40e_pf.c | 1 -
drivers/net/intel/i40e/i40e_rxtx.c | 1 -
drivers/net/intel/iavf/iavf.h | 1 -
drivers/net/intel/iavf/iavf_ethdev.c | 1 -
drivers/net/intel/iavf/iavf_fdir.c | 1 -
drivers/net/intel/iavf/iavf_fsub.c | 1 -
drivers/net/intel/iavf/iavf_generic_flow.c | 1 -
drivers/net/intel/iavf/iavf_hash.c | 1 -
drivers/net/intel/iavf/iavf_rxtx.c | 1 -
drivers/net/intel/iavf/iavf_vchnl.c | 7 -
drivers/net/intel/ice/base/ice_osdep.h | 2 +-
drivers/net/intel/ice/ice_acl_filter.c | 1 -
drivers/net/intel/ice/ice_dcf.c | 2 +-
drivers/net/intel/ice/ice_dcf_ethdev.c | 1 -
drivers/net/intel/ice/ice_ethdev.c | 8 +-
drivers/net/intel/ice/ice_generic_flow.c | 1 -
drivers/net/intel/ice/ice_hash.c | 1 -
drivers/net/intel/ice/ice_switch_filter.c | 1 -
drivers/net/intel/idpf/base/idpf_osdep.h | 9 +-
drivers/net/intel/ipn3ke/ipn3ke_ethdev.h | 1 -
drivers/net/intel/ipn3ke/ipn3ke_flow.c | 1 -
drivers/net/intel/ixgbe/ixgbe_ethdev.c | 2 +-
drivers/net/intel/ixgbe/ixgbe_ethdev.h | 1 -
drivers/net/intel/ixgbe/ixgbe_fdir.c | 2 +-
drivers/net/intel/ixgbe/ixgbe_flow.c | 2 +-
drivers/net/intel/ixgbe/ixgbe_rxtx.c | 1 -
drivers/net/memif/memif_socket.h | 1 -
drivers/net/memif/rte_eth_memif.h | 1 -
drivers/net/mlx4/mlx4.h | 1 -
drivers/net/mlx4/mlx4_flow.c | 2 +-
drivers/net/mlx4/mlx4_flow.h | 1 -
drivers/net/mlx4/mlx4_mr.h | 1 -
drivers/net/mlx4/mlx4_rxtx.h | 1 -
drivers/net/mlx5/hws/mlx5dr_internal.h | 1 -
drivers/net/mlx5/linux/mlx5_verbs.c | 1 -
drivers/net/mlx5/mlx5.h | 2 +-
drivers/net/mlx5/mlx5_devx.c | 1 -
drivers/net/mlx5/mlx5_flow.c | 2 +-
drivers/net/mlx5/mlx5_flow.h | 2 +-
drivers/net/mlx5/mlx5_flow_dv.c | 1 -
drivers/net/mlx5/mlx5_flow_verbs.c | 2 +-
drivers/net/mlx5/mlx5_rx.h | 1 -
drivers/net/mlx5/mlx5_rxq.c | 2 +-
drivers/net/mlx5/mlx5_rxtx.h | 1 -
drivers/net/mlx5/mlx5_tx.h | 1 -
drivers/net/mvpp2/mrvl_mtr.c | 8 +-
drivers/net/nfp/nfp_mtr.c | 12 +-
drivers/net/ngbe/ngbe_ethdev_vf.c | 1 -
drivers/net/ngbe/ngbe_rxtx.c | 1 -
drivers/net/ntnic/ntnic_ethdev.c | 1 -
drivers/net/qede/qede_ethdev.h | 3 +-
drivers/net/qede/qede_filter.c | 6 -
drivers/net/sfc/sfc_dp.c | 2 +-
drivers/net/sfc/sfc_dp.h | 1 -
.../net/softnic/rte_eth_softnic_internals.h | 1 -
drivers/net/tap/rte_eth_tap.h | 1 -
drivers/net/tap/tap_flow.c | 1 -
drivers/net/thunderx/base/nicvf_bsvf.h | 2 +-
drivers/net/thunderx/base/nicvf_plat.h | 1 +
drivers/net/thunderx/nicvf_ethdev.c | 1 -
drivers/net/txgbe/txgbe_ethdev_vf.c | 1 -
drivers/net/txgbe/txgbe_fdir.c | 2 +-
drivers/net/txgbe/txgbe_flow.c | 2 +-
drivers/net/txgbe/txgbe_rxtx.c | 1 -
drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 -
drivers/net/vmxnet3/vmxnet3_rxtx.c | 1 -
drivers/net/zxdh/zxdh_mtr.h | 1 -
drivers/raw/ifpga/base/ifpga_enumerate.c | 6 +-
drivers/raw/ifpga/base/opae_intel_max10.c | 8 +-
examples/bbdev_app/main.c | 2 +-
examples/bond/main.c | 2 +-
examples/cmdline/main.c | 1 -
examples/cmdline/parse_obj_list.h | 2 +-
examples/flow_filtering/main.c | 1 -
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 | 1 -
examples/l2fwd-keepalive/ka-agent/main.c | 1 -
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 | 1 -
examples/l3fwd/l3fwd_lpm.c | 1 -
examples/l3fwd/main.c | 2 +-
examples/link_status_interrupt/main.c | 2 +-
.../client_server_mp/mp_client/client.c | 1 -
.../client_server_mp/mp_server/init.c | 1 -
.../client_server_mp/mp_server/main.c | 2 +-
examples/multi_process/hotplug_mp/main.c | 1 -
examples/multi_process/simple_mp/main.c | 2 +-
examples/multi_process/symmetric_mp/main.c | 2 +-
examples/server_node_efd/efd_node/node.c | 1 -
examples/server_node_efd/efd_server/init.c | 1 -
examples/server_node_efd/efd_server/main.c | 1 -
examples/service_cores/main.c | 1 -
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 | 1 -
lib/bbdev/rte_bbdev.c | 2 +-
lib/bpf/bpf_load_elf.c | 1 -
lib/bpf/bpf_pkt.c | 3 +-
lib/cryptodev/cryptodev_pmd.c | 1 -
lib/cryptodev/rte_cryptodev.c | 1 -
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_tailqs.c | 2 +-
lib/eal/common/eal_common_trace.c | 2 +-
lib/eal/common/eal_private.h | 2 +-
lib/eal/common/malloc_elem.c | 2 +-
lib/eal/common/malloc_heap.c | 2 +-
lib/eal/common/malloc_heap.h | 2 +-
lib/eal/common/rte_malloc.c | 2 +-
lib/eal/freebsd/eal.c | 2 +-
lib/eal/freebsd/eal_interrupts.c | 2 +-
lib/eal/freebsd/eal_thread.c | 2 +-
lib/eal/freebsd/include/rte_os.h | 6 +-
.../sys/queue.h => include/bsd_queue.h} | 683 ++++++++++++------
lib/eal/include/meson.build | 1 +
lib/eal/linux/eal_alarm.c | 2 +-
lib/eal/linux/eal_interrupts.c | 2 +-
lib/eal/linux/include/rte_os.h | 3 +-
lib/eal/windows/eal_alarm.c | 2 +-
lib/efd/rte_efd.c | 1 -
lib/ethdev/ethdev_private.h | 3 +-
lib/ethdev/rte_ethdev.c | 2 +-
lib/fib/rte_fib.c | 1 -
lib/fib/rte_fib6.c | 1 -
lib/gpudev/gpudev_driver.h | 1 -
lib/graph/graph_private.h | 1 -
lib/hash/rte_cuckoo_hash.c | 1 -
lib/hash/rte_fbk_hash.c | 1 -
lib/hash/rte_thash.c | 1 -
lib/ip_frag/ip_frag_common.h | 3 +-
lib/log/log.c | 2 +-
lib/lpm/rte_lpm.c | 1 -
lib/lpm/rte_lpm6.c | 1 -
lib/mbuf/rte_mbuf_dyn.c | 1 -
lib/mempool/rte_mempool.c | 1 -
lib/pipeline/rte_swx_ctl.c | 1 -
lib/pipeline/rte_swx_pipeline_internal.h | 3 +-
lib/pmu/pmu.c | 1 -
lib/reorder/rte_reorder.c | 1 -
lib/rib/rte_rib.c | 1 -
lib/rib/rte_rib6.c | 1 -
lib/ring/rte_ring.c | 1 -
lib/stack/rte_stack.c | 1 -
lib/vhost/fd_man.h | 1 -
lib/vhost/socket.c | 2 +-
lib/vhost/vdpa.c | 2 -
lib/vhost/vhost.h | 2 +-
274 files changed, 590 insertions(+), 562 deletions(-)
rename lib/eal/{windows/include/sys/queue.h => include/bsd_queue.h} (52%)
--
2.47.2RFC 1/47 eal: add BSD version of queue.h
The version of sys/queue.h on Linux from glibc was derived from an older version of BSD and is missing several key macros such as LIST_FOREACH_SAFE. This leads to drivers re-implementing the macros (sometimes badly) and other bugs.
Introduce a version of queue.h derived from the current FreeBSD header (only comments changed).
--- lib/eal/include/bsd_queue.h | 1075 +++++++++++++++++++++++++++++++++++ lib/eal/include/meson.build | 1 + 2 files changed, 1076 insertions(+) create mode 100644 lib/eal/include/bsd_queue.h
lib/eal/include/bsd_queue.h new file +1075 -0
@@ -0,0 +1,1075 @@ +/*- +* 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 sys/queue.h which is used to overcome +* missing parts in the glibc version (and Windows). +*/ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_ + +#include <sys/cdefs.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 + + + + +* _END + + + + +* _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 + +* _REPLACE - + - + +* _SPLIT_AFTER + + + + +* _SWAP + + + + +* +*/ +#ifdef QUEUE_MACRO_DEBUG +#warn Use QUEUE_MACRO_DEBUG_xxx instead (TRACE, TRASH and/or ASSERTIONS) +#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 */ + +#if defined(QUEUE_MACRO_DEBUG_ASSERTIONS ) && \ + defined(QUEUE_MACRO_NO_DEBUG_ASSERTIONS ) +#error Both QUEUE_MACRO_DEBUG_ASSERTIONS and QUEUE_MACRO_NO_DEBUG_ASSERTIONS defined +#endif + +/* +* Automatically define QUEUE_MACRO_DEBUG_ASSERTIONS when compiling the kernel +* with INVARIANTS, if not already defined and not prevented by presence of +* QUEUE_MACRO_NO_DEBUG_ASSERTIONS. +*/ +#if !defined(QUEUE_MACRO_DEBUG_ASSERTIONS ) && \ + !defined(QUEUE_MACRO_NO_DEBUG_ASSERTIONS ) && \ + (defined(_KERNEL) && defined(INVARIANTS )) +#define QUEUE_MACRO_DEBUG_ASSERTIONS +#endif + +/* +* If queue assertions are enabled, provide default definitions for QMD_PANIC() +* and QMD_ASSERT() if undefined. +*/ +#ifdef QUEUE_MACRO_DEBUG_ASSERTIONS +#ifndef QMD_PANIC +#if defined(_KERNEL) || defined(_STANDALONE) +/* +* On _STANDALONE, either <stand.h> or the headers using <sys/queue.h> provide +* a declaration or macro for panic(). +*/ +#ifdef _KERNEL +#include <sys/kassert.h> +#endif +#define QMD_PANIC (fmt, ...) do { \ + panic(fmt, ##__VA_ARGS__); \ +} while (0) +#else /* !(_KERNEL || _STANDALONE) */ +#include <stdio.h> +#include <stdlib.h> +#define QMD_PANIC (fmt, ...) do { \ + fprintf(stderr, fmt "\n", ##__VA_ARGS__); \ + abort(); \ +} while (0) +#endif /* _KERNEL || _STANDALONE */ +#endif /* !QMD_PANIC */ + +#ifndef QMD_ASSERT +#define QMD_ASSERT (expression, fmt, ...) do { \ + if (__predict_false(!(expression))) \ + QMD_PANIC("%s:%u: %s: " fmt, \ + __FILE__, __LINE__, __func__, ##__VA_ARGS__); \ +} while (0) +#endif /* !QMD_ASSERT */ +#else /* !QUEUE_MACRO_DEBUG_ASSERTIONS */ +#undef QMD_ASSERT +#define QMD_ASSERT (test, fmt, ...) do {} while (0) +#endif /* QUEUE_MACRO_DEBUG_ASSERTIONS */ + + +#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 QMD_SLIST_CHECK_PREVPTR (prevp, elm) \ + QMD_ASSERT(*(prevp) == (elm), \ + "Bad prevptr *(%p) == %p != %p", \ + (prevp), *(prevp), (elm)) + +#define SLIST_ASSERT_EMPTY (head) \ + QMD_ASSERT(SLIST_EMPTY((head)), \ + "slist %p is not empty", (head)) + +#define SLIST_ASSERT_NONEMPTY (head) \ + QMD_ASSERT(!SLIST_EMPTY((head)), \ + "slist %p is empty", (head)) + +#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_EMPTY_ATOMIC (head) \ + (atomic_load_ptr(&(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 { \ + QMD_SAVELINK(_Oldnext, SLIST_NEXT(elm, field)->field.sle_next); \ + SLIST_NEXT(elm, field) = \ + SLIST_NEXT(SLIST_NEXT(elm, field), field); \ + TRASHIT(*_Oldnext); \ +} while (0) + +#define SLIST_REMOVE_HEAD (head, field) do { \ + QMD_SAVELINK(_Oldnext, SLIST_FIRST(head)->field.sle_next); \ + SLIST_FIRST((head)) = SLIST_NEXT(SLIST_FIRST((head)), field); \ + TRASHIT(*_Oldnext); \ +} 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_SPLIT_AFTER (head, elm, rest, field) do { \ + SLIST_ASSERT_NONEMPTY((head)); \ + SLIST_FIRST((rest)) = SLIST_NEXT((elm), field); \ + SLIST_NEXT((elm), field) = NULL; \ +} 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) + +#define SLIST_END (head) NULL + +/* +* 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. +*/ + +/* +* QMD_STAILQ_CHECK_EMPTY(STAILQ_HEAD *head) +* +* Validates that the stailq head's pointer to the last element's next pointer +* actually points to the head's first element pointer field. +*/ +#define QMD_STAILQ_CHECK_EMPTY (head) \ + QMD_ASSERT((head)->stqh_last == &(head)->stqh_first, \ + "Empty stailq %p->stqh_last is %p, " \ + "not head's first field address", \ + (head), (head)->stqh_last) + +/* +* QMD_STAILQ_CHECK_TAIL(STAILQ_HEAD *head) +* +* Validates that the stailq's last element's next pointer is NULL. +*/ +#define QMD_STAILQ_CHECK_TAIL (head) \ + QMD_ASSERT(*(head)->stqh_last == NULL, \ + "Stailq %p last element's next pointer is " \ + "%p, not NULL", (head), *(head)->stqh_last) + +#define STAILQ_ASSERT_EMPTY (head) \ + QMD_ASSERT(STAILQ_EMPTY((head)), \ + "stailq %p is not empty", (head)) + +#define STAILQ_ASSERT_NONEMPTY (head) \ + QMD_ASSERT(!STAILQ_EMPTY((head)), \ + "stailq %p is empty", (head)) + +#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) ({ \ + if (STAILQ_FIRST(head) == NULL) \ + QMD_STAILQ_CHECK_EMPTY(head); \ + STAILQ_FIRST(head) == NULL; \ +}) + +#define STAILQ_EMPTY_ATOMIC (head) \ + (atomic_load_ptr(&(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 { \ + QMD_STAILQ_CHECK_TAIL(head); \ + 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_SPLIT_AFTER (head, elm, rest, field) do { \ + STAILQ_ASSERT_NONEMPTY((head)); \ + QMD_STAILQ_CHECK_TAIL((head)); \ + if (STAILQ_NEXT((elm), field) == NULL) \ +/* 'elm' is the last element in 'head'. */ \ +STAILQ_INIT ((rest)); \ + else { \ +STAILQ_FIRST ((rest)) =STAILQ_NEXT ((elm), field); \ + (rest)->stqh_last = (head)->stqh_last; \ +STAILQ_NEXT ((elm), field) =NULL ; \ + (head)->stqh_last = &STAILQ_NEXT ((elm), field); \ + } \ +} 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_FIRST(head1) == NULL) \ + (head1)->stqh_last = &STAILQ_FIRST(head1); \ + if (STAILQ_FIRST(head2) == NULL) \ + (head2)->stqh_last = &STAILQ_FIRST(head2); \ +} while (0) + +#define STAILQ_REVERSE (head, type, field) do { \ + if (STAILQ_EMPTY(head)) \ + break; \ + QUEUE_TYPEOF(type) *_Var, *_Varp, *_Varn; \ + for (_Var = STAILQ_FIRST(head), _Varp = NULL; \ + _Var != NULL;) { \ + _Varn = STAILQ_NEXT(_Var, field); \ + STAILQ_NEXT(_Var, field) = _Varp; \ + _Varp = _Var; \ + _Var = _Varn; \ + } \ + (head)->stqh_last = &STAILQ_NEXT(STAILQ_FIRST(head), field); \ + (head)->stqh_first = _Varp; \ +} while (0) + +#define STAILQ_END (head) NULL + + +/* +* 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. +*/ + +/* +* 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) \ + QMD_ASSERT(LIST_FIRST((head)) == NULL || \ + LIST_FIRST((head))->field.le_prev == \ + &LIST_FIRST((head)), \ + "Bad list head %p first->prev != head", \ + (head)) + +/* +* 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) \ + QMD_ASSERT(LIST_NEXT((elm), field) == NULL || \ + LIST_NEXT((elm), field)->field.le_prev == \ + &((elm)->field.le_next), \ + "Bad link elm %p next->prev != elm", (elm)) + +/* +* 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) \ + QMD_ASSERT(*(elm)->field.le_prev == (elm), \ + "Bad link elm %p prev->next != elm", (elm)) + +#define LIST_ASSERT_EMPTY (head) \ + QMD_ASSERT(LIST_EMPTY((head)), \ + "list %p is not empty", (head)) + +#define LIST_ASSERT_NONEMPTY (head) \ + QMD_ASSERT(!LIST_EMPTY((head)), \ + "list %p is empty", (head)) + +#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_EMPTY_ATOMIC (head) \ + (atomic_load_ptr(&(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_HEAD (head, field) \ + LIST_REMOVE(LIST_FIRST(head), field) + +#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_REPLACE (elm, elm2, 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); \ + LIST_NEXT((elm2), field) = LIST_NEXT((elm), field); \ + if (LIST_NEXT((elm2), field) != NULL) \ + LIST_NEXT((elm2), field)->field.le_prev = \ + &(elm2)->field.le_next; \ + (elm2)->field.le_prev = (elm)->field.le_prev; \ + *(elm2)->field.le_prev = (elm2); \ + TRASHIT(*_Oldnext); \ + TRASHIT(*_Oldprev); \ +} while (0) + +#define LIST_SPLIT_AFTER (head, elm, rest, field) do { \ + LIST_ASSERT_NONEMPTY((head)); \ + if (LIST_NEXT((elm), field) == NULL) \ +/* 'elm' is the last element in 'head'. */ \ +LIST_INIT ((rest)); \ + else { \ +LIST_FIRST ((rest)) =LIST_NEXT ((elm), field); \ +LIST_NEXT ((elm), field)->field.le_prev = \ + &LIST_FIRST ((rest)); \ +LIST_NEXT ((elm), field) =NULL ; \ + } \ +} 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) + +#define LIST_END (head) NULL + +/* +* 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. +*/ + +/* +* 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) \ + QMD_ASSERT(TAILQ_EMPTY(head) || \ + TAILQ_FIRST((head))->field.tqe_prev == \ + &TAILQ_FIRST((head)), \ + "Bad tailq head %p first->prev != head", \ + (head)) + +/* +* 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) \ + QMD_ASSERT(*(head)->tqh_last == NULL, \ + "Bad tailq NEXT(%p->tqh_last) != NULL", \ + (head)) + +/* +* 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) \ + QMD_ASSERT(TAILQ_NEXT((elm), field) == NULL || \ + TAILQ_NEXT((elm), field)->field.tqe_prev == \ + &((elm)->field.tqe_next), \ + "Bad link elm %p next->prev != elm", (elm)) + +/* +* 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) \ + QMD_ASSERT(*(elm)->field.tqe_prev == (elm), \ + "Bad link elm %p prev->next != elm", (elm)) + +#define TAILQ_ASSERT_EMPTY (head) \ + QMD_ASSERT(TAILQ_EMPTY((head)), \ + "tailq %p is not empty", (head)) + +#define TAILQ_ASSERT_NONEMPTY (head) \ + QMD_ASSERT(!TAILQ_EMPTY((head)), \ + "tailq %p is empty", (head)) + +#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_EMPTY_ATOMIC (head) \ + (atomic_load_ptr(&(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 (head, field) \ + TAILQ_REMOVE(head, TAILQ_FIRST(head), field) + +#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_REPLACE (head, elm, elm2, 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); \ + TAILQ_NEXT((elm2), field) = TAILQ_NEXT((elm), field); \ + if (TAILQ_NEXT((elm2), field) != TAILQ_END(head)) \ + TAILQ_NEXT((elm2), field)->field.tqe_prev = \ + &(elm2)->field.tqe_next; \ + else \ + (head)->tqh_last = &(elm2)->field.tqe_next; \ + (elm2)->field.tqe_prev = (elm)->field.tqe_prev; \ + *(elm2)->field.tqe_prev = (elm2); \ + TRASHIT(*_Oldnext); \ + TRASHIT(*_Oldprev); \ + QMD_TRACE_ELEM(&(elm)->field); \ +} while (0) + +#define TAILQ_SPLIT_AFTER (head, elm, rest, field) do { \ + TAILQ_ASSERT_NONEMPTY((head)); \ + QMD_TAILQ_CHECK_TAIL((head), field); \ + if (TAILQ_NEXT((elm), field) == NULL) \ +/* 'elm' is the last element in 'head'. */ \ +TAILQ_INIT ((rest)); \ + else { \ +TAILQ_FIRST ((rest)) =TAILQ_NEXT ((elm), field); \ + (rest)->tqh_last = (head)->tqh_last; \ +TAILQ_NEXT ((elm), field)->field.tqe_prev = \ + &TAILQ_FIRST ((rest)); \ + \ +TAILQ_NEXT ((elm), field) =NULL ; \ + (head)->tqh_last = &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) + +#define TAILQ_END (head) NULL + +#endif /* !_SYS_QUEUE_H_ */
lib/eal/include/meson.build +1 -0
@@ -4,6 +4,7 @@ includes += include_directories('.') headers += files( + 'bsd_queue.h', 'rte_alarm.h', 'rte_bitmap.h', 'rte_bitops.h',
Signature · 1 line
2.47.2
Re: [RFC 01/47] eal: add BSD version of queue.h
Quoted 15 lines · Stephen Hemminger
The version of
sys/queue.hon Linux from glibc was derived from an older version of BSD and is missing several key macros such asLIST_FOREACH_SAFE. This leads to drivers re-implementing the macros (sometimes badly) and other bugs.Introduce a version of
queue.hderived from the current FreeBSD header (only comments changed).Signed-off-by Stephen Hemminger <[email protected]>--- lib/eal/include/bsd_queue.h | 1075 +++++++++++++++++++++++++++++++++++ lib/eal/include/meson.build | 1 + 2 files changed, 1076 insertions(+) create mode 100644 lib/eal/include/bsd_queue.h
<snip>
lib/eal/include/meson.build line 10
Quoted 13 lines
lib/eal/include/meson.build +1
-0@@ -4,6 +4,7 @@ includes += include_directories('.') headers += files( + 'bsd_queue.h', 'rte_alarm.h', 'rte_bitmap.h', 'rte_bitops.h',
While I agree that bsd_queue is a good name for this file, since it's exported by DPDK, I would tend to think that it should still have the rte_prefix on it to avoid any naming conflicts. Therefore, I'd rather it be called "rte_bsd_queue.h".
/Bruce
Re: [RFC 01/47] eal: add BSD version of queue.h
In reply to Stephen Hemminger19/08/2025 01:27, Stephen Hemminger:
Quoted 4 lines
+++
b/lib/eal/include/bsd_queue.hlib/eal/include/bsd_queue.h new file +2
-0@@ -0,0 +1,1075 @@ +/*- +* SPDX-License-Identifier: BSD-3-Clause
lib/eal/include/bsd_queue.h line 12
Quoted 10 lines
lib/eal/include/bsd_queue.h new file +10
-0+* +* Copyright (c) 1991, 1993 +* The Regents of the University of California. All rights reserved. +* +* This is a copy of sys/queue.h which is used to overcome +* missing parts in the glibc version (and Windows). +*/ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_
Shouldn't we rename this include flag? with RTE_ prefix?
Re: [RFC 01/47] eal: add BSD version of queue.h
Quoted 17 lines · On Tue, 19 Aug 2025 10:37:27 +0200 Thomas Monjalon <[email protected]> wrote:
19/08/2025 01:27, Stephen Hemminger:
Quoted 4 lines
+++
b/lib/eal/include/bsd_queue.hlib/eal/include/bsd_queue.h new file +2
-0@@ -0,0 +1,1075 @@ +/*- +* SPDX-License-Identifier: BSD-3-Clause lib/eal/include/bsd_queue.h line 12
Quoted 10 lines
lib/eal/include/bsd_queue.h new file +10
-0+* +* Copyright (c) 1991, 1993 +* The Regents of the University of California. All rights reserved. +* +* This is a copy of sys/queue.h which is used to overcome +* missing parts in the glibc version (and Windows). +*/ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_Shouldn't we rename this include flag? with
RTE_prefix?
No, by keeping the same prefix if the user includes both sys/queue.h and bsd_queue.h there will be no confilcts.
Re: [RFC 01/47] eal: add BSD version of queue.h
19/08/2025 17:24, Stephen Hemminger:
Quoted 22 lines
Quoted 17 lines · On Tue, 19 Aug 2025 10:37:27 +0200 Thomas Monjalon <[email protected]> wrote:
19/08/2025 01:27, Stephen Hemminger:
Quoted 4 lines
+++
b/lib/eal/include/bsd_queue.hlib/eal/include/bsd_queue.h new file +2
-0@@ -0,0 +1,1075 @@ +/*- +* SPDX-License-Identifier: BSD-3-Clause lib/eal/include/bsd_queue.h line 12
Quoted 10 lines
lib/eal/include/bsd_queue.h new file +10
-0+* +* Copyright (c) 1991, 1993 +* The Regents of the University of California. All rights reserved. +* +* This is a copy of sys/queue.h which is used to overcome +* missing parts in the glibc version (and Windows). +*/ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_Shouldn't we rename this include flag? with
RTE_prefix?
Quoted 2 lines
No, by keeping the same prefix if the user includes both
sys/queue.handbsd_queue.hthere will be no confilcts.
You mean by checking _SYS_QUEUE_H_ which is the same as sys/queue.h? So if I include sys/queue.h first, I will have a limited version. It means we should not include it before any DPDK include. It looks like a limitation for DPDK users.
Re: [RFC 01/47] eal: add BSD version of queue.h
Quoted 23 lines · Thomas Monjalon
19/08/2025 17:24, Stephen Hemminger:
Quoted 22 lines
Quoted 17 lines · On Tue, 19 Aug 2025 10:37:27 +0200 Thomas Monjalon <[email protected]> wrote:
19/08/2025 01:27, Stephen Hemminger:
Quoted 4 lines
+++
b/lib/eal/include/bsd_queue.hlib/eal/include/bsd_queue.h new file +2
-0@@ -0,0 +1,1075 @@ +/*- +* SPDX-License-Identifier: BSD-3-Clause lib/eal/include/bsd_queue.h line 12
Quoted 10 lines
lib/eal/include/bsd_queue.h new file +10
-0+* +* Copyright (c) 1991, 1993 +* The Regents of the University of California. All rights reserved. +* +* This is a copy of sys/queue.h which is used to overcome +* missing parts in the glibc version (and Windows). +*/ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_Shouldn't we rename this include flag? with
RTE_prefix?
Quoted 8 lines
Quoted 2 lines
No, by keeping the same prefix if the user includes both
sys/queue.handbsd_queue.hthere will be no confilcts.You mean by checking _SYS_QUEUE_H_ which is the same as
sys/queue.h? So if I includesys/queue.hfirst, I will have a limited version. It means we should not include it before any DPDK include. It looks like a limitation for DPDK users.
I think we should define two defines for our header, and warn if sys/queue.h is included first.
#ifndef _RTE_BSD_QUEUE_H_
#ifdef _SYS_QUEUE_H_
#warning ...
#endif
#define _RTE_BSD_QUEUE_H_
#define _SYS_QUEUE_H_
...
#endif
This way, sys/queue.h contents will be skipped after our header, but if it's included first, the user gets a warning about incomplete implementation.
/Bruce
Re: [RFC 01/47] eal: add BSD version of queue.h
Quoted 45 lines · On Tue, 19 Aug 2025 16:40:28 +0100 Bruce Richardson…
Quoted 23 lines · Thomas Monjalon
19/08/2025 17:24, Stephen Hemminger:
Quoted 22 lines
Quoted 17 lines · On Tue, 19 Aug 2025 10:37:27 +0200 Thomas Monjalon <[email protected]> wrote:
19/08/2025 01:27, Stephen Hemminger:
Quoted 4 lines
+++
b/lib/eal/include/bsd_queue.hlib/eal/include/bsd_queue.h new file +2
-0@@ -0,0 +1,1075 @@ +/*- +* SPDX-License-Identifier: BSD-3-Clause lib/eal/include/bsd_queue.h line 12
Quoted 10 lines
lib/eal/include/bsd_queue.h new file +10
-0+* +* Copyright (c) 1991, 1993 +* The Regents of the University of California. All rights reserved. +* +* This is a copy of sys/queue.h which is used to overcome +* missing parts in the glibc version (and Windows). +*/ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_Shouldn't we rename this include flag? with
RTE_prefix?Quoted 8 lines
Quoted 2 lines
No, by keeping the same prefix if the user includes both
sys/queue.handbsd_queue.hthere will be no confilcts.You mean by checking _SYS_QUEUE_H_ which is the same as
sys/queue.h? So if I includesys/queue.hfirst, I will have a limited version. It means we should not include it before any DPDK include. It looks like a limitation for DPDK users.I think we should define two defines for our header, and warn if
sys/queue.his included first.#ifndef _RTE_BSD_QUEUE_H_
#ifdef _SYS_QUEUE_H_
#warning ...
#endif#define _RTE_BSD_QUEUE_H_
#define _SYS_QUEUE_H_...
Quoted 7 lines
#endif
This way,
sys/queue.hcontents will be skipped after our header, but if it's included first, the user gets a warning about incomplete implementation./Bruce
There is a similar issue with kernel headers already. And it lead to lots if #ifdef __UAPI_DEF_XXX which I want to avoid.
Rather just do wholesale replacement and if application includes the other header, it will work since the BSD stuff is only used as add on.
Re: [RFC 01/47] eal: add BSD version of queue.h
Quoted 54 lines · Stephen Hemminger
Quoted 51 lines · On Tue, 19 Aug 2025 16:40:28 +0100 Bruce Richardson…
Quoted 23 lines · Thomas Monjalon
19/08/2025 17:24, Stephen Hemminger:
Quoted 22 lines
Quoted 17 lines · On Tue, 19 Aug 2025 10:37:27 +0200 Thomas Monjalon <[email protected]> wrote:
19/08/2025 01:27, Stephen Hemminger:
Quoted 4 lines
+++
b/lib/eal/include/bsd_queue.hlib/eal/include/bsd_queue.h new file +2
-0@@ -0,0 +1,1075 @@ +/*- +* SPDX-License-Identifier: BSD-3-Clause lib/eal/include/bsd_queue.h line 12
Quoted 10 lines
lib/eal/include/bsd_queue.h new file +10
-0+* +* Copyright (c) 1991, 1993 +* The Regents of the University of California. All rights reserved. +* +* This is a copy of sys/queue.h which is used to overcome +* missing parts in the glibc version (and Windows). +*/ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_Shouldn't we rename this include flag? with
RTE_prefix?Quoted 8 lines
Quoted 2 lines
No, by keeping the same prefix if the user includes both
sys/queue.handbsd_queue.hthere will be no confilcts.You mean by checking _SYS_QUEUE_H_ which is the same as
sys/queue.h? So if I includesys/queue.hfirst, I will have a limited version. It means we should not include it before any DPDK include. It looks like a limitation for DPDK users.I think we should define two defines for our header, and warn if
sys/queue.his included first.#ifndef _RTE_BSD_QUEUE_H_
#ifdef _SYS_QUEUE_H_
#warning ...
#endif#define _RTE_BSD_QUEUE_H_
#define _SYS_QUEUE_H_...
#endif
This way,
sys/queue.hcontents will be skipped after our header, but if it's included first, the user gets a warning about incomplete implementation.
Quoted 9 lines
Quoted 1 line
/Bruce
There is a similar issue with kernel headers already. And it lead to lots if #ifdef
__UAPI_DEF_XXXwhich I want to avoid.Rather just do wholesale replacement and if application includes the other header, it will work since the BSD stuff is only used as add on.
That level of ifdef checks what my suggestions above is trying to avoid. Just by having our own header define, as well as defining the standing sys/queue.h one, we can avoid having queue.h included after us, and also warn the user if they have already included the incomplete header. [Though for correctness, I suppose the first endif above should be an #else, so avoid dup definitions if that occurs]
/Bruce
Re: [RFC 01/47] eal: add BSD version of queue.h
Quoted 8 lines · On Tue, 19 Aug 2025 17:07:28 +0100 Bruce Richardson…
Quoted 8 lines
Quoted 8 lines
I think we should define two defines for our header, and warn if
sys/queue.his included first.#ifndef _RTE_BSD_QUEUE_H_
#ifdef _SYS_QUEUE_H_
#warning ...
#endif
Quoted 6 lines
Quoted 6 lines
Quoted 6 lines
#define _RTE_BSD_QUEUE_H_
#define _SYS_QUEUE_H_...
#endif
Tried that and won't work right since we want to put header in first patch and not break build of unchanged drivers etc. It will work after the whole patch series when <sys/queue.h> is gone.
Re: [RFC 01/47] eal: add BSD version of queue.h
In reply to Thomas MonjalonQuoted 23 lines · On Tue, 19 Aug 2025 17:29:28 +0200 Thomas Monjalon <[email protected]> wrote:
19/08/2025 17:24, Stephen Hemminger:
Quoted 22 lines
Quoted 17 lines · On Tue, 19 Aug 2025 10:37:27 +0200 Thomas Monjalon <[email protected]> wrote:
19/08/2025 01:27, Stephen Hemminger:
Quoted 4 lines
+++
b/lib/eal/include/bsd_queue.hlib/eal/include/bsd_queue.h new file +2
-0@@ -0,0 +1,1075 @@ +/*- +* SPDX-License-Identifier: BSD-3-Clause lib/eal/include/bsd_queue.h line 12
Quoted 10 lines
lib/eal/include/bsd_queue.h new file +10
-0+* +* Copyright (c) 1991, 1993 +* The Regents of the University of California. All rights reserved. +* +* This is a copy of sys/queue.h which is used to overcome +* missing parts in the glibc version (and Windows). +*/ + +#ifndef _SYS_QUEUE_H_ +#define _SYS_QUEUE_H_Shouldn't we rename this include flag? with
RTE_prefix?
Quoted 7 lines
Quoted 2 lines
No, by keeping the same prefix if the user includes both
sys/queue.handbsd_queue.hthere will be no confilcts.You mean by checking _SYS_QUEUE_H_ which is the same as
sys/queue.h? So if I includesys/queue.hfirst, I will have a limited version. It means we should not include it before any DPDK include. It looks like a limitation for DPDK users.
Yes, but that existed before, no change.
Should be documented in new code though.
RFC 2/47 net/nfp: fix use after free
In reply to Stephen HemmingerThe code to cleanup metering was using the objects after calling rte_free(). Can fix now by using LIST_FOREACH_SAFE().
--- drivers/net/nfp/nfp_mtr.c | 12 ++++++------ 1 file changed, 6 insertions(+), 6 deletions(-)
drivers/net/nfp/nfp_mtr.c +6 -6
@@ -1124,10 +1124,10 @@ nfp_mtr_priv_init(struct nfp_pf_dev *pf_dev)void nfp_mtr_priv_uninit (struct nfp_pf_dev *pf_dev) { -struct nfp_mtr *mtr; +struct nfp_mtr *mtr, *tmp_mtr;struct nfp_mtr_priv *priv; -struct nfp_mtr_policy *mtr_policy; -struct nfp_mtr_profile *mtr_profile; +struct nfp_mtr_policy *mtr_policy, *tmp_policy; +struct nfp_mtr_profile *mtr_profile, *tmp_profile;struct nfp_app_fw_flower *app_fw_flower; app_fw_flower =NFP_PRIV_TO_APP_FW_FLOWER (pf_dev->app_fw_priv);
@@ -1135,17 +1135,17 @@ nfp_mtr_priv_uninit(struct nfp_pf_dev *pf_dev)rte_eal_alarm_cancel (nfp_mtr_stats_request, (void *)app_fw_flower); - LIST_FOREACH(mtr, &priv->mtrs, next) { + LIST_FOREACH_SAFE(mtr, &priv->mtrs, next, tmp_mtr) {LIST_REMOVE (mtr, next);rte_free (mtr); } - LIST_FOREACH(mtr_profile, &priv->profiles, next) { + LIST_FOREACH_SAFE(mtr_profile, &priv->profiles, next, tmp_profile) {LIST_REMOVE (mtr_profile, next);rte_free (mtr_profile); } - LIST_FOREACH(mtr_policy, &priv->policies, next) { + LIST_FOREACH_SAFE(mtr_policy, &priv->policies, next, tmp_policy) {LIST_REMOVE (mtr_policy, next);rte_free (mtr_policy); }
Signature · 1 line
2.47.2
RFC 3/47 eal: use bsd_queue.h
In reply to Stephen HemmingerReplace use of sys/queue.h with bsd_queue.h
--- lib/eal/common/eal_common_bus.c | 2 +- lib/eal/common/eal_common_class.c | 2 +- lib/eal/common/eal_common_dev.c | 2 +- lib/eal/common/eal_common_tailqs.c | 2 +- lib/eal/common/eal_common_trace.c | 2 +- lib/eal/common/eal_private.h | 2 +- lib/eal/common/malloc_elem.c | 2 +- lib/eal/common/malloc_heap.c | 2 +- lib/eal/common/malloc_heap.h | 2 +- lib/eal/common/rte_malloc.c | 2 +- lib/eal/freebsd/eal.c | 2 +- lib/eal/freebsd/eal_interrupts.c | 2 +- lib/eal/freebsd/eal_thread.c | 2 +- lib/eal/freebsd/include/rte_os.h | 6 ++++-- lib/eal/linux/eal_alarm.c | 2 +- lib/eal/linux/eal_interrupts.c | 2 +- lib/eal/linux/include/rte_os.h | 3 ++- lib/eal/windows/eal_alarm.c | 2 +- 18 files changed, 22 insertions(+), 19 deletions(-)
lib/eal/common/eal_common_bus.c +1 -1
@@ -4,8 +4,8 @@#include <stdio.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <bus_driver.h> #include <rte_debug.h> #include <rte_string_fns.h>
lib/eal/common/eal_common_class.c +1 -1
@@ -4,8 +4,8 @@#include <stdio.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_class.h> #include <rte_debug.h>
lib/eal/common/eal_common_dev.c +1 -1
@@ -6,8 +6,8 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <bus_driver.h> #include <rte_class.h> #include <dev_driver.h>
lib/eal/common/eal_common_tailqs.c +1 -1
@@ -2,10 +2,10 @@* Copyright(c) 2010-2014 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <string.h> +#include <bsd_queue.h> #include <rte_eal.h> #include <rte_eal_memconfig.h> #include <rte_log.h>
lib/eal/common/eal_common_trace.c +1 -1
@@ -5,9 +5,9 @@#include <stdlib.h> #include <fnmatch.h> #include <pthread.h> -#include <sys/queue.h> #include <regex.h> +#include <bsd_queue.h> #include <rte_common.h> #include <rte_errno.h> #include <rte_lcore.h>
lib/eal/common/eal_private.h +1 -1
@@ -8,8 +8,8 @@#include <stdbool.h> #include <stdint.h> #include <stdio.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <dev_driver.h> #include <rte_lcore.h> #include <rte_log.h>
lib/eal/common/malloc_elem.c +1 -1
@@ -6,8 +6,8 @@#include <stddef.h> #include <stdio.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_memory.h> #include <rte_eal.h> #include <rte_common.h>
lib/eal/common/malloc_heap.c +1 -1
@@ -6,8 +6,8 @@#include <stdlib.h> #include <stdio.h> #include <errno.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_memory.h> #include <rte_errno.h> #include <rte_eal.h>
lib/eal/common/malloc_heap.h +1 -1
@@ -6,8 +6,8 @@#define MALLOC_HEAP_H_ #include <stdbool.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_malloc.h> #include <rte_spinlock.h>
lib/eal/common/rte_malloc.c +1 -1
@@ -6,8 +6,8 @@#include <stddef.h> #include <stdio.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_errno.h> #include <rte_memcpy.h> #include <rte_memory.h>
lib/eal/freebsd/eal.c +1 -1
@@ -17,9 +17,9 @@#include <errno.h> #include <limits.h> #include <sys/mman.h> -#include <sys/queue.h> #include <sys/stat.h> +#include <bsd_queue.h> #include <rte_common.h> #include <rte_debug.h> #include <rte_memory.h>
lib/eal/freebsd/eal_interrupts.c +1 -1
@@ -5,9 +5,9 @@#include <string.h> #include <sys/types.h> #include <sys/event.h> -#include <sys/queue.h> #include <unistd.h> +#include <bsd_queue.h> #include <eal_export.h> #include <eal_trace_internal.h> #include <rte_errno.h>
lib/eal/freebsd/eal_thread.c +1 -1
@@ -9,9 +9,9 @@#include <unistd.h> #include <sched.h> #include <pthread_np.h> -#include <sys/queue.h> #include <sys/thr.h> +#include <bsd_queue.h> #include <rte_debug.h> #include <rte_atomic.h> #include <rte_launch.h>
lib/eal/freebsd/include/rte_os.h +4 -2
@@ -12,9 +12,11 @@#include <pthread_np.h> #include <stdlib.h> /* Declares alloca() */ -#include <sys/queue.h> -/* These macros are compatible with system's sys/queue.h. */ +/* Alternative to system's sys/queue.h which is missing some macros. */ +#include <bsd_queue.h> + +/* These macros are compatible with bsd_queue.h. */ #define RTE_TAILQ_HEAD (name, type) TAILQ_HEAD(name, type)#define RTE_TAILQ_ENTRY (type) TAILQ_ENTRY(type)#define RTE_TAILQ_FOREACH (var, head, field) TAILQ_FOREACH(var, head, field)
lib/eal/linux/eal_alarm.c +1 -1
@@ -6,10 +6,10 @@#include <stdlib.h> #include <errno.h> #include <pthread.h> -#include <sys/queue.h> #include <sys/time.h> #include <sys/timerfd.h> +#include <bsd_queue.h> #include <eal_export.h> #include <eal_trace_internal.h> #include <rte_interrupts.h>
lib/eal/linux/eal_interrupts.c +1 -1
@@ -5,7 +5,6 @@#include <stdio.h> #include <stdint.h> #include <stdlib.h> -#include <sys/queue.h> #include <unistd.h> #include <string.h> #include <errno.h>
@@ -15,6 +14,7 @@#include <assert.h> #include <stdbool.h> +#include <bsd_queue.h> #include <eal_export.h> #include <eal_trace_internal.h> #include <rte_common.h>
lib/eal/linux/include/rte_os.h +2 -1
@@ -12,7 +12,8 @@#include <alloca.h> #include <sched.h> -#include <sys/queue.h> + +#include <bsd_queue.h> /* These macros are compatible with system's sys/queue.h. */ #define RTE_TAILQ_HEAD (name, type) TAILQ_HEAD(name, type)
lib/eal/windows/eal_alarm.c +1 -1
@@ -4,8 +4,8 @@#include <stdatomic.h> #include <stdbool.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <eal_export.h> #include <rte_alarm.h> #include <rte_spinlock.h>
Signature · 1 line
2.47.2
RFC 4/47 test: remove unnecessary inclusion of sys/queue.h
In reply to Stephen HemmingerThose macros are not directly in most of the test code.
--- app/test/commands.c | 2 +- app/test/test.c | 1 - app/test/test.h | 2 +- app/test/test_atomic.c | 1 - app/test/test_cmdline_lib.c | 1 - app/test/test_func_reentrancy.c | 1 - app/test/test_hash.c | 1 - app/test/test_hash_functions.c | 1 - app/test/test_link_bonding.c | 1 - app/test/test_link_bonding_mode4.c | 1 - app/test/test_link_bonding_rssconf.c | 1 - app/test/test_logs.c | 1 - app/test/test_malloc.c | 1 - app/test/test_mbuf.c | 1 - app/test/test_mcslock.c | 1 - app/test/test_mempool.c | 1 - app/test/test_mempool_perf.c | 1 - app/test/test_memzone.c | 1 - app/test/test_mp_secondary.c | 1 - app/test/test_per_lcore.c | 1 - app/test/test_pflock.c | 1 - app/test/test_ring.c | 1 - app/test/test_rwlock.c | 1 - app/test/test_soring.c | 1 - app/test/test_spinlock.c | 1 - app/test/test_tailq.c | 1 - app/test/test_ticketlock.c | 1 - app/test/test_timer.c | 1 - 28 files changed, 2 insertions(+), 28 deletions(-)
app/test/commands.c +1 -1
@@ -10,8 +10,8 @@#include <stdlib.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_common.h> #include <rte_log.h> #include <rte_debug.h>
app/test/test.c +0 -1
@@ -9,7 +9,6 @@#include <stdlib.h> #include <errno.h> #include <ctype.h> -#include <sys/queue.h> #include <cmdline_rdline.h> #include <cmdline_parse.h>
app/test/test.h +1 -1
@@ -8,8 +8,8 @@#include <errno.h> #include <stddef.h> #include <stdlib.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_hexdump.h> #include <rte_common.h> #include <rte_os_shim.h>
app/test/test_atomic.c +0 -1
@@ -7,7 +7,6 @@#include <stdint.h> #include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <rte_memory.h> #include <rte_per_lcore.h>
app/test/test_cmdline_lib.c +0 -1
@@ -9,7 +9,6 @@#include <stdlib.h> #include <errno.h> #include <ctype.h> -#include <sys/queue.h> #include <rte_common.h>
app/test/test_func_reentrancy.c +0 -1
@@ -9,7 +9,6 @@#include <inttypes.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_log.h>
app/test/test_hash.c +0 -1
@@ -8,7 +8,6 @@#include <stdlib.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_malloc.h>
app/test/test_hash_functions.c +0 -1
@@ -8,7 +8,6 @@#include <stdlib.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <rte_cycles.h> #include <rte_random.h>
app/test/test_link_bonding.c +0 -1
@@ -11,7 +11,6 @@#include <inttypes.h> #include <errno.h> #include <pthread.h> -#include <sys/queue.h> #include <sys/time.h> #include <rte_cycles.h>
app/test/test_link_bonding_mode4.c +0 -1
@@ -10,7 +10,6 @@#include <inttypes.h> #include <errno.h> #include <rte_cycles.h> -#include <sys/queue.h> #include <rte_byteorder.h> #include <rte_common.h>
app/test/test_link_bonding_rssconf.c +0 -1
@@ -10,7 +10,6 @@#include <inttypes.h> #include <errno.h> #include <rte_cycles.h> -#include <sys/queue.h> #include <rte_byteorder.h> #include <rte_common.h>
app/test/test_logs.c +0 -1
@@ -5,7 +5,6 @@#include <stdio.h> #include <stdint.h> #include <stdarg.h> -#include <sys/queue.h> #include <rte_log.h> #include <rte_memory.h>
app/test/test_malloc.c +0 -1
@@ -13,7 +13,6 @@#ifndef RTE_EXEC_ENV_WINDOWS #include <sys/mman.h> #endif -#include <sys/queue.h> #include <unistd.h> #include <rte_common.h>
app/test/test_mbuf.c +0 -1
@@ -12,7 +12,6 @@#include <stdint.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_errno.h>
app/test/test_mcslock.c +0 -1
@@ -7,7 +7,6 @@#include <inttypes.h> #include <string.h> #include <unistd.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_memory.h>
app/test/test_mempool.c +0 -1
@@ -9,7 +9,6 @@#include <inttypes.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_eal_paging.h>
app/test/test_mempool_perf.c +0 -1
@@ -10,7 +10,6 @@#include <inttypes.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_log.h>
app/test/test_memzone.c +0 -1
@@ -6,7 +6,6 @@#include <stdint.h> #include <string.h> #include <inttypes.h> -#include <sys/queue.h> #include <rte_random.h> #include <rte_cycles.h>
app/test/test_mp_secondary.c +0 -1
@@ -10,7 +10,6 @@#include <stdlib.h> #include <stdarg.h> #include <inttypes.h> -#include <sys/queue.h> #include <errno.h> #include <string.h> #include <unistd.h>
app/test/test_per_lcore.c +0 -1
@@ -4,7 +4,6 @@#include <stdio.h> #include <stdint.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_memory.h>
app/test/test_pflock.c +0 -1
@@ -6,7 +6,6 @@#include <stdint.h> #include <inttypes.h> #include <unistd.h> -#include <sys/queue.h> #include <string.h> #include <rte_common.h>
app/test/test_ring.c +0 -1
@@ -10,7 +10,6 @@#include <stdint.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_log.h>
app/test/test_rwlock.c +0 -1
@@ -6,7 +6,6 @@#include <stdint.h> #include <inttypes.h> #include <unistd.h> -#include <sys/queue.h> #include <string.h> #include <rte_common.h>
app/test/test_soring.c +0 -1
@@ -9,7 +9,6 @@#include <stdint.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_log.h>
app/test/test_spinlock.c +0 -1
@@ -7,7 +7,6 @@#include <inttypes.h> #include <string.h> #include <unistd.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_memory.h>
app/test/test_tailq.c +0 -1
@@ -7,7 +7,6 @@#include <stdarg.h> #include <string.h> #include <errno.h> -#include <sys/queue.h> #include <rte_eal.h> #include <rte_string_fns.h>
app/test/test_ticketlock.c +0 -1
@@ -6,7 +6,6 @@#include <stdint.h> #include <stdio.h> #include <string.h> -#include <sys/queue.h> #include <unistd.h> #include <rte_common.h>
app/test/test_timer.c +0 -1
@@ -91,7 +91,6 @@#include <stdlib.h> #include <stdint.h> #include <inttypes.h> -#include <sys/queue.h> #include <math.h> #include <rte_common.h>
Signature · 1 line
2.47.2
RFC 5/47 testpmd: use bsd_queue.h
In reply to Stephen HemmingerOnly include the definition of LIST, TAILQ, etc where needed.
--- app/test-pmd/5tswap.c | 2 -- app/test-pmd/cmdline.c | 2 +- app/test-pmd/config.c | 2 +- app/test-pmd/csumonly.c | 1 - app/test-pmd/flowgen.c | 1 - app/test-pmd/hairpin.c | 1 - app/test-pmd/icmpecho.c | 1 - app/test-pmd/iofwd.c | 1 - app/test-pmd/macfwd.c | 1 - app/test-pmd/macswap.c | 1 - app/test-pmd/noisy_vnf.c | 1 - app/test-pmd/parameters.c | 1 - app/test-pmd/rxonly.c | 1 - app/test-pmd/testpmd.c | 1 - app/test-pmd/testpmd.h | 2 +- app/test-pmd/txonly.c | 1 - 16 files changed, 3 insertions(+), 17 deletions(-)
app/test-pmd/5tswap.c +0 -2
@@ -7,8 +7,6 @@#include <stdint.h> #include <unistd.h> #include <inttypes.h> - -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/cmdline.c +1 -1
@@ -13,8 +13,8 @@#include <string.h> #include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_common.h> #include <rte_byteorder.h> #include <rte_log.h>
app/test-pmd/config.c +1 -1
@@ -13,7 +13,7 @@#include <stdint.h> #include <inttypes.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h>
app/test-pmd/csumonly.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/flowgen.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/hairpin.c +0 -1
@@ -8,7 +8,6 @@#include <stdbool.h> #include <stdint.h> -#include <sys/queue.h> #include "testpmd.h"
app/test-pmd/icmpecho.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/iofwd.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/macfwd.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/macswap.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/noisy_vnf.c +0 -1
@@ -12,7 +12,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/parameters.c +0 -1
@@ -13,7 +13,6 @@#include <fcntl.h> #include <sys/types.h> -#include <sys/queue.h> #include <sys/stat.h> #include <stdint.h>
app/test-pmd/rxonly.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/testpmd.c +0 -1
@@ -16,7 +16,6 @@#include <errno.h> #include <stdbool.h> -#include <sys/queue.h> #include <sys/stat.h> #include <stdint.h>
app/test-pmd/testpmd.h +1 -1
@@ -21,7 +21,7 @@#include <cmdline.h> #include <cmdline_parse.h> -#include <sys/queue.h> +#include <bsd_queue.h> #ifdef RTE_HAS_JANSSON #include <jansson.h> #endif
app/test-pmd/txonly.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
Signature · 1 line
2.47.2
RFC 6/47 dumpcap: use bsd_queue.h
In reply to Stephen HemmingerUse DPDK not system version.
Not really a requirement but better to avoid any possible conflict.
--- app/dumpcap/main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
app/dumpcap/main.c +1 -1
@@ -17,12 +17,12 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/queue.h> #include <sys/types.h> #include <sys/utsname.h> #include <time.h> #include <unistd.h> +#include <bsd_queue.h> #include <rte_alarm.h> #include <rte_bitops.h> #include <rte_bpf.h>
Signature · 1 line
2.47.2
RFC 7/47 proc-info: remove unnecessary sys/queue.h
In reply to Stephen HemmingerNot used directly here.
--- app/proc-info/main.c | 1 - 1 file changed, 1 deletion(-)
app/proc-info/main.c +0 -1
@@ -9,7 +9,6 @@#include <errno.h> #include <stdarg.h> #include <inttypes.h> -#include <sys/queue.h> #include <stdlib.h> #include <getopt.h> #include <unistd.h>
Signature · 1 line
2.47.2
RFC 8/47 doc: suggest bsd_queue.h
In reply to Stephen HemmingerDon't suggest use of sys/queue.h
--- doc/guides/contributing/coding_style.rst | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-)
doc/guides/contributing/coding_style.rst +2 -2
@@ -324,12 +324,12 @@ Structure Declarations Queues ~~~~~~ -Use queue(3) macros rather than rolling your own lists, whenever possible. +Use queue(3) macros defined in <bsd_queue.h> rather than rolling your own lists. Thus, the previous example would be better written: .. code-block:: c - #include <sys/queue.h> + #include <bsd_queue.h> struct foo { LIST_ENTRY(foo) link; /* Use queue macros for foo lists. */
Signature · 1 line
2.47.2
RFC 9/47 test-pipeline: remove unnecessary use of sys/queue.h
In reply to Stephen HemmingerNot used directly here
--- app/test-pipeline/config.c | 1 - app/test-pipeline/init.c | 1 - app/test-pipeline/main.c | 1 - app/test-pipeline/runtime.c | 1 - 4 files changed, 4 deletions(-)
app/test-pipeline/config.c +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
app/test-pipeline/init.c +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
app/test-pipeline/main.c +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> #include <stdarg.h> #include <signal.h> #include <errno.h>
app/test-pipeline/runtime.c +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
Signature · 1 line
2.47.2
RFC 10/47 test-eventdev: use bsd_queue.h
In reply to Stephen HemmingerUse the replacement bsd_queue.h header instead
--- app/test-eventdev/evt_test.c | 2 +- app/test-eventdev/evt_test.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
app/test-eventdev/evt_test.c +1 -1
@@ -4,8 +4,8 @@#include <stdio.h> #include <unistd.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include "evt_test.h" static STAILQ_HEAD(, evt_test_entry) head = STAILQ_HEAD_INITIALIZER(head);
app/test-eventdev/evt_test.h +0 -1
@@ -7,7 +7,6 @@#include <string.h> #include <stdbool.h> -#include <sys/queue.h> #include <rte_eal.h>
Signature · 1 line
2.47.2
RFC 11/47 test-bbdev, test-cmdline, test-mldev: don't use sys/queue.h
In reply to Stephen HemmingerNo need for direct inclusion here.
--- app/test-bbdev/main.h | 1 - app/test-cmdline/cmdline_test.c | 1 - app/test-mldev/ml_test.h | 1 - 3 files changed, 3 deletions(-)
app/test-bbdev/main.h +0 -1
@@ -6,7 +6,6 @@#define _MAIN_H_#include <stddef.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_hexdump.h>
app/test-cmdline/cmdline_test.c +0 -1
@@ -10,7 +10,6 @@#include <errno.h> #include <termios.h> #include <ctype.h> -#include <sys/queue.h> #include <rte_common.h>
app/test-mldev/ml_test.h +0 -1
@@ -8,7 +8,6 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/queue.h> #include <rte_common.h>
Signature · 1 line
2.47.2
RFC 12/47 examples: replace use of sys/queue.h
In reply to Stephen HemmingerWhere macros are actually used directly include bsd_queue.h. Most places were just copying some other file and doing unnecessary include of sys/queue.h
--- examples/bbdev_app/main.c | 2 +- examples/bond/main.c | 2 +- examples/cmdline/main.c | 1 - examples/cmdline/parse_obj_list.h | 2 +- examples/flow_filtering/main.c | 1 - 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 | 1 - examples/l2fwd-keepalive/ka-agent/main.c | 1 - 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 | 1 - examples/l3fwd/l3fwd_lpm.c | 1 - examples/l3fwd/main.c | 2 +- examples/link_status_interrupt/main.c | 2 +- examples/multi_process/client_server_mp/mp_client/client.c | 1 - examples/multi_process/client_server_mp/mp_server/init.c | 1 - examples/multi_process/client_server_mp/mp_server/main.c | 2 +- examples/multi_process/hotplug_mp/main.c | 1 - examples/multi_process/simple_mp/main.c | 2 +- examples/multi_process/symmetric_mp/main.c | 2 +- examples/server_node_efd/efd_node/node.c | 1 - examples/server_node_efd/efd_server/init.c | 1 - examples/server_node_efd/efd_server/main.c | 1 - examples/service_cores/main.c | 1 - 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 +- 47 files changed, 34 insertions(+), 47 deletions(-)
examples/bbdev_app/main.c +1 -1
@@ -10,7 +10,7 @@#include <inttypes.h> #include <sys/types.h> #include <unistd.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdarg.h> #include <ctype.h> #include <errno.h>
examples/bond/main.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <sys/socket.h> #include <stdlib.h> #include <string.h>
examples/cmdline/main.c +0 -1
@@ -8,7 +8,6 @@#include <string.h> #include <stdint.h> #include <errno.h> -#include <sys/queue.h> #include <cmdline_rdline.h> #include <cmdline_parse.h>
examples/cmdline/parse_obj_list.h +1 -1
@@ -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 <bsd_queue.h> #include <cmdline_parse.h> #include <cmdline_parse_string.h>
examples/flow_filtering/main.c +0 -1
@@ -8,7 +8,6 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> #include <setjmp.h> #include <stdarg.h> #include <ctype.h>
examples/helloworld/main.c +1 -1
@@ -6,7 +6,7 @@#include <string.h> #include <stdint.h> #include <errno.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_memory.h> #include <rte_launch.h>
examples/ip_fragmentation/main.c +1 -1
@@ -9,7 +9,7 @@#include <sys/types.h> #include <sys/param.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/ip_pipeline/action.h +1 -1
@@ -5,7 +5,7 @@#ifndef _INCLUDE_ACTION_H_#define _INCLUDE_ACTION_H_ -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_port_in_action.h> #include <rte_table_action.h>
examples/ip_pipeline/cryptodev.h +1 -1
@@ -6,7 +6,7 @@#define _INCLUDE_SYM_C_H_#include <stdint.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_cryptodev.h>
examples/ip_pipeline/link.h +1 -1
@@ -6,7 +6,7 @@#define _INCLUDE_LINK_H_#include <stdint.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include "common.h"
examples/ip_pipeline/mempool.h +1 -1
@@ -6,7 +6,7 @@#define _INCLUDE_MEMPOOL_H_#include <stdint.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_mempool.h>
examples/ip_pipeline/pipeline.h +1 -1
@@ -6,7 +6,7 @@#define _INCLUDE_PIPELINE_H_#include <stdint.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_pipeline.h> #include <rte_table_action.h>
examples/ip_pipeline/swq.h +1 -1
@@ -6,7 +6,7 @@#define _INCLUDE_SWQ_H_#include <stdint.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_ring.h>
examples/ip_pipeline/tap.h +1 -1
@@ -5,7 +5,7 @@#ifndef _INCLUDE_TAP_H_#define _INCLUDE_TAP_H_ -#include <sys/queue.h> +#include <bsd_queue.h> #include "common.h"
examples/ip_pipeline/tmgr.h +1 -1
@@ -6,7 +6,7 @@#define _INCLUDE_TMGR_H_#include <stdint.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_sched.h> #include <rte_red.h>
examples/ip_reassembly/main.c +1 -1
@@ -8,7 +8,7 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/ipsec-secgw/ipsec-secgw.c +1 -1
@@ -12,7 +12,7 @@#include <netinet/ip.h> #include <netinet/ip6.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdarg.h> #include <errno.h> #include <signal.h>
examples/ipv4_multicast/main.c +1 -1
@@ -8,7 +8,7 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/l2fwd-crypto/main.c +1 -1
@@ -9,7 +9,7 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <netinet/in.h> #include <setjmp.h> #include <stdarg.h>
examples/l2fwd-event/l2fwd_common.h +0 -1
@@ -11,7 +11,6 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> #include <netinet/in.h> #include <setjmp.h> #include <stdarg.h>
examples/l2fwd-keepalive/ka-agent/main.c +0 -1
@@ -9,7 +9,6 @@#include <unistd.h> #include <fcntl.h> #include <sys/wait.h> -#include <sys/queue.h> #include <sys/mman.h> #include <sys/stat.h> #include <time.h>
examples/l2fwd-keepalive/main.c +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <netinet/in.h> #include <setjmp.h> #include <stdarg.h>
examples/l2fwd-macsec/main.c +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <setjmp.h> #include <stdarg.h> #include <ctype.h>
examples/l2fwd/main.c +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <setjmp.h> #include <stdarg.h> #include <ctype.h>
examples/l3fwd-graph/main.c +1 -1
@@ -15,7 +15,7 @@#include <string.h> #include <sys/socket.h> #include <sys/types.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <unistd.h> #include <rte_branch_prediction.h>
examples/l3fwd-power/main.c +1 -1
@@ -8,7 +8,7 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/l3fwd/l3fwd_em.c +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/l3fwd/l3fwd_lpm.c +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/l3fwd/main.c +1 -1
@@ -8,7 +8,7 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/link_status_interrupt/main.c +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <setjmp.h> #include <stdarg.h> #include <ctype.h>
examples/multi_process/client_server_mp/mp_client/client.c +0 -1
@@ -7,7 +7,6 @@#include <inttypes.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <stdlib.h> #include <getopt.h> #include <string.h>
examples/multi_process/client_server_mp/mp_server/init.c +0 -1
@@ -6,7 +6,6 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/queue.h> #include <errno.h> #include <stdarg.h> #include <inttypes.h>
examples/multi_process/client_server_mp/mp_server/main.c +1 -1
@@ -9,7 +9,7 @@#include <stdint.h> #include <stdarg.h> #include <inttypes.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <errno.h> #include <signal.h>
examples/multi_process/hotplug_mp/main.c +0 -1
@@ -7,7 +7,6 @@#include <stdint.h> #include <errno.h> #include <termios.h> -#include <sys/queue.h> #include <cmdline_rdline.h> #include <cmdline_parse.h>
examples/multi_process/simple_mp/main.c +1 -1
@@ -22,7 +22,7 @@#include <errno.h> #include <unistd.h> #include <termios.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_common.h> #include <rte_memory.h>
examples/multi_process/symmetric_mp/main.c +1 -1
@@ -19,7 +19,7 @@#include <stdlib.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <getopt.h> #include <signal.h> #include <inttypes.h>
examples/server_node_efd/efd_node/node.c +0 -1
@@ -7,7 +7,6 @@#include <inttypes.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <stdlib.h> #include <getopt.h> #include <string.h>
examples/server_node_efd/efd_server/init.c +0 -1
@@ -6,7 +6,6 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/queue.h> #include <errno.h> #include <stdarg.h> #include <inttypes.h>
examples/server_node_efd/efd_server/main.c +0 -1
@@ -9,7 +9,6 @@#include <stdint.h> #include <stdarg.h> #include <inttypes.h> -#include <sys/queue.h> #include <errno.h> #include <sys/types.h> #include <netinet/in.h>
examples/service_cores/main.c +0 -1
@@ -7,7 +7,6 @@#include <string.h> #include <stdint.h> #include <errno.h> -#include <sys/queue.h> #include <rte_memory.h> #include <rte_launch.h>
examples/timer/main.c +1 -1
@@ -6,7 +6,7 @@#include <string.h> #include <stdint.h> #include <errno.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_common.h> #include <rte_memory.h>
examples/vhost/main.h +1 -1
@@ -5,7 +5,7 @@#ifndef _MAIN_H_#define _MAIN_H_ -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_ether.h> #include <rte_pci.h>
examples/vm_power_manager/channel_manager.c +1 -1
@@ -10,7 +10,7 @@#include <dirent.h> #include <errno.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/socket.h>
examples/vm_power_manager/channel_monitor.c +1 -1
@@ -13,7 +13,7 @@#include <fcntl.h> #include <sys/types.h> #include <sys/epoll.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <sys/time.h> #include <sys/socket.h> #include <sys/select.h>
examples/vm_power_manager/main.c +1 -1
@@ -12,7 +12,7 @@#include <signal.h> #include <errno.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_common.h> #include <rte_eal.h>
examples/vmdq/main.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdlib.h> #include <string.h> #include <stdio.h>
examples/vmdq_dcb/main.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdlib.h> #include <string.h> #include <stdio.h>
Signature · 1 line
2.47.2
RFC 13/47 hash: do not include sys/queue.h
In reply to Stephen HemmingerThe necessary TAILQ macros are in rte_tailq.h
--- lib/hash/rte_cuckoo_hash.c | 1 - lib/hash/rte_fbk_hash.c | 1 - lib/hash/rte_thash.c | 1 - 3 files changed, 3 deletions(-)
lib/hash/rte_cuckoo_hash.c +0 -1
@@ -7,7 +7,6 @@#include <stdint.h> #include <errno.h> #include <stdio.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_common.h>
lib/hash/rte_fbk_hash.c +0 -1
@@ -6,7 +6,6 @@#include <stdio.h> #include <string.h> #include <errno.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_cpuflags.h>
lib/hash/rte_thash.c +0 -1
@@ -3,7 +3,6 @@*/ #include <stdalign.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_thash.h>
Signature · 1 line
2.47.2
RFC 14/47 lpm: do not include sys/queue.h
In reply to Stephen HemmingerThe necessary macros are in rte_tailq.h
--- lib/lpm/rte_lpm.c | 1 - lib/lpm/rte_lpm6.c | 1 - 2 files changed, 2 deletions(-)
lib/lpm/rte_lpm.c +0 -1
@@ -7,7 +7,6 @@#include <stdint.h> #include <errno.h> #include <stdio.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_log.h>
lib/lpm/rte_lpm6.c +0 -1
@@ -6,7 +6,6 @@#include <stdint.h> #include <errno.h> #include <stdio.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_log.h>
Signature · 1 line
2.47.2
RFC 15/47 log: replace use of sys/queue.h
In reply to Stephen HemmingerUse bsd_queue.h instead.
--- lib/log/log.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
lib/log/log.c +1 -1
@@ -11,9 +11,9 @@#include <errno.h> #include <regex.h> #include <fnmatch.h> -#include <sys/queue.h> #include <unistd.h> +#include <bsd_queue.h> #include <eal_export.h> #include <rte_common.h> #include <rte_log.h>
Signature · 1 line
2.47.2
RFC 16/47 ethdev: replace use of sys/queue.h
In reply to Stephen HemmingerUse bsd_queue.h
--- lib/ethdev/ethdev_private.h | 3 +-- lib/ethdev/rte_ethdev.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
lib/ethdev/ethdev_private.h +1 -2
@@ -5,8 +5,7 @@#ifndef _ETH_PRIVATE_H_#define _ETH_PRIVATE_H_ -#include <sys/queue.h> - +#include <bsd_queue.h> #include <rte_eal_memconfig.h> #include <rte_malloc.h> #include <rte_os_shim.h>
lib/ethdev/rte_ethdev.c +1 -1
@@ -9,8 +9,8 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <bus_driver.h> #include <eal_export.h> #include <rte_log.h>
Signature · 1 line
2.47.2
RFC 17/47 bpf: replace use of sys/queue.h
In reply to Stephen HemmingerUse new bsd_queue.h instead.
--- lib/bpf/bpf_load_elf.c | 1 - lib/bpf/bpf_pkt.c | 3 +-- 2 files changed, 1 insertion(+), 3 deletions(-)
lib/bpf/bpf_load_elf.c +0 -1
@@ -12,7 +12,6 @@#include <sys/types.h> #include <sys/stat.h> -#include <sys/queue.h> #include <fcntl.h> #include <libelf.h>
lib/bpf/bpf_pkt.c +1 -2
@@ -7,8 +7,7 @@#include <errno.h> #include <stdint.h> -#include <sys/queue.h> - +#include <bsd_queue.h> #include <eal_export.h> #include <rte_common.h> #include <rte_malloc.h>
Signature · 1 line
2.47.2
RFC 18/47 mempool: do not need sys/queue.h
In reply to Stephen HemmingerThe necessary tailq macros are in rte_tailq.h
--- lib/mempool/rte_mempool.c | 1 - 1 file changed, 1 deletion(-)
lib/mempool/rte_mempool.c +0 -1
@@ -12,7 +12,6 @@#include <unistd.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_common.h>
Signature · 1 line
2.47.2
RFC 19/47 lib: remove use of sys/queue.h
In reply to Stephen HemmingerUse the new bsd_queue.h where needed but most files already get the needed macros from rte_tailq.h
--- lib/acl/rte_acl_osdep.h | 1 - lib/bbdev/rte_bbdev.c | 2 +- lib/cryptodev/cryptodev_pmd.c | 1 - lib/cryptodev/rte_cryptodev.c | 1 - lib/distributor/rte_distributor.c | 2 +- lib/distributor/rte_distributor_single.c | 2 +- lib/efd/rte_efd.c | 1 - lib/fib/rte_fib.c | 1 - lib/fib/rte_fib6.c | 1 - lib/gpudev/gpudev_driver.h | 1 - lib/graph/graph_private.h | 1 - lib/ip_frag/ip_frag_common.h | 3 +-- lib/mbuf/rte_mbuf_dyn.c | 1 - lib/pipeline/rte_swx_ctl.c | 1 - lib/pipeline/rte_swx_pipeline_internal.h | 3 ++- lib/pmu/pmu.c | 1 - lib/reorder/rte_reorder.c | 1 - lib/rib/rte_rib.c | 1 - lib/rib/rte_rib6.c | 1 - lib/ring/rte_ring.c | 1 - lib/stack/rte_stack.c | 1 - lib/vhost/fd_man.h | 1 - lib/vhost/socket.c | 2 +- lib/vhost/vdpa.c | 2 -- lib/vhost/vhost.h | 2 +- 25 files changed, 8 insertions(+), 27 deletions(-)
lib/acl/rte_acl_osdep.h +0 -1
@@ -21,7 +21,6 @@#include <stdio.h> #include <stdarg.h> #include <stdlib.h> -#include <sys/queue.h> /* * Common defines.
lib/bbdev/rte_bbdev.c +1 -1
@@ -5,8 +5,8 @@#include <stdint.h> #include <string.h> #include <stdbool.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <eal_export.h> #include <rte_common.h> #include <rte_errno.h>
lib/cryptodev/cryptodev_pmd.c +0 -1
@@ -3,7 +3,6 @@*/ #include <stdlib.h> -#include <sys/queue.h> #include <dev_driver.h> #include <eal_export.h>
lib/cryptodev/rte_cryptodev.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2015-2020 Intel Corporation */ -#include <sys/queue.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h>
lib/distributor/rte_distributor.c +1 -1
@@ -5,8 +5,8 @@#include <stdalign.h> #include <stdio.h> #include <stdlib.h> -#include <sys/queue.h> #include <string.h> +#include <eal_export.h> #include <rte_mbuf.h> #include <rte_cycles.h>
lib/distributor/rte_distributor_single.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdio.h> -#include <sys/queue.h> +#include <rte_mbuf.h> #include <rte_memzone.h> #include <rte_errno.h>
lib/efd/rte_efd.c +0 -1
@@ -7,7 +7,6 @@#include <stdlib.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_cpuflags.h>
lib/fib/rte_fib.c +0 -1
@@ -5,7 +5,6 @@#include <stdint.h> #include <string.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_eal_memconfig.h>
lib/fib/rte_fib6.c +0 -1
@@ -5,7 +5,6 @@#include <stdint.h> #include <string.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_eal_memconfig.h>
lib/gpudev/gpudev_driver.h +0 -1
@@ -12,7 +12,6 @@#define RTE_GPUDEV_DRIVER_H #include <stdint.h> -#include <sys/queue.h> #include <dev_driver.h>
lib/graph/graph_private.h +0 -1
@@ -6,7 +6,6 @@#define _RTE_GRAPH_PRIVATE_H_#include <inttypes.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_eal.h>
lib/ip_frag/ip_frag_common.h +1 -2
@@ -5,8 +5,7 @@#ifndef _IP_FRAG_COMMON_H_#define _IP_FRAG_COMMON_H_ -#include <sys/queue.h> - +#include <bsd_queue.h> #include <rte_common.h> #if defined(RTE_ARCH_ARM64 )
lib/mbuf/rte_mbuf_dyn.c +0 -1
@@ -3,7 +3,6 @@*/ #include <stdalign.h> -#include <sys/queue.h> #include <stdint.h> #include <limits.h>
lib/pipeline/rte_swx_ctl.c +0 -1
@@ -5,7 +5,6 @@#include <stdlib.h> #include <string.h> #include <stdio.h> -#include <sys/queue.h> #include <unistd.h> #include <eal_export.h>
lib/pipeline/rte_swx_pipeline_internal.h +2 -1
@@ -6,7 +6,7 @@#include <inttypes.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bitops.h> #include <rte_byteorder.h>
@@ -14,6 +14,7 @@#include <rte_cycles.h> #include <rte_prefetch.h> #include <rte_meter.h> +#include <rte_tailq.h> #include <rte_swx_table_selector.h> #include <rte_swx_table_learner.h>
lib/pmu/pmu.c +0 -1
@@ -8,7 +8,6 @@#include <stdlib.h> #include <unistd.h> #include <sys/mman.h> -#include <sys/queue.h> #include <sys/ioctl.h> #include <sys/syscall.h>
lib/reorder/rte_reorder.c +0 -1
@@ -4,7 +4,6 @@#include <stdalign.h> #include <string.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_string_fns.h>
lib/rib/rte_rib.c +0 -1
@@ -5,7 +5,6 @@#include <stdbool.h> #include <stdint.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_eal_memconfig.h>
lib/rib/rte_rib6.c +0 -1
@@ -5,7 +5,6 @@#include <stdbool.h> #include <stdint.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_eal_memconfig.h>
lib/ring/rte_ring.c +0 -1
@@ -13,7 +13,6 @@#include <stdint.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_common.h>
lib/stack/rte_stack.c +0 -1
@@ -4,7 +4,6 @@#include <stdalign.h> #include <string.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_string_fns.h>
lib/vhost/fd_man.h +0 -1
@@ -6,7 +6,6 @@#define _FD_MAN_H_#include <pthread.h> #include <poll.h> -#include <sys/queue.h> struct fdset ;
lib/vhost/socket.c +1 -1
@@ -10,13 +10,13 @@#include <string.h> #include <sys/socket.h> #include <sys/un.h> -#include <sys/queue.h> #include <errno.h> #include <fcntl.h> #include <eal_export.h> #include <rte_thread.h> #include <rte_log.h> +#include <rte_tailq.h> #include "fd_man.h" #include "vduse.h"
lib/vhost/vdpa.c +0 -2
@@ -8,8 +8,6 @@* Device specific vhost lib */ -#include <sys/queue.h> -#include <dev_driver.h> #include <eal_export.h> #include <rte_class.h>
lib/vhost/vhost.h +1 -1
@@ -8,7 +8,6 @@#include <stdio.h> #include <stdbool.h> #include <stdlib.h> -#include <sys/queue.h> #include <unistd.h> #include <linux/virtio_net.h> #include <sys/socket.h>
@@ -19,6 +18,7 @@#include <rte_ether.h> #include <rte_malloc.h> #include <rte_dmadev.h> +#include <rte_tailq.h> #include "rte_vhost.h" #include "vdpa_driver.h"
Signature · 1 line
2.47.2
RFC 20/47 bus/fslmc: use rte_tailq.h
In reply to Stephen HemmingerUse macros from rte_tailq.h instead using sys/queue.h directly.
--- drivers/bus/fslmc/bus_fslmc_driver.h | 1 - drivers/bus/fslmc/fslmc_vfio.c | 1 + drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 11 ++--------- 3 files changed, 3 insertions(+), 10 deletions(-)
drivers/bus/fslmc/bus_fslmc_driver.h +0 -1
@@ -17,7 +17,6 @@#include <stdlib.h> #include <limits.h> #include <errno.h> -#include <sys/queue.h> #include <stdint.h> #include <inttypes.h> #include <linux/vfio.h>
drivers/bus/fslmc/fslmc_vfio.c +1 -0
@@ -21,6 +21,7 @@#include <sys/eventfd.h> #include <ctype.h> +#include <bsd_queue.h> #include <eal_export.h> #include <eal_filesystem.h> #include <rte_mbuf.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +2 -9
@@ -15,7 +15,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>
@@ -32,6 +31,7 @@#include <rte_cycles.h> #include <rte_kvargs.h> #include <dev_driver.h> +#include <rte_tailq.h> #include <fslmc_logs.h> #include <bus_fslmc_driver.h>
@@ -39,13 +39,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_LCORERTE_EXPORT_INTERNAL_SYMBOL (dpaa2_io_portal)
@@ -105,7 +98,7 @@ static struct dpaa2_dpio_dev *get_dpio_dev_from_id(int32_t dpio_id)struct dpaa2_dpio_dev *dpio_dev =NULL ;/* Get DPIO dev handle from list using index */ - TAILQ_FOREACH(dpio_dev, &dpio_dev_list, next) { + RTE_TAILQ_FOREACH(dpio_dev, &dpio_dev_list, next) {if (dpio_dev->hw_id == dpio_id)break ; }
Signature · 1 line
2.47.2
RFC 21/47 drivers/bus: replace use of sys/queue.h
In reply to Stephen HemmingerPrefer just using rte_tailq.h when TAILQ macro's are used. Other places eliminate sys/queue.h if possible.
--- drivers/bus/auxiliary/auxiliary_common.c | 2 +- drivers/bus/auxiliary/private.h | 2 +- drivers/bus/ifpga/ifpga_bus.c | 2 +- drivers/bus/pci/bsd/pci.c | 2 +- drivers/bus/pci/pci_common.c | 1 - drivers/bus/pci/pci_params.c | 2 -- drivers/bus/pci/windows/pci.c | 3 +-- drivers/bus/pci/windows/pci_netuio.c | 2 -- drivers/bus/platform/platform.c | 2 +- drivers/bus/vdev/vdev.c | 1 - drivers/bus/vmbus/vmbus_common.c | 1 - 11 files changed, 6 insertions(+), 14 deletions(-)
drivers/bus/auxiliary/auxiliary_common.c +1 -1
@@ -8,7 +8,7 @@#include <stdbool.h> #include <stdlib.h> #include <stdio.h> -#include <sys/queue.h> +#include <eal_export.h> #include <rte_errno.h> #include <rte_interrupts.h>
drivers/bus/auxiliary/private.h +1 -1
@@ -7,9 +7,9 @@#include <stdbool.h> #include <stdio.h> -#include <sys/queue.h> #include <bus_driver.h> +#include <bsd_queue.h> #include "bus_auxiliary_driver.h"
drivers/bus/ifpga/ifpga_bus.c +1 -1
@@ -7,7 +7,6 @@#include <stdint.h> #include <stdlib.h> #include <stdio.h> -#include <sys/queue.h> #include <sys/mman.h> #include <sys/types.h> #include <unistd.h>
@@ -26,6 +25,7 @@#include <rte_alarm.h> #include <rte_string_fns.h> #include <rte_debug.h> +#include <rte_tailq.h> #include "rte_rawdev.h" #include "rte_rawdev_pmd.h"
drivers/bus/pci/bsd/pci.c +1 -1
@@ -15,7 +15,6 @@#include <errno.h> #include <dirent.h> #include <limits.h> -#include <sys/queue.h> #include <sys/mman.h> #include <sys/ioctl.h> #include <sys/pciio.h>
@@ -38,6 +37,7 @@#include <rte_string_fns.h> #include <rte_debug.h> #include <rte_devargs.h> +#include <rte_tailq.h> #include <eal_export.h> #include "eal_filesystem.h"
drivers/bus/pci/pci_common.c +0 -1
@@ -9,7 +9,6 @@#include <stdbool.h> #include <stdlib.h> #include <stdio.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_errno.h> #include <rte_interrupts.h>
drivers/bus/pci/pci_params.c +0 -2
@@ -2,8 +2,6 @@* Copyright 2018 Gaëtan Rivet */ -#include <sys/queue.h> -#include <bus_driver.h> #include <rte_bus_pci.h> #include <dev_driver.h>
drivers/bus/pci/windows/pci.c +1 -2
@@ -2,8 +2,6 @@* Copyright 2020 Mellanox Technologies, Ltd */ -#include <sys/queue.h> -#include <eal_export.h> #include <rte_windows.h> #include <rte_errno.h>
@@ -11,6 +9,7 @@#include <rte_eal.h> #include <rte_memory.h> #include <rte_bus_pci.h> +#include <rte_tailq.h> #include "private.h" #include "pci_netuio.h"
drivers/bus/pci/windows/pci_netuio.c +0 -2
@@ -2,8 +2,6 @@* Copyright(c) 2020 Intel Corporation. */ -#include <sys/queue.h> -#include <rte_windows.h> #include <rte_errno.h> #include <rte_log.h>
drivers/bus/platform/platform.c +1 -1
@@ -8,7 +8,6 @@#include <string.h> #include <sys/ioctl.h> #include <sys/mman.h> -#include <sys/queue.h> #include <unistd.h> #include <bus_driver.h>
@@ -21,6 +20,7 @@#include <rte_log.h> #include <rte_memory.h> #include <rte_string_fns.h> +#include <rte_tailq.h> #include <rte_vfio.h> #include "private.h"
drivers/bus/vdev/vdev.c +0 -1
@@ -8,7 +8,6 @@#include <stdlib.h> #include <stdint.h> #include <stdbool.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_eal.h>
drivers/bus/vmbus/vmbus_common.c +0 -1
@@ -7,7 +7,6 @@#include <unistd.h> #include <dirent.h> #include <fcntl.h> -#include <sys/queue.h> #include <sys/mman.h> #include <eal_export.h>
Signature · 1 line
2.47.2
RFC 22/47 net/qede: use bsd_queue.h
In reply to Stephen HemmingerThe BSD version has the needed SLIST_FOREACH_SAFE already.
--- drivers/net/qede/qede_ethdev.h | 3 +-- drivers/net/qede/qede_filter.c | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-)
drivers/net/qede/qede_ethdev.h +1 -2
@@ -8,8 +8,7 @@#ifndef _QEDE_ETHDEV_H_#define _QEDE_ETHDEV_H_ -#include <sys/queue.h> - +#include <bsd_queue.h> #include <rte_ether.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
drivers/net/qede/qede_filter.c +0 -6
@@ -12,12 +12,6 @@#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 {
Signature · 1 line
2.47.2
RFC 23/47 net/bnxt: remove use of sys/queue.h
In reply to Stephen HemmingerFix unsafe use after free by using STAILQ_FOREACH_SAFE.
--- drivers/net/bnxt/bnxt.h | 1 - drivers/net/bnxt/bnxt_filter.c | 7 +++---- drivers/net/bnxt/bnxt_flow.c | 1 - drivers/net/bnxt/bnxt_vnic.h | 1 - drivers/net/bnxt/tf_ulp/bnxt_ulp.h | 1 - drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c | 1 - 6 files changed, 3 insertions(+), 9 deletions(-)
drivers/net/bnxt/bnxt.h +0 -1
@@ -9,7 +9,6 @@#include <inttypes.h> #include <stdbool.h> #include <pthread.h> -#include <sys/queue.h> #include <rte_pci.h> #include <bus_pci_driver.h>
drivers/net/bnxt/bnxt_filter.c +3 -4
@@ -3,8 +3,7 @@* All rights reserved. */ -#include <sys/queue.h> - +#include <bsd_queue.h> #include <rte_byteorder.h> #include <rte_log.h> #include <rte_malloc.h>
@@ -110,7 +109,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, *tmp;uint16_t max_filters, i;int rc =0 ;
@@ -151,7 +150,7 @@ 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) { + STAILQ_FOREACH_SAFE(filter, &bp->pf->vf_info[i].filter, next, tmp) {rte_free (filter);STAILQ_REMOVE (&bp->pf->vf_info[i].filter, filter, bnxt_filter_info, next);
drivers/net/bnxt/bnxt_flow.c +0 -1
@@ -3,7 +3,6 @@* All rights reserved. */ -#include <sys/queue.h> #include <rte_log.h> #include <rte_malloc.h>
drivers/net/bnxt/bnxt_vnic.h +0 -1
@@ -6,7 +6,6 @@#ifndef _BNXT_VNIC_H_#define _BNXT_VNIC_H_ -#include <sys/queue.h> #include <stdbool.h> #include <rte_hash.h>
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <stdbool.h> -#include <sys/queue.h> #include "rte_version.h" #include "rte_ethdev.h"
drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c +0 -1
@@ -4,7 +4,6 @@*/ #include <math.h> -#include <sys/queue.h> #include <rte_log.h> #include <rte_malloc.h>
Signature · 1 line
2.47.2
RFC 24/47 net/intel: remove use of sys/queue.h
In reply to Stephen HemmingerFor all the drivers, remove use of sys/queue.h if not necessary. Remove locally defined FOREACH_SAFE macros.
Use bsd_queue.h instead.
--- drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c | 1 - drivers/net/intel/e1000/e1000_ethdev.h | 1 - drivers/net/intel/e1000/em_ethdev.c | 1 - drivers/net/intel/e1000/em_rxtx.c | 1 - drivers/net/intel/e1000/igb_ethdev.c | 2 +- drivers/net/intel/e1000/igb_flow.c | 2 +- drivers/net/intel/e1000/igb_rxtx.c | 1 - drivers/net/intel/i40e/i40e_ethdev.c | 9 +++------ drivers/net/intel/i40e/i40e_ethdev.h | 1 - drivers/net/intel/i40e/i40e_fdir.c | 2 +- drivers/net/intel/i40e/i40e_flow.c | 1 - drivers/net/intel/i40e/i40e_hash.c | 1 - drivers/net/intel/i40e/i40e_pf.c | 1 - drivers/net/intel/i40e/i40e_rxtx.c | 1 - drivers/net/intel/iavf/iavf.h | 1 - drivers/net/intel/iavf/iavf_ethdev.c | 1 - drivers/net/intel/iavf/iavf_fdir.c | 1 - drivers/net/intel/iavf/iavf_fsub.c | 1 - drivers/net/intel/iavf/iavf_generic_flow.c | 1 - drivers/net/intel/iavf/iavf_hash.c | 1 - drivers/net/intel/iavf/iavf_rxtx.c | 1 - drivers/net/intel/iavf/iavf_vchnl.c | 7 ------- drivers/net/intel/ice/base/ice_osdep.h | 2 +- drivers/net/intel/ice/ice_acl_filter.c | 1 - drivers/net/intel/ice/ice_dcf.c | 2 +- drivers/net/intel/ice/ice_dcf_ethdev.c | 1 - drivers/net/intel/ice/ice_ethdev.c | 8 ++------ drivers/net/intel/ice/ice_generic_flow.c | 1 - drivers/net/intel/ice/ice_hash.c | 1 - drivers/net/intel/ice/ice_switch_filter.c | 1 - drivers/net/intel/idpf/base/idpf_osdep.h | 9 +-------- drivers/net/intel/ipn3ke/ipn3ke_ethdev.h | 1 - drivers/net/intel/ipn3ke/ipn3ke_flow.c | 1 - drivers/net/intel/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/intel/ixgbe/ixgbe_ethdev.h | 1 - drivers/net/intel/ixgbe/ixgbe_fdir.c | 2 +- drivers/net/intel/ixgbe/ixgbe_flow.c | 2 +- drivers/net/intel/ixgbe/ixgbe_rxtx.c | 1 - 38 files changed, 14 insertions(+), 61 deletions(-)
drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2022 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/e1000/e1000_ethdev.h +0 -1
@@ -6,7 +6,6 @@#define _E1000_ETHDEV_H_#include <stdint.h> -#include <sys/queue.h> #include <rte_flow.h> #include <rte_time.h>
drivers/net/intel/e1000/em_ethdev.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2010-2016 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/e1000/em_rxtx.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2010-2016 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <stdlib.h>
drivers/net/intel/e1000/igb_ethdev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2010-2016 Intel Corporation */ -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/e1000/igb_flow.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2010-2016 Intel Corporation */ -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/e1000/igb_rxtx.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2010-2016 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <stdlib.h>
drivers/net/intel/i40e/i40e_ethdev.c +3 -6
@@ -12,6 +12,7 @@#include <inttypes.h> #include <assert.h> +#include <bsd_queue.h> #include <rte_common.h> #include <rte_eal.h> #include <rte_string_fns.h>
@@ -5097,16 +5098,12 @@ i40e_res_pool_destroy(struct i40e_res_pool_info *pool)if (pool ==NULL )return ; -for (entry =LIST_FIRST (&pool->alloc_list); - entry && (next_entry =LIST_NEXT (entry, next),1 ); - entry = next_entry) { + LIST_FOREACH_SAFE(entry, &pool->alloc_list, next, next_entry) {LIST_REMOVE (entry, next);rte_free (entry); } -for (entry =LIST_FIRST (&pool->free_list); - entry && (next_entry =LIST_NEXT (entry, next),1 ); - entry = next_entry) { + LIST_FOREACH_SAFE(entry, &pool->free_list, next, next_entry) {LIST_REMOVE (entry, next);rte_free (entry); }
drivers/net/intel/i40e/i40e_ethdev.h +0 -1
@@ -6,7 +6,6 @@#define _I40E_ETHDEV_H_#include <stdint.h> -#include <sys/queue.h> #include <rte_time.h> #include <rte_kvargs.h>
drivers/net/intel/i40e/i40e_fdir.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2010-2015 Intel Corporation */ -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/i40e/i40e_flow.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2016-2017 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/i40e/i40e_hash.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2020 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/i40e/i40e_pf.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/i40e/i40e_rxtx.c +0 -1
@@ -10,7 +10,6 @@#include <stdarg.h> #include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <rte_string_fns.h> #include <rte_memzone.h>
drivers/net/intel/iavf/iavf.h +0 -1
@@ -5,7 +5,6 @@#ifndef _IAVF_ETHDEV_H_#define _IAVF_ETHDEV_H_ -#include <sys/queue.h> #include <rte_kvargs.h> #include <rte_tm_driver.h>
drivers/net/intel/iavf/iavf_ethdev.c +0 -1
@@ -3,7 +3,6 @@*/ #include <ctype.h> -#include <sys/queue.h> #include <stdalign.h> #include <stdio.h> #include <errno.h>
drivers/net/intel/iavf/iavf_fdir.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2020 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/iavf/iavf_fsub.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2022 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/iavf/iavf_generic_flow.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2019 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/iavf/iavf_hash.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2020 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/iavf/iavf_rxtx.c +0 -1
@@ -10,7 +10,6 @@#include <stdarg.h> #include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_string_fns.h>
drivers/net/intel/iavf/iavf_vchnl.c +0 -7
@@ -52,13 +52,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) {
drivers/net/intel/ice/base/ice_osdep.h +1 -1
@@ -10,9 +10,9 @@#include <stdio.h> #include <stdarg.h> #include <inttypes.h> -#include <sys/queue.h> #include <stdbool.h> +#include <bsd_queue.h> #include <rte_common.h> #include <rte_memcpy.h> #include <rte_malloc.h>
drivers/net/intel/ice/ice_acl_filter.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2020 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ice/ice_dcf.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2020 Intel Corporation */ -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ice/ice_dcf_ethdev.c +0 -1
@@ -4,7 +4,6 @@#include <errno.h> #include <stdbool.h> -#include <sys/queue.h> #include <sys/types.h> #include <unistd.h>
drivers/net/intel/ice/ice_ethdev.c +2 -6
@@ -883,16 +883,12 @@ ice_res_pool_destroy(struct ice_res_pool_info *pool)if (!pool)return ; -for (entry =LIST_FIRST (&pool->alloc_list); - entry && (next_entry =LIST_NEXT (entry, next),1 ); - entry = next_entry) { + LIST_FOREACH_SAFE(entry, &pool->alloc_list, next, next_entry) {LIST_REMOVE (entry, next);rte_free (entry); } -for (entry =LIST_FIRST (&pool->free_list); - entry && (next_entry =LIST_NEXT (entry, next),1 ); - entry = next_entry) { + LIST_FOREACH_SAFE(entry, &pool->free_list, next, next_entry) {LIST_REMOVE (entry, next);rte_free (entry); }
drivers/net/intel/ice/ice_generic_flow.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2019 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ice/ice_hash.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2019 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ice/ice_switch_filter.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2019 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/idpf/base/idpf_osdep.h +1 -8
@@ -10,7 +10,7 @@#include <stdio.h> #include <stdarg.h> #include <inttypes.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdbool.h> #include <rte_common.h>
@@ -343,13 +343,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)
drivers/net/intel/ipn3ke/ipn3ke_ethdev.h +0 -1
@@ -11,7 +11,6 @@#include <limits.h> #include <net/if.h> #include <netinet/in.h> -#include <sys/queue.h> #include <rte_mbuf.h> #include <rte_flow_driver.h>
drivers/net/intel/ipn3ke/ipn3ke_flow.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2019 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ixgbe/ixgbe_ethdev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ixgbe/ixgbe_ethdev.h +0 -1
@@ -7,7 +7,6 @@#include <stdint.h> #include <stdbool.h> -#include <sys/queue.h> #include "base/ixgbe_type.h" #include "base/ixgbe_dcb.h"
drivers/net/intel/ixgbe/ixgbe_fdir.c +1 -1
@@ -6,7 +6,7 @@#include <stdint.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_interrupts.h> #include <rte_log.h>
drivers/net/intel/ixgbe/ixgbe_flow.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2010-2016 Intel Corporation */ -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ixgbe/ixgbe_rxtx.c +0 -1
@@ -3,7 +3,6 @@* Copyright 2014 6WIND S.A. */ -#include <sys/queue.h> #include <stdio.h> #include <stdlib.h>
Signature · 1 line
2.47.2
RFC 25/47 net/mlx5: remove unnecessary include of sys/queue.h
In reply to Stephen HemmingerAlready handled by rte_tailq.h in most places.
--- drivers/net/mlx5/hws/mlx5dr_internal.h | 1 - drivers/net/mlx5/linux/mlx5_verbs.c | 1 - drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_devx.c | 1 - drivers/net/mlx5/mlx5_flow.c | 2 +- drivers/net/mlx5/mlx5_flow.h | 2 +- drivers/net/mlx5/mlx5_flow_dv.c | 1 - drivers/net/mlx5/mlx5_flow_verbs.c | 2 +- drivers/net/mlx5/mlx5_rx.h | 1 - drivers/net/mlx5/mlx5_rxq.c | 2 +- drivers/net/mlx5/mlx5_rxtx.h | 1 - drivers/net/mlx5/mlx5_tx.h | 1 - 12 files changed, 5 insertions(+), 12 deletions(-)
drivers/net/mlx5/hws/mlx5dr_internal.h +0 -1
@@ -6,7 +6,6 @@#define MLX5DR_INTERNAL_H_ #include <stdint.h> -#include <sys/queue.h> /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC #pragma GCC diagnostic ignored "-Wpedantic"
drivers/net/mlx5/linux/mlx5_verbs.c +0 -1
@@ -8,7 +8,6 @@#include <stdint.h> #include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include "mlx5_autoconf.h"
drivers/net/mlx5/mlx5.h +1 -1
@@ -10,7 +10,7 @@#include <stdbool.h> #include <stdint.h> #include <limits.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_pci.h> #include <rte_ether.h>
drivers/net/mlx5/mlx5_devx.c +0 -1
@@ -7,7 +7,6 @@#include <stdbool.h> #include <string.h> #include <stdint.h> -#include <sys/queue.h> #include <rte_malloc.h> #include <rte_common.h>
drivers/net/mlx5/mlx5_flow.c +1 -1
@@ -7,7 +7,7 @@#include <stdint.h> #include <string.h> #include <stdbool.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <eal_export.h> #include <rte_common.h>
drivers/net/mlx5/mlx5_flow.h +1 -1
@@ -8,7 +8,7 @@#include <stdalign.h> #include <stdint.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_alarm.h> #include <rte_mtr.h>
drivers/net/mlx5/mlx5_flow_dv.c +0 -1
@@ -2,7 +2,6 @@* Copyright 2018 Mellanox Technologies, Ltd */ -#include <sys/queue.h> #include <stdalign.h> #include <stdint.h> #include <string.h>
drivers/net/mlx5/mlx5_flow_verbs.c +1 -1
@@ -3,7 +3,7 @@*/ #include <netinet/in.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdalign.h> #include <stdint.h> #include <string.h>
drivers/net/mlx5/mlx5_rx.h +0 -1
@@ -7,7 +7,6 @@#define RTE_PMD_MLX5_RX_H_ #include <stdint.h> -#include <sys/queue.h> #include <rte_mbuf.h> #include <rte_mempool.h>
drivers/net/mlx5/mlx5_rxq.c +1 -1
@@ -8,7 +8,7 @@#include <string.h> #include <stdint.h> #include <fcntl.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <eal_export.h> #include <rte_mbuf.h>
drivers/net/mlx5/mlx5_rxtx.h +0 -1
@@ -8,7 +8,6 @@#include <stddef.h> #include <stdint.h> -#include <sys/queue.h> #include <rte_mbuf.h> #include <rte_mempool.h>
drivers/net/mlx5/mlx5_tx.h +0 -1
@@ -7,7 +7,6 @@#define RTE_PMD_MLX5_TX_H_ #include <stdint.h> -#include <sys/queue.h> #include <rte_mbuf.h> #include <rte_mempool.h>
Signature · 1 line
2.47.2
RFC 26/47 net/tap: remove unnecessary include of sys/queue.h
In reply to Stephen HemmingerThe macros in sys/queue.h are not used here.
--- drivers/net/tap/rte_eth_tap.h | 1 - drivers/net/tap/tap_flow.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/tap/rte_eth_tap.h +0 -1
@@ -6,7 +6,6 @@#ifndef _RTE_ETH_TAP_H_#define _RTE_ETH_TAP_H_ -#include <sys/queue.h> #include <sys/uio.h> #include <inttypes.h> #include <net/if.h>
drivers/net/tap/tap_flow.c +0 -1
@@ -6,7 +6,6 @@#include <errno.h> #include <string.h> #include <unistd.h> -#include <sys/queue.h> #include <sys/resource.h> #include <rte_byteorder.h>
Signature · 1 line
2.47.2
RFC 27/47 net/axgbe: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/axgbe/axgbe_common.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/axgbe/axgbe_common.h +0 -1
@@ -10,7 +10,6 @@#include <stdbool.h> #include <limits.h> -#include <sys/queue.h> #include <stdio.h> #include <stdlib.h> #include <string.h>
Signature · 1 line
2.47.2
RFC 28/47 net/bnx2x: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/bnx2x/bnx2x_ethdev.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/bnx2x/bnx2x_ethdev.h +0 -1
@@ -8,7 +8,6 @@#ifndef PMD_BNX2X_ETHDEV_H #define PMD_BNX2X_ETHDEV_H -#include <sys/queue.h> #include <sys/param.h> #include <sys/user.h> #include <sys/stat.h>
Signature · 1 line
2.47.2
RFC 29/47 net/bonding: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/bonding/eth_bond_private.h | 1 - drivers/net/bonding/rte_eth_bond_flow.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/bonding/eth_bond_private.h +0 -1
@@ -6,7 +6,6 @@#define _ETH_BOND_PRIVATE_H_#include <stdint.h> -#include <sys/queue.h> #include <ethdev_driver.h> #include <rte_flow.h>
drivers/net/bonding/rte_eth_bond_flow.c +0 -1
@@ -4,7 +4,6 @@#include <stddef.h> #include <string.h> -#include <sys/queue.h> #include <rte_errno.h> #include <rte_malloc.h>
Signature · 1 line
2.47.2
RFC 30/47 net/cxgbe: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/cxgbe/cxgbe_main.c | 1 - drivers/net/cxgbe/sge.c | 1 - 3 files changed, 1 insertion(+), 3 deletions(-)
drivers/net/cxgbe/cxgbe_ethdev.c +1 -1
@@ -3,7 +3,7 @@* All rights reserved. */ -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/cxgbe/cxgbe_main.c +0 -1
@@ -3,7 +3,6 @@* All rights reserved. */ -#include <sys/queue.h> #include <sys/stat.h> #include <stdio.h> #include <errno.h>
drivers/net/cxgbe/sge.c +0 -1
@@ -3,7 +3,6 @@* All rights reserved. */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
Signature · 1 line
2.47.2
RFC 31/47 net/enic: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/enic/enic.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/enic/enic.h +0 -1
@@ -21,7 +21,6 @@#include "enic_res.h" #include "cq_enet_desc.h" #include <stdbool.h> -#include <sys/queue.h> #include <rte_spinlock.h> #define DRV_NAME "enic_pmd"
Signature · 1 line
2.47.2
RFC 32/47 net/failsafe: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/failsafe/failsafe_flow.c | 1 - drivers/net/failsafe/failsafe_private.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/net/failsafe/failsafe_flow.c +0 -1
@@ -5,7 +5,6 @@#include <stddef.h> #include <string.h> -#include <sys/queue.h> #include <rte_errno.h> #include <rte_malloc.h>
drivers/net/failsafe/failsafe_private.h +1 -1
@@ -7,7 +7,7 @@#define _ETH_FAILSAFE_PRIVATE_H_#include <stdint.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <pthread.h> #include <rte_atomic.h>
Signature · 1 line
2.47.2
RFC 33/47 net/memif: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/memif/memif_socket.h | 1 - drivers/net/memif/rte_eth_memif.h | 1 - 2 files changed, 2 deletions(-)
drivers/net/memif/memif_socket.h +0 -1
@@ -5,7 +5,6 @@#ifndef _MEMIF_SOCKET_H_#define _MEMIF_SOCKET_H_ -#include <sys/queue.h> #include <sys/un.h> /**
drivers/net/memif/rte_eth_memif.h +0 -1
@@ -5,7 +5,6 @@#ifndef _RTE_ETH_MEMIF_H_#define _RTE_ETH_MEMIF_H_ -#include <sys/queue.h> #include <ethdev_driver.h> #include <rte_ether.h>
Signature · 1 line
2.47.2
RFC 34/47 net/mlx4: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/mlx4/mlx4.h | 1 - drivers/net/mlx4/mlx4_flow.c | 2 +- drivers/net/mlx4/mlx4_flow.h | 1 - drivers/net/mlx4/mlx4_mr.h | 1 - drivers/net/mlx4/mlx4_rxtx.h | 1 - 5 files changed, 1 insertion(+), 5 deletions(-)
drivers/net/mlx4/mlx4.h +0 -1
@@ -8,7 +8,6 @@#include <net/if.h> #include <stdint.h> -#include <sys/queue.h> /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC
drivers/net/mlx4/mlx4_flow.c +1 -1
@@ -14,7 +14,7 @@#include <stddef.h> #include <stdint.h> #include <string.h> -#include <sys/queue.h> +#include <bsd_queue.h> /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC
drivers/net/mlx4/mlx4_flow.h +0 -1
@@ -7,7 +7,6 @@#define RTE_PMD_MLX4_FLOW_H_ #include <stdint.h> -#include <sys/queue.h> /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC
drivers/net/mlx4/mlx4_mr.h +0 -1
@@ -8,7 +8,6 @@#include <stddef.h> #include <stdint.h> -#include <sys/queue.h> /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC
drivers/net/mlx4/mlx4_rxtx.h +0 -1
@@ -7,7 +7,6 @@#define MLX4_RXTX_H_ #include <stdint.h> -#include <sys/queue.h> /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC
Signature · 1 line
2.47.2
RFC 35/47 net/ngbe: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/ngbe/ngbe_ethdev_vf.c | 1 - drivers/net/ngbe/ngbe_rxtx.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/ngbe/ngbe_ethdev_vf.c +0 -1
@@ -3,7 +3,6 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/ngbe/ngbe_rxtx.c +0 -1
@@ -3,7 +3,6 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> #include <stdint.h> #include <rte_ethdev.h>
Signature · 1 line
2.47.2
RFC 36/47 net/ntnic: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/ntnic/ntnic_ethdev.c | 1 - 1 file changed, 1 deletion(-)
drivers/net/ntnic/ntnic_ethdev.c +0 -1
@@ -16,7 +16,6 @@#include <ethdev_pci.h> #include <rte_kvargs.h> -#include <sys/queue.h> #include "rte_spinlock.h" #include "ntlog.h"
Signature · 1 line
2.47.2
RFC 37/47 net/sfc: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/sfc/sfc_dp.c | 2 +- drivers/net/sfc/sfc_dp.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/net/sfc/sfc_dp.c +1 -1
@@ -7,7 +7,7 @@* for Solarflare) and Solarflare Communications, Inc. */ -#include <sys/queue.h> +#include <bsd_queue.h> #include <stdalign.h> #include <string.h> #include <errno.h>
drivers/net/sfc/sfc_dp.h +0 -1
@@ -11,7 +11,6 @@#define _SFC_DP_H#include <stdbool.h> -#include <sys/queue.h> #include <rte_pci.h>
Signature · 1 line
2.47.2
RFC 38/47 net/softnic: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/softnic/rte_eth_softnic_internals.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/softnic/rte_eth_softnic_internals.h +0 -1
@@ -7,7 +7,6 @@#include <stddef.h> #include <stdint.h> -#include <sys/queue.h> #include <rte_mempool.h> #include <rte_mbuf.h>
Signature · 1 line
2.47.2
RFC 39/47 net/thunderx: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/thunderx/base/nicvf_bsvf.h | 2 +- drivers/net/thunderx/base/nicvf_plat.h | 1 + drivers/net/thunderx/nicvf_ethdev.c | 1 - 3 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/thunderx/base/nicvf_bsvf.h +1 -1
@@ -5,7 +5,7 @@#ifndef __THUNDERX_NICVF_BSVF_H__#define __THUNDERX_NICVF_BSVF_H__ -#include <sys/queue.h> +#include <bsd_queue.h> struct nicvf ;
drivers/net/thunderx/base/nicvf_plat.h +1 -0
@@ -6,6 +6,7 @@#define _THUNDERX_NICVF_H/* Platform/OS/arch specific abstractions */ +#include <bsd_queue.h> /* log */ #include <rte_log.h>
drivers/net/thunderx/nicvf_ethdev.c +0 -1
@@ -12,7 +12,6 @@#include <stdarg.h> #include <inttypes.h> #include <netinet/in.h> -#include <sys/queue.h> #include <rte_alarm.h> #include <rte_branch_prediction.h>
Signature · 1 line
2.47.2
RFC 40/47 net/txgbe: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/txgbe/txgbe_ethdev_vf.c | 1 - drivers/net/txgbe/txgbe_fdir.c | 2 +- drivers/net/txgbe/txgbe_flow.c | 2 +- drivers/net/txgbe/txgbe_rxtx.c | 1 - 4 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/txgbe/txgbe_ethdev_vf.c +0 -1
@@ -3,7 +3,6 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/txgbe/txgbe_fdir.c +1 -1
@@ -7,7 +7,7 @@#include <stdint.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <rte_malloc.h> #include "txgbe_logs.h"
drivers/net/txgbe/txgbe_flow.c +1 -1
@@ -3,7 +3,7 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> +#include <bsd_queue.h> #include <bus_pci_driver.h> #include <rte_malloc.h> #include <rte_flow.h>
drivers/net/txgbe/txgbe_rxtx.c +0 -1
@@ -3,7 +3,6 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <stdlib.h>
Signature · 1 line
2.47.2
RFC 41/47 net/vdev_netvsc: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/vdev_netvsc/vdev_netvsc.c +1 -1
@@ -19,7 +19,7 @@#include <stdio.h> #include <string.h> #include <sys/ioctl.h> -#include <sys/queue.h> +#include <bsd_queue.h> #include <sys/socket.h> #include <unistd.h>
Signature · 1 line
2.47.2
RFC 42/47 net/vmxnet3: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 - drivers/net/vmxnet3/vmxnet3_rxtx.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2010-2015 Intel Corporation */ -#include <sys/queue.h> #include <stdalign.h> #include <stdio.h> #include <errno.h>
drivers/net/vmxnet3/vmxnet3_rxtx.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2010-2015 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <stdlib.h>
Signature · 1 line
2.47.2
RFC 43/47 net/zxdh: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/zxdh/zxdh_mtr.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/zxdh/zxdh_mtr.h +0 -1
@@ -7,7 +7,6 @@#include <stddef.h> #include <stdint.h> -#include <sys/queue.h> #include <rte_mtr.h> #include "zxdh_np.h"
Signature · 1 line
2.47.2
RFC 44/47 net/dpaa2: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK bsd_queue.h
--- drivers/net/dpaa2/dpaa2_flow.c | 1 - drivers/net/dpaa2/dpaa2_mux.c | 1 - drivers/net/dpaa2/dpaa2_ptp.c | 1 - 3 files changed, 3 deletions(-)
drivers/net/dpaa2/dpaa2_flow.c +0 -1
@@ -2,7 +2,6 @@* Copyright 2018-2022 NXP */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/dpaa2/dpaa2_mux.c +0 -1
@@ -2,7 +2,6 @@* Copyright 2018-2021,2023 NXP */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/dpaa2/dpaa2_ptp.c +0 -1
@@ -2,7 +2,6 @@* Copyright 2019, 2023 NXP */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
Signature · 1 line
2.47.2
RFC 45/47 eal: remove no longer used windows version of queue.h
In reply to Stephen HemmingerThe file sys/queue.h is not used anywhere now in DPDK.
--- lib/eal/windows/include/sys/queue.h | 840 ---------------------------- 1 file changed, 840 deletions(-) delete mode 100644 lib/eal/windows/include/sys/queue.h
lib/eal/windows/include/sys/queue.h deleted +0 -840
@@ -1,840 +0,0 @@ -/* SPDX-License-Identifier: BSD-3-Clause -* -* Copyright (c) 1991, 1993 -* The Regents of the University of California. All rights reserved. -*/ - -#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. -*/ -#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_ */
Signature · 1 line
2.47.2
RFC 46/47 net/mvpp2: replace local definition of FOREACH_SAFE
In reply to Stephen HemmingerThere is now a standard macro for this.
--- drivers/net/mvpp2/mrvl_mtr.c | 8 ++------ 1 file changed, 2 insertions(+), 6 deletions(-)
drivers/net/mvpp2/mrvl_mtr.c +2 -6
@@ -505,13 +505,9 @@ mrvl_mtr_deinit(struct rte_eth_dev *dev)struct mrvl_mtr_profile *profile, *tmp_profile;struct mrvl_mtr *mtr, *tmp_mtr; -for (mtr =LIST_FIRST (&priv->mtrs); - mtr && (tmp_mtr =LIST_NEXT (mtr, next),1 ); - mtr = tmp_mtr) + LIST_FOREACH_SAFE(mtr, &priv->mtrs, next, tmp_mtr)mrvl_destroy (dev, mtr->mtr_id,NULL ); -for (profile =LIST_FIRST (&priv->profiles); - profile && (tmp_profile =LIST_NEXT (profile, next),1 ); - profile = tmp_profile) + LIST_FOREACH_SAFE(profile, &priv_profiles, next, tmp_profile)mrvl_meter_profile_delete (dev, profile->profile_id,NULL ); }
Signature · 1 line
2.47.2
RFC 47/47 drivers/raw: replace with TAILQ_FOREACH_SAFE
In reply to Stephen HemmingerThere is now a standard macro to safely walk tailq.
--- drivers/raw/ifpga/base/ifpga_enumerate.c | 6 +++--- drivers/raw/ifpga/base/opae_intel_max10.c | 8 +------- 2 files changed, 4 insertions(+), 10 deletions(-)
drivers/raw/ifpga/base/ifpga_enumerate.c +3 -3
@@ -6,6 +6,8 @@#include <inttypes.h> #include <unistd.h> +#include <bsd_queue.h> +#include "opae_hw_api.h" #include "ifpga_api.h"
@@ -725,9 +727,7 @@ static void dfl_fpga_enum_info_free(struct dfl_fpga_enum_info *info)return ;/* remove all device feature lists in the list. */ -for (dfl =TAILQ_FIRST (&info->dfls); - dfl && (tmp =TAILQ_NEXT (dfl, node),1 ); - dfl = tmp) { + TAILQ_FOREACH_SAFE(dfl, &info->dfls, node, tmp) {TAILQ_REMOVE (&info->dfls, dfl, node);opae_free (dfl); }
drivers/raw/ifpga/base/opae_intel_max10.c +1 -7
@@ -4,14 +4,8 @@#include "opae_intel_max10.h" #include <libfdt.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 +#include "opae_osdep.h" int max10_sys_read (struct intel_max10_device *dev,unsigned int offset,unsigned int *val)
Signature · 1 line
2.47.2
Quoted 11 lines · Stephen Hemminger
This patchset cleans up the
queue.hmacro problems in DPDK. The root cause is thatsys/queue.hin Linux is an old version from early BSD; my best guess is that it is a BSD GPL license issue that it never got updated. The Linux version is missing several useful macros which leads to redefiniton, bugs, etc.The patch starts out by introducing a version of the current FreeBSD
queue.hnamed asbsd_queue.h, then uses it across all of DPDK. The filesys/queue.his no longer used. Ends up doing one line change on lots of files.
With one small comment on naming in patch 1, this set looks a good cleanup to me.
v2 cover Introduce more complete queue.h macros
In reply to Stephen HemmingerThis patchset cleans up the queue.h macro problems in DPDK. The root cause is that sys/queue.h in Linux is an old version from early BSD; my best guess is that it is a BSD GPL license issue that it never got updated. The Linux version is missing several useful macros which leads to redefiniton, bugs, etc.
The patch starts out by introducing a version of the current FreeBSD queue.h named as bsd_queue.h, then uses it across all of DPDK. The file sys/queue.h is no longer used. Ends up doing one line change on lots of files.
The patch fixes a couple of use after free cases in existing drivers. May require some manual effort to backport but not that hard.
v2 - review feedback
- some small combining of related patchs
- fix build on Windows
Stephen Hemminger (43):
net/nfp: fix use after free
eal: add BSD version of queue.h
test: remove unnecessary inclusion of sys/queue.h
test-pipeline: remove unnecessary use of sys/queue.h
test-eventdev: use rte_bsd_queue.h
test-bbdev, test-cmdline, test-mldev: don't use sys/queue.h app/testpmd: use rte_bsd_queue.h
apps: use rte_bsd_queue.h
examples: replace use of sys/queue.h
ethdev: replace use of sys/queue.h
lib: remove use of sys/queue.h
drivers/bus: replace use of sys/queue.h
net/nfp: use rte_bsd_queue.h
net/qede: use rte_bsd_queue.h
net/bnxt: remove use of sys/queue.h
net/intel: remove use of sys/queue.h
net/mlx5: remove unnecessary include of sys/queue.h net/mlx4: replace use of sys/queue.h
net/tap: remove unnecessary include of sys/queue.h net/axgbe: replace use of sys/queue.h
net/bnx2x: replace use of sys/queue.h net/bonding: replace use of sys/queue.h net/cxgbe: replace use of sys/queue.h
net/enic: replace use of sys/queue.h net/failsafe: replace use of sys/queue.h net/memif: replace use of sys/queue.h
net/ngbe: replace use of sys/queue.h
net/ntnic: replace use of sys/queue.h
net/sfc: replace use of sys/queue.h
net/softnic: replace use of sys/queue.h net/thunderx: replace use of sys/queue.h net/txgbe: replace use of sys/queue.h net/vdev_netvsc: replace use of sys/queue.h net/vmxnet3: replace use of sys/queue.h
net/zxdh: replace use of sys/queue.h
net/dpaa2: replace use of sys/queue.h
net/mvpp2: replace local definition of FOREACH_SAFE raw/ifpga: replace with TAILQ_FOREACH_SAFE drivers/vdpa: replace use of sys/queue.h drivers/common: remove use of sys/queue.h drivers/crypto: remove use of sys_queue.h drivers/event: remove include of sys/queue.h
eal: remove no longer used windows version of sys/queue.h
app/dumpcap/main.c | 2 +-
app/proc-info/main.c | 1 -
app/test-bbdev/main.h | 1 -
app/test-cmdline/cmdline_test.c | 1 -
app/test-eventdev/evt_test.c | 2 +-
app/test-eventdev/evt_test.h | 1 -
app/test-mldev/ml_test.h | 1 -
app/test-pipeline/config.c | 1 -
app/test-pipeline/init.c | 1 -
app/test-pipeline/main.c | 1 -
app/test-pipeline/runtime.c | 1 -
app/test-pmd/5tswap.c | 2 -
app/test-pmd/cmdline.c | 2 +-
app/test-pmd/config.c | 2 +-
app/test-pmd/csumonly.c | 1 -
app/test-pmd/flowgen.c | 1 -
app/test-pmd/hairpin.c | 1 -
app/test-pmd/icmpecho.c | 1 -
app/test-pmd/iofwd.c | 1 -
app/test-pmd/macfwd.c | 1 -
app/test-pmd/macswap.c | 1 -
app/test-pmd/noisy_vnf.c | 1 -
app/test-pmd/parameters.c | 1 -
app/test-pmd/rxonly.c | 1 -
app/test-pmd/testpmd.c | 1 -
app/test-pmd/testpmd.h | 2 +-
app/test-pmd/txonly.c | 1 -
app/test/commands.c | 2 +-
app/test/test.c | 1 -
app/test/test.h | 2 +-
app/test/test_atomic.c | 1 -
app/test/test_cmdline_lib.c | 1 -
app/test/test_func_reentrancy.c | 1 -
app/test/test_hash.c | 1 -
app/test/test_hash_functions.c | 1 -
app/test/test_link_bonding.c | 1 -
app/test/test_link_bonding_mode4.c | 1 -
app/test/test_link_bonding_rssconf.c | 1 -
app/test/test_logs.c | 1 -
app/test/test_malloc.c | 1 -
app/test/test_mbuf.c | 1 -
app/test/test_mcslock.c | 1 -
app/test/test_mempool.c | 1 -
app/test/test_mempool_perf.c | 1 -
app/test/test_memzone.c | 1 -
app/test/test_mp_secondary.c | 1 -
app/test/test_per_lcore.c | 1 -
app/test/test_pflock.c | 1 -
app/test/test_ring.c | 1 -
app/test/test_rwlock.c | 1 -
app/test/test_soring.c | 1 -
app/test/test_spinlock.c | 1 -
app/test/test_tailq.c | 1 -
app/test/test_ticketlock.c | 1 -
app/test/test_timer.c | 1 -
doc/guides/contributing/coding_style.rst | 4 +-
doc/guides/rel_notes/release_25_11.rst | 3 +
drivers/bus/auxiliary/auxiliary_common.c | 2 +-
drivers/bus/auxiliary/private.h | 2 +-
drivers/bus/fslmc/bus_fslmc_driver.h | 1 -
drivers/bus/fslmc/fslmc_vfio.c | 1 +
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 11 +-
drivers/bus/ifpga/ifpga_bus.c | 2 +-
drivers/bus/pci/bsd/pci.c | 2 +-
drivers/bus/pci/pci_common.c | 1 -
drivers/bus/pci/pci_params.c | 2 -
drivers/bus/pci/windows/pci.c | 3 +-
drivers/bus/pci/windows/pci_netuio.c | 2 -
drivers/bus/platform/platform.c | 2 +-
drivers/bus/vdev/vdev.c | 1 -
drivers/bus/vmbus/vmbus_common.c | 1 -
drivers/common/cnxk/roc_bphy_irq.c | 3 +-
drivers/common/cnxk/roc_npc.h | 2 -
drivers/common/mlx5/mlx5_common_mr.h | 3 +-
drivers/crypto/bcmfs/bcmfs_device.c | 2 +-
drivers/crypto/bcmfs/bcmfs_device.h | 2 -
drivers/crypto/ccp/ccp_crypto.c | 1 -
drivers/crypto/ccp/ccp_dev.c | 2 +-
drivers/event/dlb2/dlb2_selftest.c | 1 -
drivers/event/opdl/opdl_test.c | 1 -
drivers/event/sw/sw_evdev_selftest.c | 1 -
drivers/net/axgbe/axgbe_common.h | 1 -
drivers/net/bnx2x/bnx2x_ethdev.h | 1 -
drivers/net/bnxt/bnxt.h | 1 -
drivers/net/bnxt/bnxt_filter.c | 7 +-
drivers/net/bnxt/bnxt_flow.c | 1 -
drivers/net/bnxt/bnxt_vnic.h | 1 -
drivers/net/bnxt/tf_ulp/bnxt_ulp.h | 1 -
drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c | 1 -
drivers/net/bonding/eth_bond_private.h | 1 -
drivers/net/bonding/rte_eth_bond_flow.c | 1 -
drivers/net/cxgbe/cxgbe_ethdev.c | 2 +-
drivers/net/cxgbe/cxgbe_main.c | 1 -
drivers/net/cxgbe/sge.c | 1 -
drivers/net/dpaa2/dpaa2_flow.c | 1 -
drivers/net/dpaa2/dpaa2_mux.c | 1 -
drivers/net/dpaa2/dpaa2_ptp.c | 1 -
drivers/net/enic/enic.h | 1 -
drivers/net/failsafe/failsafe_flow.c | 1 -
drivers/net/failsafe/failsafe_private.h | 2 +-
drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c | 1 -
drivers/net/intel/e1000/e1000_ethdev.h | 1 -
drivers/net/intel/e1000/em_ethdev.c | 1 -
drivers/net/intel/e1000/em_rxtx.c | 1 -
drivers/net/intel/e1000/igb_ethdev.c | 2 +-
drivers/net/intel/e1000/igb_flow.c | 2 +-
drivers/net/intel/e1000/igb_rxtx.c | 1 -
drivers/net/intel/i40e/i40e_ethdev.c | 9 +-
drivers/net/intel/i40e/i40e_ethdev.h | 1 -
drivers/net/intel/i40e/i40e_fdir.c | 2 +-
drivers/net/intel/i40e/i40e_flow.c | 1 -
drivers/net/intel/i40e/i40e_hash.c | 1 -
drivers/net/intel/i40e/i40e_pf.c | 1 -
drivers/net/intel/i40e/i40e_rxtx.c | 1 -
drivers/net/intel/iavf/iavf.h | 1 -
drivers/net/intel/iavf/iavf_ethdev.c | 1 -
drivers/net/intel/iavf/iavf_fdir.c | 1 -
drivers/net/intel/iavf/iavf_fsub.c | 1 -
drivers/net/intel/iavf/iavf_generic_flow.c | 1 -
drivers/net/intel/iavf/iavf_hash.c | 1 -
drivers/net/intel/iavf/iavf_rxtx.c | 1 -
drivers/net/intel/iavf/iavf_vchnl.c | 7 -
drivers/net/intel/ice/base/ice_osdep.h | 2 +-
drivers/net/intel/ice/ice_acl_filter.c | 1 -
drivers/net/intel/ice/ice_dcf.c | 2 +-
drivers/net/intel/ice/ice_dcf_ethdev.c | 1 -
drivers/net/intel/ice/ice_ethdev.c | 8 +-
drivers/net/intel/ice/ice_generic_flow.c | 1 -
drivers/net/intel/ice/ice_hash.c | 1 -
drivers/net/intel/ice/ice_switch_filter.c | 1 -
drivers/net/intel/idpf/base/idpf_osdep.h | 9 +-
drivers/net/intel/ipn3ke/ipn3ke_ethdev.h | 1 -
drivers/net/intel/ipn3ke/ipn3ke_flow.c | 1 -
drivers/net/intel/ixgbe/ixgbe_ethdev.c | 2 +-
drivers/net/intel/ixgbe/ixgbe_ethdev.h | 1 -
drivers/net/intel/ixgbe/ixgbe_fdir.c | 2 +-
drivers/net/intel/ixgbe/ixgbe_flow.c | 2 +-
drivers/net/intel/ixgbe/ixgbe_rxtx.c | 1 -
drivers/net/memif/memif_socket.h | 1 -
drivers/net/memif/rte_eth_memif.h | 1 -
drivers/net/mlx4/mlx4.h | 1 -
drivers/net/mlx4/mlx4_flow.c | 2 +-
drivers/net/mlx4/mlx4_flow.h | 1 -
drivers/net/mlx4/mlx4_mr.h | 1 -
drivers/net/mlx4/mlx4_rxtx.h | 1 -
drivers/net/mlx5/hws/mlx5dr_internal.h | 1 -
drivers/net/mlx5/linux/mlx5_verbs.c | 1 -
drivers/net/mlx5/mlx5.h | 2 +-
drivers/net/mlx5/mlx5_devx.c | 1 -
drivers/net/mlx5/mlx5_flow.c | 2 +-
drivers/net/mlx5/mlx5_flow.h | 2 +-
drivers/net/mlx5/mlx5_flow_dv.c | 1 -
drivers/net/mlx5/mlx5_flow_verbs.c | 2 +-
drivers/net/mlx5/mlx5_rx.h | 1 -
drivers/net/mlx5/mlx5_rxq.c | 2 +-
drivers/net/mlx5/mlx5_rxtx.h | 1 -
drivers/net/mlx5/mlx5_tx.h | 1 -
drivers/net/mvpp2/mrvl_mtr.c | 8 +-
drivers/net/nfp/nfp_mtr.c | 12 +-
drivers/net/nfp/nfp_mtr.h | 1 +
drivers/net/ngbe/ngbe_ethdev_vf.c | 1 -
drivers/net/ngbe/ngbe_rxtx.c | 1 -
drivers/net/ntnic/ntnic_ethdev.c | 3 -
drivers/net/qede/qede_ethdev.h | 3 +-
drivers/net/qede/qede_filter.c | 6 -
drivers/net/sfc/sfc_dp.c | 2 +-
drivers/net/sfc/sfc_dp.h | 1 -
.../net/softnic/rte_eth_softnic_internals.h | 1 -
drivers/net/tap/rte_eth_tap.h | 1 -
drivers/net/tap/tap_flow.c | 1 -
drivers/net/thunderx/base/nicvf_bsvf.h | 2 +-
drivers/net/thunderx/base/nicvf_plat.h | 1 +
drivers/net/thunderx/nicvf_ethdev.c | 1 -
drivers/net/txgbe/txgbe_ethdev_vf.c | 1 -
drivers/net/txgbe/txgbe_fdir.c | 2 +-
drivers/net/txgbe/txgbe_flow.c | 2 +-
drivers/net/txgbe/txgbe_rxtx.c | 1 -
drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 -
drivers/net/vmxnet3/vmxnet3_rxtx.c | 1 -
drivers/net/zxdh/zxdh_mtr.h | 1 -
drivers/raw/ifpga/base/ifpga_enumerate.c | 6 +-
drivers/raw/ifpga/base/opae_hw_api.h | 1 -
drivers/raw/ifpga/base/opae_intel_max10.c | 8 +-
.../raw/ifpga/base/osdep_rte/osdep_generic.h | 1 +
drivers/vdpa/mlx5/mlx5_vdpa.h | 3 +-
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 | 1 -
examples/cmdline/parse_obj_list.h | 2 +-
examples/flow_filtering/main.c | 1 -
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 | 1 -
examples/l2fwd-keepalive/ka-agent/main.c | 1 -
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 | 1 -
examples/l3fwd/l3fwd_lpm.c | 1 -
examples/l3fwd/main.c | 2 +-
examples/link_status_interrupt/main.c | 2 +-
.../client_server_mp/mp_client/client.c | 1 -
.../client_server_mp/mp_server/init.c | 1 -
.../client_server_mp/mp_server/main.c | 2 +-
examples/multi_process/hotplug_mp/main.c | 1 -
examples/multi_process/simple_mp/main.c | 2 +-
examples/multi_process/symmetric_mp/main.c | 2 +-
examples/server_node_efd/efd_node/node.c | 1 -
examples/server_node_efd/efd_server/init.c | 1 -
examples/server_node_efd/efd_server/main.c | 1 -
examples/service_cores/main.c | 1 -
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 | 1 -
lib/bbdev/rte_bbdev.c | 2 +-
lib/bpf/bpf_load_elf.c | 1 -
lib/bpf/bpf_pkt.c | 3 +-
lib/cryptodev/cryptodev_pmd.c | 1 -
lib/cryptodev/rte_cryptodev.c | 1 -
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_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_elem.h | 1 +
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 | 10 -
lib/eal/include/dev_driver.h | 1 +
lib/eal/include/meson.build | 1 +
.../sys/queue.h => include/rte_bsd_queue.h} | 670 ++++++++++++------
lib/eal/include/rte_class.h | 1 +
lib/eal/include/rte_devargs.h | 1 +
lib/eal/include/rte_tailq.h | 10 +
lib/eal/linux/eal_alarm.c | 2 +-
lib/eal/linux/eal_interrupts.c | 2 +-
lib/eal/linux/include/rte_os.h | 3 +-
lib/eal/windows/eal_alarm.c | 2 +-
lib/eal/windows/include/rte_os.h | 27 -
lib/efd/rte_efd.c | 1 -
lib/ethdev/ethdev_private.h | 3 +-
lib/ethdev/rte_ethdev.c | 2 +-
lib/fib/rte_fib.c | 1 -
lib/fib/rte_fib6.c | 1 -
lib/gpudev/gpudev_driver.h | 1 -
lib/graph/graph_private.h | 1 -
lib/hash/rte_cuckoo_hash.c | 1 -
lib/hash/rte_fbk_hash.c | 1 -
lib/hash/rte_thash.c | 1 -
lib/ip_frag/ip_frag_common.h | 3 +-
lib/log/log.c | 2 +-
lib/lpm/rte_lpm.c | 1 -
lib/lpm/rte_lpm6.c | 1 -
lib/mbuf/rte_mbuf_dyn.c | 1 -
lib/mempool/rte_mempool.c | 1 -
lib/mempool/rte_mempool.h | 1 +
lib/pipeline/rte_swx_ctl.c | 1 -
lib/pipeline/rte_swx_pipeline_internal.h | 3 +-
lib/pmu/pmu.c | 1 -
lib/reorder/rte_reorder.c | 1 -
lib/rib/rte_rib.c | 1 -
lib/rib/rte_rib6.c | 1 -
lib/ring/rte_ring.c | 1 -
lib/stack/rte_stack.c | 1 -
lib/vhost/fd_man.h | 1 -
lib/vhost/socket.c | 2 +-
lib/vhost/vdpa.c | 2 -
lib/vhost/vhost.h | 2 +-
298 files changed, 602 insertions(+), 616 deletions(-)
rename lib/eal/{windows/include/sys/queue.h => include/rte_bsd_queue.h} (52%)Signature · 1 line
2.47.2
PATCH v2 1/43 net/nfp: fix use after free
The code to cleanup metering was using the objects after calling rte_free(). Fix by using LISTFOREACH_SAFE
--- drivers/net/nfp/nfp_mtr.c | 19 +++++++++++++------ 1 file changed, 13 insertions(+), 6 deletions(-)
drivers/net/nfp/nfp_mtr.c +13 -6
@@ -12,6 +12,13 @@#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
@@ -1124,10 +1131,10 @@ nfp_mtr_priv_init(struct nfp_pf_dev *pf_dev)void nfp_mtr_priv_uninit (struct nfp_pf_dev *pf_dev) { -struct nfp_mtr *mtr; +struct nfp_mtr *mtr, *tmp_mtr;struct nfp_mtr_priv *priv; -struct nfp_mtr_policy *mtr_policy; -struct nfp_mtr_profile *mtr_profile; +struct nfp_mtr_policy *mtr_policy, *tmp_policy; +struct nfp_mtr_profile *mtr_profile, *tmp_profile;struct nfp_app_fw_flower *app_fw_flower; app_fw_flower =NFP_PRIV_TO_APP_FW_FLOWER (pf_dev->app_fw_priv);
@@ -1135,17 +1142,17 @@ nfp_mtr_priv_uninit(struct nfp_pf_dev *pf_dev)rte_eal_alarm_cancel (nfp_mtr_stats_request, (void *)app_fw_flower); - LIST_FOREACH(mtr, &priv->mtrs, next) { + LIST_FOREACH_SAFE(mtr, &priv->mtrs, next, tmp_mtr) {LIST_REMOVE (mtr, next);rte_free (mtr); } - LIST_FOREACH(mtr_profile, &priv->profiles, next) { + LIST_FOREACH_SAFE(mtr_profile, &priv->profiles, next, tmp_profile) {LIST_REMOVE (mtr_profile, next);rte_free (mtr_profile); } - LIST_FOREACH(mtr_policy, &priv->policies, next) { + LIST_FOREACH_SAFE(mtr_policy, &priv->policies, next, tmp_policy) {LIST_REMOVE (mtr_policy, next);rte_free (mtr_policy); }
Signature · 1 line
2.47.2
PATCH v2 2/43 eal: add BSD version of queue.h
In reply to Stephen HemmingerThe version of sys/queue.h on Linux from glibc was derived from an older version of BSD and is missing several key macros such as LIST_FOREACH_SAFE. This leads to drivers re-implementing the macros (sometimes badly) and other bugs.
Introduce a version of queue.h derived from the current FreeBSD.
--- doc/guides/contributing/coding_style.rst | 4 +- doc/guides/rel_notes/release_25_11.rst | 3 + lib/eal/common/eal_common_bus.c | 2 +- lib/eal/common/eal_common_class.c | 2 +- lib/eal/common/eal_common_dev.c | 2 +- lib/eal/common/eal_common_tailqs.c | 2 +- lib/eal/common/eal_common_trace.c | 2 +- lib/eal/common/eal_private.h | 2 +- lib/eal/common/malloc_elem.c | 2 +- lib/eal/common/malloc_elem.h | 1 + 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 | 10 - lib/eal/include/dev_driver.h | 1 + lib/eal/include/meson.build | 1 + lib/eal/include/rte_bsd_queue.h | 1062 ++++++++++++++++++++++ lib/eal/include/rte_class.h | 1 + lib/eal/include/rte_devargs.h | 1 + lib/eal/include/rte_tailq.h | 10 + lib/eal/linux/eal_alarm.c | 2 +- lib/eal/linux/eal_interrupts.c | 2 +- lib/eal/linux/include/rte_os.h | 3 +- lib/eal/windows/eal_alarm.c | 2 +- lib/eal/windows/include/rte_os.h | 27 - 28 files changed, 1100 insertions(+), 56 deletions(-) create mode 100644 lib/eal/include/rte_bsd_queue.h
doc/guides/contributing/coding_style.rst +2 -2
@@ -324,12 +324,12 @@ Structure Declarations Queues ~~~~~~ -Use queue(3) macros rather than rolling your own lists, whenever possible. +Use queue(3) macros defined in <rte_queue.h> rather than rolling your own lists. 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. */
doc/guides/rel_notes/release_25_11.rst +3 -0
@@ -55,6 +55,9 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* Added ``rte_queue.h`` which is clone of BSD queue.h header that is + portable across all OS's. + Removed Items -------------
lib/eal/common/eal_common_bus.c +1 -1
@@ -4,8 +4,8 @@#include <stdio.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <bus_driver.h> #include <rte_debug.h> #include <rte_string_fns.h>
lib/eal/common/eal_common_class.c +1 -1
@@ -4,8 +4,8 @@#include <stdio.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_class.h> #include <rte_debug.h>
lib/eal/common/eal_common_dev.c +1 -1
@@ -6,8 +6,8 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <bus_driver.h> #include <rte_class.h> #include <dev_driver.h>
lib/eal/common/eal_common_tailqs.c +1 -1
@@ -2,10 +2,10 @@* Copyright(c) 2010-2014 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <string.h> +#include <rte_bsd_queue.h> #include <rte_eal.h> #include <rte_eal_memconfig.h> #include <rte_log.h>
lib/eal/common/eal_common_trace.c +1 -1
@@ -5,9 +5,9 @@#include <stdlib.h> #include <fnmatch.h> #include <pthread.h> -#include <sys/queue.h> #include <regex.h> +#include <rte_bsd_queue.h> #include <rte_common.h> #include <rte_errno.h> #include <rte_lcore.h>
lib/eal/common/eal_private.h +1 -1
@@ -8,12 +8,12 @@#include <stdbool.h> #include <stdint.h> #include <stdio.h> -#include <sys/queue.h> #include <dev_driver.h> #include <rte_lcore.h> #include <rte_log.h> #include <rte_memory.h> +#include <rte_tailq.h> #include "eal_internal_cfg.h"
lib/eal/common/malloc_elem.c +1 -1
@@ -6,8 +6,8 @@#include <stddef.h> #include <stdio.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_memory.h> #include <rte_eal.h> #include <rte_common.h>
lib/eal/common/malloc_elem.h +1 -0
@@ -8,6 +8,7 @@#include <stdbool.h> #include <rte_common.h> +#include <rte_bsd_queue.h> #define MIN_DATA_SIZE (RTE_CACHE_LINE_SIZE)
lib/eal/common/malloc_heap.c +1 -1
@@ -6,8 +6,8 @@#include <stdlib.h> #include <stdio.h> #include <errno.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_memory.h> #include <rte_errno.h> #include <rte_eal.h>
lib/eal/common/malloc_heap.h +1 -1
@@ -6,8 +6,8 @@#define MALLOC_HEAP_H_ #include <stdbool.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_malloc.h> #include <rte_spinlock.h>
lib/eal/common/rte_malloc.c +1 -1
@@ -6,8 +6,8 @@#include <stddef.h> #include <stdio.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_errno.h> #include <rte_memcpy.h> #include <rte_memory.h>
lib/eal/freebsd/eal.c +1 -1
@@ -17,9 +17,9 @@#include <errno.h> #include <limits.h> #include <sys/mman.h> -#include <sys/queue.h> #include <sys/stat.h> +#include <rte_bsd_queue.h> #include <rte_common.h> #include <rte_debug.h> #include <rte_memory.h>
lib/eal/freebsd/eal_interrupts.c +1 -1
@@ -5,9 +5,9 @@#include <string.h> #include <sys/types.h> #include <sys/event.h> -#include <sys/queue.h> #include <unistd.h> +#include <rte_bsd_queue.h> #include <eal_export.h> #include <eal_trace_internal.h> #include <rte_errno.h>
lib/eal/freebsd/eal_thread.c +1 -1
@@ -9,9 +9,9 @@#include <unistd.h> #include <sched.h> #include <pthread_np.h> -#include <sys/queue.h> #include <sys/thr.h> +#include <rte_bsd_queue.h> #include <rte_debug.h> #include <rte_atomic.h> #include <rte_launch.h>
lib/eal/freebsd/include/rte_os.h +0 -10
@@ -12,16 +12,6 @@#include <pthread_np.h> #include <stdlib.h> /* Declares alloca() */ -#include <sys/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
lib/eal/include/dev_driver.h +1 -0
@@ -7,6 +7,7 @@#include <rte_common.h> #include <rte_dev.h> +#include <rte_tailq.h> /** * A structure describing a device driver.
lib/eal/include/meson.build +1 -0
@@ -38,6 +38,7 @@ headers += files( 'rte_pci_dev_features.h', 'rte_per_lcore.h', 'rte_pflock.h', + 'rte_bsd_queue.h', 'rte_random.h', 'rte_reciprocal.h', 'rte_seqcount.h',
lib/eal/include/rte_bsd_queue.h new file +1062 -0
1,062 lines not on this page · raw message
lib/eal/include/rte_class.h +1 -0
@@ -18,6 +18,7 @@* cryptographic co-processor (crypto), etc. */ +#include <rte_tailq.h> #include <rte_dev.h> #ifdef __cplusplus
lib/eal/include/rte_devargs.h +1 -0
@@ -19,6 +19,7 @@#include <stdio.h> #include <rte_dev.h> +#include <rte_tailq.h> #ifdef __cplusplusextern "C" {
lib/eal/include/rte_tailq.h +10 -0
@@ -13,6 +13,16 @@#include <stdio.h> #include <rte_debug.h> +#include <rte_bsd_queue.h> + +#define RTE_TAILQ_HEAD (name, type) TAILQ_HEAD(name, type) +#define RTE_TAILQ_ENTRY (type) TAILQ_ENTRY(type) +#define RTE_TAILQ_FOREACH (var, head, field) TAILQ_FOREACH(var, head, field) +#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 __cplusplusextern "C" {#endif
lib/eal/linux/eal_alarm.c +1 -1
@@ -6,10 +6,10 @@#include <stdlib.h> #include <errno.h> #include <pthread.h> -#include <sys/queue.h> #include <sys/time.h> #include <sys/timerfd.h> +#include <rte_bsd_queue.h> #include <eal_export.h> #include <eal_trace_internal.h> #include <rte_interrupts.h>
lib/eal/linux/eal_interrupts.c +1 -1
@@ -5,7 +5,6 @@#include <stdio.h> #include <stdint.h> #include <stdlib.h> -#include <sys/queue.h> #include <unistd.h> #include <string.h> #include <errno.h>
@@ -15,6 +14,7 @@#include <assert.h> #include <stdbool.h> +#include <rte_bsd_queue.h> #include <eal_export.h> #include <eal_trace_internal.h> #include <rte_common.h>
lib/eal/linux/include/rte_os.h +2 -1
@@ -12,7 +12,8 @@#include <alloca.h> #include <sched.h> -#include <sys/queue.h> + +#include <rte_bsd_queue.h> /* These macros are compatible with system's sys/queue.h. */ #define RTE_TAILQ_HEAD (name, type) TAILQ_HEAD(name, type)
lib/eal/windows/eal_alarm.c +1 -1
@@ -4,8 +4,8 @@#include <stdatomic.h> #include <stdbool.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <eal_export.h> #include <rte_alarm.h> #include <rte_spinlock.h>
lib/eal/windows/include/rte_os.h +0 -27
@@ -17,33 +17,6 @@#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; \ -} -/* cpu_set macros implementation */ #define RTE_CPU_AND (dst, src1, src2) CPU_AND(dst, src1, src2)#define RTE_CPU_OR (dst, src1, src2) CPU_OR(dst, src1, src2)
Signature · 1 line
2.47.2
Re: [PATCH v2 02/43] eal: add BSD version of queue.h
Quoted 7 lines · Stephen Hemminger
The version of
sys/queue.hon Linux from glibc was derived from an older version of BSD and is missing several key macros such asLIST_FOREACH_SAFE. This leads to drivers re-implementing the macros (sometimes badly) and other bugs.
Introduce a version ofqueue.hderived from the current FreeBSD.Signed-off-by Stephen Hemminger <[email protected]>
...
doc/guides/contributing/coding_style.rst Structure Declarations · line 327
Quoted 11 lines
doc/guides/contributing/coding_style.rst +1
-1@@ -324,12 +324,12 @@ Structure Declarations Queues ~~~~~~ -Use queue(3) macros rather than rolling your own lists, whenever possible. +Use queue(3) macros defined in <rte_queue.h> rather than rolling your own lists.
rte_queue.h -> rte_bsd_queue.h
doc/guides/contributing/coding_style.rst Structure Declarations · line 332
Quoted 6 lines
doc/guides/contributing/coding_style.rst +1
-1Thus, the previous example would be better written: .. code-block:: c - #include <sys/queue.h> + #include <rte_queue.h>
rte_queue.h -> rte_bsd_queue.h
doc/guides/rel_notes/release_25_11.rst New Features · line 59
Quoted 13 lines
doc/guides/contributing/coding_style.rst +0
-0struct foo { LIST_ENTRY(foo) link; /* Use queue macros for foo lists. */doc/guides/rel_notes/release_25_11.rst +2
-0@@ -55,6 +55,9 @@ New Features Also, make sure to start the actual text at the margin. ======================================================= +* Added ``rte_queue.h`` which is clone of BSD queue.h header that is + portable across all OS's.
rte_queue.h -> rte_bsd_queue.h
...
PATCH v2 3/43 test: remove unnecessary inclusion of sys/queue.h
In reply to Stephen HemmingerThose macros are not directly in most of the test code. Replace with rte_bsd_queue.h
--- app/test/commands.c | 2 +- app/test/test.c | 1 - app/test/test.h | 2 +- app/test/test_atomic.c | 1 - app/test/test_cmdline_lib.c | 1 - app/test/test_func_reentrancy.c | 1 - app/test/test_hash.c | 1 - app/test/test_hash_functions.c | 1 - app/test/test_link_bonding.c | 1 - app/test/test_link_bonding_mode4.c | 1 - app/test/test_link_bonding_rssconf.c | 1 - app/test/test_logs.c | 1 - app/test/test_malloc.c | 1 - app/test/test_mbuf.c | 1 - app/test/test_mcslock.c | 1 - app/test/test_mempool.c | 1 - app/test/test_mempool_perf.c | 1 - app/test/test_memzone.c | 1 - app/test/test_mp_secondary.c | 1 - app/test/test_per_lcore.c | 1 - app/test/test_pflock.c | 1 - app/test/test_ring.c | 1 - app/test/test_rwlock.c | 1 - app/test/test_soring.c | 1 - app/test/test_spinlock.c | 1 - app/test/test_tailq.c | 1 - app/test/test_ticketlock.c | 1 - app/test/test_timer.c | 1 - 28 files changed, 2 insertions(+), 28 deletions(-)
app/test/commands.c +1 -1
@@ -10,8 +10,8 @@#include <stdlib.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_common.h> #include <rte_log.h> #include <rte_debug.h>
app/test/test.c +0 -1
@@ -9,7 +9,6 @@#include <stdlib.h> #include <errno.h> #include <ctype.h> -#include <sys/queue.h> #include <cmdline_rdline.h> #include <cmdline_parse.h>
app/test/test.h +1 -1
@@ -8,8 +8,8 @@#include <errno.h> #include <stddef.h> #include <stdlib.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_hexdump.h> #include <rte_common.h> #include <rte_os_shim.h>
app/test/test_atomic.c +0 -1
@@ -7,7 +7,6 @@#include <stdint.h> #include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <rte_memory.h> #include <rte_per_lcore.h>
app/test/test_cmdline_lib.c +0 -1
@@ -9,7 +9,6 @@#include <stdlib.h> #include <errno.h> #include <ctype.h> -#include <sys/queue.h> #include <rte_common.h>
app/test/test_func_reentrancy.c +0 -1
@@ -9,7 +9,6 @@#include <inttypes.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_log.h>
app/test/test_hash.c +0 -1
@@ -8,7 +8,6 @@#include <stdlib.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_malloc.h>
app/test/test_hash_functions.c +0 -1
@@ -8,7 +8,6 @@#include <stdlib.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <rte_cycles.h> #include <rte_random.h>
app/test/test_link_bonding.c +0 -1
@@ -11,7 +11,6 @@#include <inttypes.h> #include <errno.h> #include <pthread.h> -#include <sys/queue.h> #include <sys/time.h> #include <rte_cycles.h>
app/test/test_link_bonding_mode4.c +0 -1
@@ -10,7 +10,6 @@#include <inttypes.h> #include <errno.h> #include <rte_cycles.h> -#include <sys/queue.h> #include <rte_byteorder.h> #include <rte_common.h>
app/test/test_link_bonding_rssconf.c +0 -1
@@ -10,7 +10,6 @@#include <inttypes.h> #include <errno.h> #include <rte_cycles.h> -#include <sys/queue.h> #include <rte_byteorder.h> #include <rte_common.h>
app/test/test_logs.c +0 -1
@@ -5,7 +5,6 @@#include <stdio.h> #include <stdint.h> #include <stdarg.h> -#include <sys/queue.h> #include <rte_log.h> #include <rte_memory.h>
app/test/test_malloc.c +0 -1
@@ -13,7 +13,6 @@#ifndef RTE_EXEC_ENV_WINDOWS #include <sys/mman.h> #endif -#include <sys/queue.h> #include <unistd.h> #include <rte_common.h>
app/test/test_mbuf.c +0 -1
@@ -12,7 +12,6 @@#include <stdint.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_errno.h>
app/test/test_mcslock.c +0 -1
@@ -7,7 +7,6 @@#include <inttypes.h> #include <string.h> #include <unistd.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_memory.h>
app/test/test_mempool.c +0 -1
@@ -9,7 +9,6 @@#include <inttypes.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_eal_paging.h>
app/test/test_mempool_perf.c +0 -1
@@ -10,7 +10,6 @@#include <inttypes.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_log.h>
app/test/test_memzone.c +0 -1
@@ -6,7 +6,6 @@#include <stdint.h> #include <string.h> #include <inttypes.h> -#include <sys/queue.h> #include <rte_random.h> #include <rte_cycles.h>
app/test/test_mp_secondary.c +0 -1
@@ -10,7 +10,6 @@#include <stdlib.h> #include <stdarg.h> #include <inttypes.h> -#include <sys/queue.h> #include <errno.h> #include <string.h> #include <unistd.h>
app/test/test_per_lcore.c +0 -1
@@ -4,7 +4,6 @@#include <stdio.h> #include <stdint.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_memory.h>
app/test/test_pflock.c +0 -1
@@ -6,7 +6,6 @@#include <stdint.h> #include <inttypes.h> #include <unistd.h> -#include <sys/queue.h> #include <string.h> #include <rte_common.h>
app/test/test_ring.c +0 -1
@@ -10,7 +10,6 @@#include <stdint.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_log.h>
app/test/test_rwlock.c +0 -1
@@ -6,7 +6,6 @@#include <stdint.h> #include <inttypes.h> #include <unistd.h> -#include <sys/queue.h> #include <string.h> #include <rte_common.h>
app/test/test_soring.c +0 -1
@@ -9,7 +9,6 @@#include <stdint.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_log.h>
app/test/test_spinlock.c +0 -1
@@ -7,7 +7,6 @@#include <inttypes.h> #include <string.h> #include <unistd.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_memory.h>
app/test/test_tailq.c +0 -1
@@ -7,7 +7,6 @@#include <stdarg.h> #include <string.h> #include <errno.h> -#include <sys/queue.h> #include <rte_eal.h> #include <rte_string_fns.h>
app/test/test_ticketlock.c +0 -1
@@ -6,7 +6,6 @@#include <stdint.h> #include <stdio.h> #include <string.h> -#include <sys/queue.h> #include <unistd.h> #include <rte_common.h>
app/test/test_timer.c +0 -1
@@ -91,7 +91,6 @@#include <stdlib.h> #include <stdint.h> #include <inttypes.h> -#include <sys/queue.h> #include <math.h> #include <rte_common.h>
Signature · 1 line
2.47.2
Re: [PATCH v2 03/43] test: remove unnecessary inclusion of sys/queue.h
Quoted 4 lines · Stephen Hemminger
Those macros are not directly in most of the test code. Replace with
rte_bsd_queue.hSigned-off-by Stephen Hemminger <[email protected]>
Nice cleanup since include is not really required in the most of these cases. Thanks.
PATCH v2 4/43 test-pipeline: remove unnecessary use of sys/queue.h
In reply to Stephen HemmingerNot used directly here
--- app/test-pipeline/config.c | 1 - app/test-pipeline/init.c | 1 - app/test-pipeline/main.c | 1 - app/test-pipeline/runtime.c | 1 - 4 files changed, 4 deletions(-)
app/test-pipeline/config.c +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
app/test-pipeline/init.c +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
app/test-pipeline/main.c +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> #include <stdarg.h> #include <signal.h> #include <errno.h>
app/test-pipeline/runtime.c +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
Signature · 1 line
2.47.2
PATCH v2 5/43 test-eventdev: use rte_bsd_queue.h
In reply to Stephen HemmingerUse the replacement rte_bsd_queue.h header instead
--- app/test-eventdev/evt_test.c | 2 +- app/test-eventdev/evt_test.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
app/test-eventdev/evt_test.c +1 -1
@@ -4,8 +4,8 @@#include <stdio.h> #include <unistd.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include "evt_test.h" static STAILQ_HEAD(, evt_test_entry) head = STAILQ_HEAD_INITIALIZER(head);
app/test-eventdev/evt_test.h +0 -1
@@ -7,7 +7,6 @@#include <string.h> #include <stdbool.h> -#include <sys/queue.h> #include <rte_eal.h>
Signature · 1 line
2.47.2
PATCH v2 6/43 test-bbdev, test-cmdline, test-mldev: don't use sys/queue.h
In reply to Stephen HemmingerNo need for direct inclusion here.
--- app/test-bbdev/main.h | 1 - app/test-cmdline/cmdline_test.c | 1 - app/test-mldev/ml_test.h | 1 - 3 files changed, 3 deletions(-)
app/test-bbdev/main.h +0 -1
@@ -6,7 +6,6 @@#define _MAIN_H_#include <stddef.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_hexdump.h>
app/test-cmdline/cmdline_test.c +0 -1
@@ -10,7 +10,6 @@#include <errno.h> #include <termios.h> #include <ctype.h> -#include <sys/queue.h> #include <rte_common.h>
app/test-mldev/ml_test.h +0 -1
@@ -8,7 +8,6 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/queue.h> #include <rte_common.h>
Signature · 1 line
2.47.2
PATCH v2 7/43 app/testpmd: use rte_bsd_queue.h
In reply to Stephen HemmingerOnly include the definition of LIST, TAILQ, etc where needed.
--- app/test-pmd/5tswap.c | 2 -- app/test-pmd/cmdline.c | 2 +- app/test-pmd/config.c | 2 +- app/test-pmd/csumonly.c | 1 - app/test-pmd/flowgen.c | 1 - app/test-pmd/hairpin.c | 1 - app/test-pmd/icmpecho.c | 1 - app/test-pmd/iofwd.c | 1 - app/test-pmd/macfwd.c | 1 - app/test-pmd/macswap.c | 1 - app/test-pmd/noisy_vnf.c | 1 - app/test-pmd/parameters.c | 1 - app/test-pmd/rxonly.c | 1 - app/test-pmd/testpmd.c | 1 - app/test-pmd/testpmd.h | 2 +- app/test-pmd/txonly.c | 1 - 16 files changed, 3 insertions(+), 17 deletions(-)
app/test-pmd/5tswap.c +0 -2
@@ -7,8 +7,6 @@#include <stdint.h> #include <unistd.h> #include <inttypes.h> - -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/cmdline.c +1 -1
@@ -13,8 +13,8 @@#include <string.h> #include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_common.h> #include <rte_byteorder.h> #include <rte_log.h>
app/test-pmd/config.c +1 -1
@@ -13,7 +13,7 @@#include <stdint.h> #include <inttypes.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <sys/types.h> #include <sys/stat.h> #include <fcntl.h>
app/test-pmd/csumonly.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/flowgen.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/hairpin.c +0 -1
@@ -8,7 +8,6 @@#include <stdbool.h> #include <stdint.h> -#include <sys/queue.h> #include "testpmd.h"
app/test-pmd/icmpecho.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/iofwd.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/macfwd.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/macswap.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/noisy_vnf.c +0 -1
@@ -12,7 +12,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/parameters.c +0 -1
@@ -13,7 +13,6 @@#include <fcntl.h> #include <sys/types.h> -#include <sys/queue.h> #include <sys/stat.h> #include <stdint.h>
app/test-pmd/rxonly.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
app/test-pmd/testpmd.c +0 -1
@@ -16,7 +16,6 @@#include <errno.h> #include <stdbool.h> -#include <sys/queue.h> #include <sys/stat.h> #include <stdint.h>
app/test-pmd/testpmd.h +1 -1
@@ -21,7 +21,7 @@#include <cmdline.h> #include <cmdline_parse.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #ifdef RTE_HAS_JANSSON #include <jansson.h> #endif
app/test-pmd/txonly.c +0 -1
@@ -10,7 +10,6 @@#include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <sys/stat.h> #include <rte_common.h>
Signature · 1 line
2.47.2
PATCH v2 8/43 apps: use rte_bsd_queue.h
In reply to Stephen HemmingerUse DPDK not system version.
Not really a requirement but better to avoid any possible conflict.
--- app/dumpcap/main.c | 2 +- app/proc-info/main.c | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
app/dumpcap/main.c +1 -1
@@ -17,12 +17,12 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/queue.h> #include <sys/types.h> #include <sys/utsname.h> #include <time.h> #include <unistd.h> +#include <rte_bsd_queue.h> #include <rte_alarm.h> #include <rte_bitops.h> #include <rte_bpf.h>
app/proc-info/main.c +0 -1
@@ -9,7 +9,6 @@#include <errno.h> #include <stdarg.h> #include <inttypes.h> -#include <sys/queue.h> #include <stdlib.h> #include <getopt.h> #include <unistd.h>
Signature · 1 line
2.47.2
PATCH v2 9/43 examples: replace use of sys/queue.h
In reply to Stephen HemmingerWhere macros are actually used directly include rte_bsd_queue.h. Most places were just copying some other file and doing unnecessary include of sys/queue.h
--- examples/bbdev_app/main.c | 2 +- examples/bond/main.c | 2 +- examples/cmdline/main.c | 1 - examples/cmdline/parse_obj_list.h | 2 +- examples/flow_filtering/main.c | 1 - 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 | 1 - examples/l2fwd-keepalive/ka-agent/main.c | 1 - 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 | 1 - examples/l3fwd/l3fwd_lpm.c | 1 - examples/l3fwd/main.c | 2 +- examples/link_status_interrupt/main.c | 2 +- examples/multi_process/client_server_mp/mp_client/client.c | 1 - examples/multi_process/client_server_mp/mp_server/init.c | 1 - examples/multi_process/client_server_mp/mp_server/main.c | 2 +- examples/multi_process/hotplug_mp/main.c | 1 - examples/multi_process/simple_mp/main.c | 2 +- examples/multi_process/symmetric_mp/main.c | 2 +- examples/server_node_efd/efd_node/node.c | 1 - examples/server_node_efd/efd_server/init.c | 1 - examples/server_node_efd/efd_server/main.c | 1 - examples/service_cores/main.c | 1 - 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 +- 47 files changed, 34 insertions(+), 47 deletions(-)
examples/bbdev_app/main.c +1 -1
@@ -10,7 +10,7 @@#include <inttypes.h> #include <sys/types.h> #include <unistd.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdarg.h> #include <ctype.h> #include <errno.h>
examples/bond/main.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <sys/socket.h> #include <stdlib.h> #include <string.h>
examples/cmdline/main.c +0 -1
@@ -8,7 +8,6 @@#include <string.h> #include <stdint.h> #include <errno.h> -#include <sys/queue.h> #include <cmdline_rdline.h> #include <cmdline_parse.h>
examples/cmdline/parse_obj_list.h +1 -1
@@ -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_bsd_queue.h> #include <cmdline_parse.h> #include <cmdline_parse_string.h>
examples/flow_filtering/main.c +0 -1
@@ -8,7 +8,6 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> #include <setjmp.h> #include <stdarg.h> #include <ctype.h>
examples/helloworld/main.c +1 -1
@@ -6,7 +6,7 @@#include <string.h> #include <stdint.h> #include <errno.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_memory.h> #include <rte_launch.h>
examples/ip_fragmentation/main.c +1 -1
@@ -9,7 +9,7 @@#include <sys/types.h> #include <sys/param.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/ip_pipeline/action.h +1 -1
@@ -5,7 +5,7 @@#ifndef _INCLUDE_ACTION_H_#define _INCLUDE_ACTION_H_ -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_port_in_action.h> #include <rte_table_action.h>
examples/ip_pipeline/cryptodev.h +1 -1
@@ -6,7 +6,7 @@#define _INCLUDE_SYM_C_H_#include <stdint.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_cryptodev.h>
examples/ip_pipeline/link.h +1 -1
@@ -6,7 +6,7 @@#define _INCLUDE_LINK_H_#include <stdint.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include "common.h"
examples/ip_pipeline/mempool.h +1 -1
@@ -6,7 +6,7 @@#define _INCLUDE_MEMPOOL_H_#include <stdint.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_mempool.h>
examples/ip_pipeline/pipeline.h +1 -1
@@ -6,7 +6,7 @@#define _INCLUDE_PIPELINE_H_#include <stdint.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_pipeline.h> #include <rte_table_action.h>
examples/ip_pipeline/swq.h +1 -1
@@ -6,7 +6,7 @@#define _INCLUDE_SWQ_H_#include <stdint.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_ring.h>
examples/ip_pipeline/tap.h +1 -1
@@ -5,7 +5,7 @@#ifndef _INCLUDE_TAP_H_#define _INCLUDE_TAP_H_ -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include "common.h"
examples/ip_pipeline/tmgr.h +1 -1
@@ -6,7 +6,7 @@#define _INCLUDE_TMGR_H_#include <stdint.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_sched.h> #include <rte_red.h>
examples/ip_reassembly/main.c +1 -1
@@ -8,7 +8,7 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/ipsec-secgw/ipsec-secgw.c +1 -1
@@ -12,7 +12,7 @@#include <netinet/ip.h> #include <netinet/ip6.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdarg.h> #include <errno.h> #include <signal.h>
examples/ipv4_multicast/main.c +1 -1
@@ -8,7 +8,7 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/l2fwd-crypto/main.c +1 -1
@@ -9,7 +9,7 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <netinet/in.h> #include <setjmp.h> #include <stdarg.h>
examples/l2fwd-event/l2fwd_common.h +0 -1
@@ -11,7 +11,6 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> #include <netinet/in.h> #include <setjmp.h> #include <stdarg.h>
examples/l2fwd-keepalive/ka-agent/main.c +0 -1
@@ -9,7 +9,6 @@#include <unistd.h> #include <fcntl.h> #include <sys/wait.h> -#include <sys/queue.h> #include <sys/mman.h> #include <sys/stat.h> #include <time.h>
examples/l2fwd-keepalive/main.c +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <netinet/in.h> #include <setjmp.h> #include <stdarg.h>
examples/l2fwd-macsec/main.c +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <setjmp.h> #include <stdarg.h> #include <ctype.h>
examples/l2fwd/main.c +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <setjmp.h> #include <stdarg.h> #include <ctype.h>
examples/l3fwd-graph/main.c +1 -1
@@ -15,7 +15,7 @@#include <string.h> #include <sys/socket.h> #include <sys/types.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <unistd.h> #include <rte_branch_prediction.h>
examples/l3fwd-power/main.c +1 -1
@@ -8,7 +8,7 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/l3fwd/l3fwd_em.c +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/l3fwd/l3fwd_lpm.c +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/l3fwd/main.c +1 -1
@@ -8,7 +8,7 @@#include <inttypes.h> #include <sys/types.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdarg.h> #include <errno.h> #include <getopt.h>
examples/link_status_interrupt/main.c +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <inttypes.h> #include <sys/types.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <setjmp.h> #include <stdarg.h> #include <ctype.h>
examples/multi_process/client_server_mp/mp_client/client.c +0 -1
@@ -7,7 +7,6 @@#include <inttypes.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <stdlib.h> #include <getopt.h> #include <string.h>
examples/multi_process/client_server_mp/mp_server/init.c +0 -1
@@ -6,7 +6,6 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/queue.h> #include <errno.h> #include <stdarg.h> #include <inttypes.h>
examples/multi_process/client_server_mp/mp_server/main.c +1 -1
@@ -9,7 +9,7 @@#include <stdint.h> #include <stdarg.h> #include <inttypes.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <errno.h> #include <signal.h>
examples/multi_process/hotplug_mp/main.c +0 -1
@@ -7,7 +7,6 @@#include <stdint.h> #include <errno.h> #include <termios.h> -#include <sys/queue.h> #include <cmdline_rdline.h> #include <cmdline_parse.h>
examples/multi_process/simple_mp/main.c +1 -1
@@ -22,7 +22,7 @@#include <errno.h> #include <unistd.h> #include <termios.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_common.h> #include <rte_memory.h>
examples/multi_process/symmetric_mp/main.c +1 -1
@@ -19,7 +19,7 @@#include <stdlib.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <getopt.h> #include <signal.h> #include <inttypes.h>
examples/server_node_efd/efd_node/node.c +0 -1
@@ -7,7 +7,6 @@#include <inttypes.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> #include <stdlib.h> #include <getopt.h> #include <string.h>
examples/server_node_efd/efd_server/init.c +0 -1
@@ -6,7 +6,6 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/queue.h> #include <errno.h> #include <stdarg.h> #include <inttypes.h>
examples/server_node_efd/efd_server/main.c +0 -1
@@ -9,7 +9,6 @@#include <stdint.h> #include <stdarg.h> #include <inttypes.h> -#include <sys/queue.h> #include <errno.h> #include <sys/types.h> #include <netinet/in.h>
examples/service_cores/main.c +0 -1
@@ -7,7 +7,6 @@#include <string.h> #include <stdint.h> #include <errno.h> -#include <sys/queue.h> #include <rte_memory.h> #include <rte_launch.h>
examples/timer/main.c +1 -1
@@ -6,7 +6,7 @@#include <string.h> #include <stdint.h> #include <errno.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_common.h> #include <rte_memory.h>
examples/vhost/main.h +1 -1
@@ -5,7 +5,7 @@#ifndef _MAIN_H_#define _MAIN_H_ -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_ether.h> #include <rte_pci.h>
examples/vm_power_manager/channel_manager.c +1 -1
@@ -10,7 +10,7 @@#include <dirent.h> #include <errno.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <sys/types.h> #include <sys/stat.h> #include <sys/socket.h>
examples/vm_power_manager/channel_monitor.c +1 -1
@@ -13,7 +13,7 @@#include <fcntl.h> #include <sys/types.h> #include <sys/epoll.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <sys/time.h> #include <sys/socket.h> #include <sys/select.h>
examples/vm_power_manager/main.c +1 -1
@@ -12,7 +12,7 @@#include <signal.h> #include <errno.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_common.h> #include <rte_eal.h>
examples/vmdq/main.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdlib.h> #include <string.h> #include <stdio.h>
examples/vmdq_dcb/main.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdint.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdlib.h> #include <string.h> #include <stdio.h>
Signature · 1 line
2.47.2
PATCH v2 10/43 ethdev: replace use of sys/queue.h
In reply to Stephen HemmingerUse rte_bsd_queue.h instead.
--- lib/ethdev/ethdev_private.h | 3 +-- lib/ethdev/rte_ethdev.c | 2 +- 2 files changed, 2 insertions(+), 3 deletions(-)
lib/ethdev/ethdev_private.h +1 -2
@@ -5,8 +5,7 @@#ifndef _ETH_PRIVATE_H_#define _ETH_PRIVATE_H_ -#include <sys/queue.h> - +#include <rte_bsd_queue.h> #include <rte_eal_memconfig.h> #include <rte_malloc.h> #include <rte_os_shim.h>
lib/ethdev/rte_ethdev.c +1 -1
@@ -9,8 +9,8 @@#include <stdio.h> #include <stdlib.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <bus_driver.h> #include <eal_export.h> #include <rte_log.h>
Signature · 1 line
2.47.2
Re: [PATCH v2 10/43] ethdev: replace use of sys/queue.h
Quoted 3 lines · Stephen Hemminger
Use
rte_bsd_queue.hinstead.Signed-off-by Stephen Hemminger <[email protected]>
PATCH v2 11/43 lib: remove use of sys/queue.h
In reply to Stephen HemmingerUse the new rte_bsd_queue.h where needed but most files already get the needed macros from rte_tailq.h
--- lib/acl/rte_acl_osdep.h | 1 - lib/bbdev/rte_bbdev.c | 2 +- lib/bpf/bpf_load_elf.c | 1 - lib/bpf/bpf_pkt.c | 3 +-- lib/cryptodev/cryptodev_pmd.c | 1 - lib/cryptodev/rte_cryptodev.c | 1 - lib/distributor/rte_distributor.c | 2 +- lib/distributor/rte_distributor_single.c | 2 +- lib/efd/rte_efd.c | 1 - lib/fib/rte_fib.c | 1 - lib/fib/rte_fib6.c | 1 - lib/gpudev/gpudev_driver.h | 1 - lib/graph/graph_private.h | 1 - lib/hash/rte_cuckoo_hash.c | 1 - lib/hash/rte_fbk_hash.c | 1 - lib/hash/rte_thash.c | 1 - lib/ip_frag/ip_frag_common.h | 3 +-- lib/log/log.c | 2 +- lib/lpm/rte_lpm.c | 1 - lib/lpm/rte_lpm6.c | 1 - lib/mbuf/rte_mbuf_dyn.c | 1 - lib/mempool/rte_mempool.c | 1 - lib/mempool/rte_mempool.h | 1 + lib/pipeline/rte_swx_ctl.c | 1 - lib/pipeline/rte_swx_pipeline_internal.h | 3 ++- lib/pmu/pmu.c | 1 - lib/reorder/rte_reorder.c | 1 - lib/rib/rte_rib.c | 1 - lib/rib/rte_rib6.c | 1 - lib/ring/rte_ring.c | 1 - lib/stack/rte_stack.c | 1 - lib/vhost/fd_man.h | 1 - lib/vhost/socket.c | 2 +- lib/vhost/vdpa.c | 2 -- lib/vhost/vhost.h | 2 +- 35 files changed, 11 insertions(+), 37 deletions(-)
lib/acl/rte_acl_osdep.h +0 -1
@@ -21,7 +21,6 @@#include <stdio.h> #include <stdarg.h> #include <stdlib.h> -#include <sys/queue.h> /* * Common defines.
lib/bbdev/rte_bbdev.c +1 -1
@@ -5,8 +5,8 @@#include <stdint.h> #include <string.h> #include <stdbool.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <eal_export.h> #include <rte_common.h> #include <rte_errno.h>
lib/bpf/bpf_load_elf.c +0 -1
@@ -12,7 +12,6 @@#include <sys/types.h> #include <sys/stat.h> -#include <sys/queue.h> #include <fcntl.h> #include <libelf.h>
lib/bpf/bpf_pkt.c +1 -2
@@ -7,8 +7,7 @@#include <errno.h> #include <stdint.h> -#include <sys/queue.h> - +#include <rte_bsd_queue.h> #include <eal_export.h> #include <rte_common.h> #include <rte_malloc.h>
lib/cryptodev/cryptodev_pmd.c +0 -1
@@ -3,7 +3,6 @@*/ #include <stdlib.h> -#include <sys/queue.h> #include <dev_driver.h> #include <eal_export.h>
lib/cryptodev/rte_cryptodev.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2015-2020 Intel Corporation */ -#include <sys/queue.h> #include <ctype.h> #include <stdio.h> #include <stdlib.h>
lib/distributor/rte_distributor.c +1 -1
@@ -5,8 +5,8 @@#include <stdalign.h> #include <stdio.h> #include <stdlib.h> -#include <sys/queue.h> #include <string.h> +#include <eal_export.h> #include <rte_mbuf.h> #include <rte_cycles.h>
lib/distributor/rte_distributor_single.c +1 -1
@@ -3,7 +3,7 @@*/ #include <stdio.h> -#include <sys/queue.h> +#include <rte_mbuf.h> #include <rte_memzone.h> #include <rte_errno.h>
lib/efd/rte_efd.c +0 -1
@@ -7,7 +7,6 @@#include <stdlib.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_cpuflags.h>
lib/fib/rte_fib.c +0 -1
@@ -5,7 +5,6 @@#include <stdint.h> #include <string.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_eal_memconfig.h>
lib/fib/rte_fib6.c +0 -1
@@ -5,7 +5,6 @@#include <stdint.h> #include <string.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_eal_memconfig.h>
lib/gpudev/gpudev_driver.h +0 -1
@@ -12,7 +12,6 @@#define RTE_GPUDEV_DRIVER_H #include <stdint.h> -#include <sys/queue.h> #include <dev_driver.h>
lib/graph/graph_private.h +0 -1
@@ -6,7 +6,6 @@#define _RTE_GRAPH_PRIVATE_H_#include <inttypes.h> -#include <sys/queue.h> #include <rte_common.h> #include <rte_eal.h>
lib/hash/rte_cuckoo_hash.c +0 -1
@@ -7,7 +7,6 @@#include <stdint.h> #include <errno.h> #include <stdio.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_common.h>
lib/hash/rte_fbk_hash.c +0 -1
@@ -6,7 +6,6 @@#include <stdio.h> #include <string.h> #include <errno.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_cpuflags.h>
lib/hash/rte_thash.c +0 -1
@@ -3,7 +3,6 @@*/ #include <stdalign.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_thash.h>
lib/ip_frag/ip_frag_common.h +1 -2
@@ -5,8 +5,7 @@#ifndef _IP_FRAG_COMMON_H_#define _IP_FRAG_COMMON_H_ -#include <sys/queue.h> - +#include <rte_bsd_queue.h> #include <rte_common.h> #if defined(RTE_ARCH_ARM64 )
lib/log/log.c +1 -1
@@ -11,9 +11,9 @@#include <errno.h> #include <regex.h> #include <fnmatch.h> -#include <sys/queue.h> #include <unistd.h> +#include <rte_bsd_queue.h> #include <eal_export.h> #include <rte_common.h> #include <rte_log.h>
lib/lpm/rte_lpm.c +0 -1
@@ -7,7 +7,6 @@#include <stdint.h> #include <errno.h> #include <stdio.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_log.h>
lib/lpm/rte_lpm6.c +0 -1
@@ -6,7 +6,6 @@#include <stdint.h> #include <errno.h> #include <stdio.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_log.h>
lib/mbuf/rte_mbuf_dyn.c +0 -1
@@ -3,7 +3,6 @@*/ #include <stdalign.h> -#include <sys/queue.h> #include <stdint.h> #include <limits.h>
lib/mempool/rte_mempool.c +0 -1
@@ -12,7 +12,6 @@#include <unistd.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_common.h>
lib/mempool/rte_mempool.h +1 -0
@@ -49,6 +49,7 @@#include <rte_ring.h> #include <rte_memcpy.h> #include <rte_common.h> +#include <rte_tailq.h> #include "rte_mempool_trace_fp.h"
lib/pipeline/rte_swx_ctl.c +0 -1
@@ -5,7 +5,6 @@#include <stdlib.h> #include <string.h> #include <stdio.h> -#include <sys/queue.h> #include <unistd.h> #include <eal_export.h>
lib/pipeline/rte_swx_pipeline_internal.h +2 -1
@@ -6,7 +6,7 @@#include <inttypes.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bitops.h> #include <rte_byteorder.h>
@@ -14,6 +14,7 @@#include <rte_cycles.h> #include <rte_prefetch.h> #include <rte_meter.h> +#include <rte_tailq.h> #include <rte_swx_table_selector.h> #include <rte_swx_table_learner.h>
lib/pmu/pmu.c +0 -1
@@ -8,7 +8,6 @@#include <stdlib.h> #include <unistd.h> #include <sys/mman.h> -#include <sys/queue.h> #include <sys/ioctl.h> #include <sys/syscall.h>
lib/reorder/rte_reorder.c +0 -1
@@ -4,7 +4,6 @@#include <stdalign.h> #include <string.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_string_fns.h>
lib/rib/rte_rib.c +0 -1
@@ -5,7 +5,6 @@#include <stdbool.h> #include <stdint.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_eal_memconfig.h>
lib/rib/rte_rib6.c +0 -1
@@ -5,7 +5,6 @@#include <stdbool.h> #include <stdint.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_eal_memconfig.h>
lib/ring/rte_ring.c +0 -1
@@ -13,7 +13,6 @@#include <stdint.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_common.h>
lib/stack/rte_stack.c +0 -1
@@ -4,7 +4,6 @@#include <stdalign.h> #include <string.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_string_fns.h>
lib/vhost/fd_man.h +0 -1
@@ -6,7 +6,6 @@#define _FD_MAN_H_#include <pthread.h> #include <poll.h> -#include <sys/queue.h> struct fdset ;
lib/vhost/socket.c +1 -1
@@ -10,13 +10,13 @@#include <string.h> #include <sys/socket.h> #include <sys/un.h> -#include <sys/queue.h> #include <errno.h> #include <fcntl.h> #include <eal_export.h> #include <rte_thread.h> #include <rte_log.h> +#include <rte_tailq.h> #include "fd_man.h" #include "vduse.h"
lib/vhost/vdpa.c +0 -2
@@ -8,8 +8,6 @@* Device specific vhost lib */ -#include <sys/queue.h> -#include <dev_driver.h> #include <eal_export.h> #include <rte_class.h>
lib/vhost/vhost.h +1 -1
@@ -8,7 +8,6 @@#include <stdio.h> #include <stdbool.h> #include <stdlib.h> -#include <sys/queue.h> #include <unistd.h> #include <linux/virtio_net.h> #include <sys/socket.h>
@@ -19,6 +18,7 @@#include <rte_ether.h> #include <rte_malloc.h> #include <rte_dmadev.h> +#include <rte_tailq.h> #include "rte_vhost.h" #include "vdpa_driver.h"
Signature · 1 line
2.47.2
Re: [PATCH v2 11/43] lib: remove use of sys/queue.h
Quoted 4 lines · Stephen Hemminger
Use the new
rte_bsd_queue.hwhere needed but most files already get the needed macros fromrte_tailq.hSigned-off-by Stephen Hemminger <[email protected]>
...
lib/mbuf/rte_mbuf_dyn.c line 6
Quoted 9 lines
lib/mbuf/rte_mbuf_dyn.c +0
-1@@ -3,7 +3,6 @@*/ #include <stdalign.h> -#include <sys/queue.h>
IMHO since rte_tailq.h itself does not provide/implement TAILQ macros it is not nice to rely on indirect inclusion. I think it would be better to include rte_bsd_queue.h directly in the source file (nearby other rte headers).
lib/mempool/rte_mempool.c line 15
Quoted 12 lines
lib/mbuf/rte_mbuf_dyn.c +0
-0#include <stdint.h> #include <limits.h> lib/mempool/rte_mempool.c +0
-1@@ -12,7 +12,6 @@#include <unistd.h> #include <inttypes.h> #include <errno.h> -#include <sys/queue.h>
Same here
Quoted 3 lines
lib/mempool/rte_mempool.c +0
-0#include <eal_export.h> #include <rte_common.h>
PATCH v2 12/43 drivers/bus: replace use of sys/queue.h
In reply to Stephen HemmingerPrefer just using rte_tailq.h when TAILQ macro's are used. Other places eliminate sys/queue.h if possible.
--- drivers/bus/auxiliary/auxiliary_common.c | 2 +- drivers/bus/auxiliary/private.h | 2 +- drivers/bus/fslmc/bus_fslmc_driver.h | 1 - drivers/bus/fslmc/fslmc_vfio.c | 1 + drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 11 ++--------- drivers/bus/ifpga/ifpga_bus.c | 2 +- drivers/bus/pci/bsd/pci.c | 2 +- drivers/bus/pci/pci_common.c | 1 - drivers/bus/pci/pci_params.c | 2 -- drivers/bus/pci/windows/pci.c | 3 +-- drivers/bus/pci/windows/pci_netuio.c | 2 -- drivers/bus/platform/platform.c | 2 +- drivers/bus/vdev/vdev.c | 1 - drivers/bus/vmbus/vmbus_common.c | 1 - 14 files changed, 9 insertions(+), 24 deletions(-)
drivers/bus/auxiliary/auxiliary_common.c +1 -1
@@ -8,7 +8,7 @@#include <stdbool.h> #include <stdlib.h> #include <stdio.h> -#include <sys/queue.h> +#include <eal_export.h> #include <rte_errno.h> #include <rte_interrupts.h>
drivers/bus/auxiliary/private.h +1 -1
@@ -7,9 +7,9 @@#include <stdbool.h> #include <stdio.h> -#include <sys/queue.h> #include <bus_driver.h> +#include <rte_bsd_queue.h> #include "bus_auxiliary_driver.h"
drivers/bus/fslmc/bus_fslmc_driver.h +0 -1
@@ -17,7 +17,6 @@#include <stdlib.h> #include <limits.h> #include <errno.h> -#include <sys/queue.h> #include <stdint.h> #include <inttypes.h> #include <linux/vfio.h>
drivers/bus/fslmc/fslmc_vfio.c +1 -0
@@ -21,6 +21,7 @@#include <sys/eventfd.h> #include <ctype.h> +#include <rte_bsd_queue.h> #include <eal_export.h> #include <eal_filesystem.h> #include <rte_mbuf.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +2 -9
@@ -15,7 +15,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>
@@ -32,6 +31,7 @@#include <rte_cycles.h> #include <rte_kvargs.h> #include <dev_driver.h> +#include <rte_tailq.h> #include <fslmc_logs.h> #include <bus_fslmc_driver.h>
@@ -39,13 +39,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_LCORERTE_EXPORT_INTERNAL_SYMBOL (dpaa2_io_portal)
@@ -105,7 +98,7 @@ static struct dpaa2_dpio_dev *get_dpio_dev_from_id(int32_t dpio_id)struct dpaa2_dpio_dev *dpio_dev =NULL ;/* Get DPIO dev handle from list using index */ - TAILQ_FOREACH(dpio_dev, &dpio_dev_list, next) { + RTE_TAILQ_FOREACH(dpio_dev, &dpio_dev_list, next) {if (dpio_dev->hw_id == dpio_id)break ; }
drivers/bus/ifpga/ifpga_bus.c +1 -1
@@ -7,7 +7,6 @@#include <stdint.h> #include <stdlib.h> #include <stdio.h> -#include <sys/queue.h> #include <sys/mman.h> #include <sys/types.h> #include <unistd.h>
@@ -26,6 +25,7 @@#include <rte_alarm.h> #include <rte_string_fns.h> #include <rte_debug.h> +#include <rte_tailq.h> #include "rte_rawdev.h" #include "rte_rawdev_pmd.h"
drivers/bus/pci/bsd/pci.c +1 -1
@@ -15,7 +15,6 @@#include <errno.h> #include <dirent.h> #include <limits.h> -#include <sys/queue.h> #include <sys/mman.h> #include <sys/ioctl.h> #include <sys/pciio.h>
@@ -38,6 +37,7 @@#include <rte_string_fns.h> #include <rte_debug.h> #include <rte_devargs.h> +#include <rte_tailq.h> #include <eal_export.h> #include "eal_filesystem.h"
drivers/bus/pci/pci_common.c +0 -1
@@ -9,7 +9,6 @@#include <stdbool.h> #include <stdlib.h> #include <stdio.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_errno.h> #include <rte_interrupts.h>
drivers/bus/pci/pci_params.c +0 -2
@@ -2,8 +2,6 @@* Copyright 2018 Gaëtan Rivet */ -#include <sys/queue.h> -#include <bus_driver.h> #include <rte_bus_pci.h> #include <dev_driver.h>
drivers/bus/pci/windows/pci.c +1 -2
@@ -2,8 +2,6 @@* Copyright 2020 Mellanox Technologies, Ltd */ -#include <sys/queue.h> -#include <eal_export.h> #include <rte_windows.h> #include <rte_errno.h>
@@ -11,6 +9,7 @@#include <rte_eal.h> #include <rte_memory.h> #include <rte_bus_pci.h> +#include <rte_tailq.h> #include "private.h" #include "pci_netuio.h"
drivers/bus/pci/windows/pci_netuio.c +0 -2
@@ -2,8 +2,6 @@* Copyright(c) 2020 Intel Corporation. */ -#include <sys/queue.h> -#include <rte_windows.h> #include <rte_errno.h> #include <rte_log.h>
drivers/bus/platform/platform.c +1 -1
@@ -8,7 +8,6 @@#include <string.h> #include <sys/ioctl.h> #include <sys/mman.h> -#include <sys/queue.h> #include <unistd.h> #include <bus_driver.h>
@@ -21,6 +20,7 @@#include <rte_log.h> #include <rte_memory.h> #include <rte_string_fns.h> +#include <rte_tailq.h> #include <rte_vfio.h> #include "private.h"
drivers/bus/vdev/vdev.c +0 -1
@@ -8,7 +8,6 @@#include <stdlib.h> #include <stdint.h> #include <stdbool.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_eal.h>
drivers/bus/vmbus/vmbus_common.c +0 -1
@@ -7,7 +7,6 @@#include <unistd.h> #include <dirent.h> #include <fcntl.h> -#include <sys/queue.h> #include <sys/mman.h> #include <eal_export.h>
Signature · 1 line
2.47.2
PATCH v2 13/43 net/nfp: use rte_bsd_queue.h
In reply to Stephen HemmingerCan use common macro.
--- drivers/net/nfp/nfp_mtr.c | 7 ------- drivers/net/nfp/nfp_mtr.h | 1 + 2 files changed, 1 insertion(+), 7 deletions(-)
drivers/net/nfp/nfp_mtr.c +0 -7
@@ -12,13 +12,6 @@#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
drivers/net/nfp/nfp_mtr.h +1 -0
@@ -7,6 +7,7 @@#define __NFP_MTR_H__#include <rte_mtr.h> +#include <rte_bsd_queue.h> #include "flower/nfp_flower_cmsg.h"
Signature · 1 line
2.47.2
PATCH v2 14/43 net/qede: use rte_bsd_queue.h
In reply to Stephen HemmingerThe BSD version has the needed SLIST_FOREACH_SAFE already.
--- drivers/net/qede/qede_ethdev.h | 3 +-- drivers/net/qede/qede_filter.c | 6 ------ 2 files changed, 1 insertion(+), 8 deletions(-)
drivers/net/qede/qede_ethdev.h +1 -2
@@ -8,8 +8,7 @@#ifndef _QEDE_ETHDEV_H_#define _QEDE_ETHDEV_H_ -#include <sys/queue.h> - +#include <rte_bsd_queue.h> #include <rte_ether.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
drivers/net/qede/qede_filter.c +0 -6
@@ -12,12 +12,6 @@#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 {
Signature · 1 line
2.47.2
PATCH v2 15/43 net/bnxt: remove use of sys/queue.h
In reply to Stephen HemmingerFix unsafe use after free by using STAILQ_FOREACH_SAFE.
--- drivers/net/bnxt/bnxt.h | 1 - drivers/net/bnxt/bnxt_filter.c | 7 +++---- drivers/net/bnxt/bnxt_flow.c | 1 - drivers/net/bnxt/bnxt_vnic.h | 1 - drivers/net/bnxt/tf_ulp/bnxt_ulp.h | 1 - drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c | 1 - 6 files changed, 3 insertions(+), 9 deletions(-)
drivers/net/bnxt/bnxt.h +0 -1
@@ -9,7 +9,6 @@#include <inttypes.h> #include <stdbool.h> #include <pthread.h> -#include <sys/queue.h> #include <rte_pci.h> #include <bus_pci_driver.h>
drivers/net/bnxt/bnxt_filter.c +3 -4
@@ -3,8 +3,7 @@* All rights reserved. */ -#include <sys/queue.h> - +#include <rte_bsd_queue.h> #include <rte_byteorder.h> #include <rte_log.h> #include <rte_malloc.h>
@@ -110,7 +109,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, *tmp;uint16_t max_filters, i;int rc =0 ;
@@ -151,7 +150,7 @@ 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) { + STAILQ_FOREACH_SAFE(filter, &bp->pf->vf_info[i].filter, next, tmp) {rte_free (filter);STAILQ_REMOVE (&bp->pf->vf_info[i].filter, filter, bnxt_filter_info, next);
drivers/net/bnxt/bnxt_flow.c +0 -1
@@ -3,7 +3,6 @@* All rights reserved. */ -#include <sys/queue.h> #include <rte_log.h> #include <rte_malloc.h>
drivers/net/bnxt/bnxt_vnic.h +0 -1
@@ -6,7 +6,6 @@#ifndef _BNXT_VNIC_H_#define _BNXT_VNIC_H_ -#include <sys/queue.h> #include <stdbool.h> #include <rte_hash.h>
drivers/net/bnxt/tf_ulp/bnxt_ulp.h +0 -1
@@ -8,7 +8,6 @@#include <inttypes.h> #include <stdbool.h> -#include <sys/queue.h> #include "rte_version.h" #include "rte_ethdev.h"
drivers/net/bnxt/tf_ulp/bnxt_ulp_meter.c +0 -1
@@ -4,7 +4,6 @@*/ #include <math.h> -#include <sys/queue.h> #include <rte_log.h> #include <rte_malloc.h>
Signature · 1 line
2.47.2
PATCH v2 16/43 net/intel: remove use of sys/queue.h
In reply to Stephen HemmingerFor all the drivers, remove use of sys/queue.h if not necessary. Remove locally defined FOREACH_SAFE macros.
Use rte_bsd_queue.h instead.
--- drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c | 1 - drivers/net/intel/e1000/e1000_ethdev.h | 1 - drivers/net/intel/e1000/em_ethdev.c | 1 - drivers/net/intel/e1000/em_rxtx.c | 1 - drivers/net/intel/e1000/igb_ethdev.c | 2 +- drivers/net/intel/e1000/igb_flow.c | 2 +- drivers/net/intel/e1000/igb_rxtx.c | 1 - drivers/net/intel/i40e/i40e_ethdev.c | 9 +++------ drivers/net/intel/i40e/i40e_ethdev.h | 1 - drivers/net/intel/i40e/i40e_fdir.c | 2 +- drivers/net/intel/i40e/i40e_flow.c | 1 - drivers/net/intel/i40e/i40e_hash.c | 1 - drivers/net/intel/i40e/i40e_pf.c | 1 - drivers/net/intel/i40e/i40e_rxtx.c | 1 - drivers/net/intel/iavf/iavf.h | 1 - drivers/net/intel/iavf/iavf_ethdev.c | 1 - drivers/net/intel/iavf/iavf_fdir.c | 1 - drivers/net/intel/iavf/iavf_fsub.c | 1 - drivers/net/intel/iavf/iavf_generic_flow.c | 1 - drivers/net/intel/iavf/iavf_hash.c | 1 - drivers/net/intel/iavf/iavf_rxtx.c | 1 - drivers/net/intel/iavf/iavf_vchnl.c | 7 ------- drivers/net/intel/ice/base/ice_osdep.h | 2 +- drivers/net/intel/ice/ice_acl_filter.c | 1 - drivers/net/intel/ice/ice_dcf.c | 2 +- drivers/net/intel/ice/ice_dcf_ethdev.c | 1 - drivers/net/intel/ice/ice_ethdev.c | 8 ++------ drivers/net/intel/ice/ice_generic_flow.c | 1 - drivers/net/intel/ice/ice_hash.c | 1 - drivers/net/intel/ice/ice_switch_filter.c | 1 - drivers/net/intel/idpf/base/idpf_osdep.h | 9 +-------- drivers/net/intel/ipn3ke/ipn3ke_ethdev.h | 1 - drivers/net/intel/ipn3ke/ipn3ke_flow.c | 1 - drivers/net/intel/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/intel/ixgbe/ixgbe_ethdev.h | 1 - drivers/net/intel/ixgbe/ixgbe_fdir.c | 2 +- drivers/net/intel/ixgbe/ixgbe_flow.c | 2 +- drivers/net/intel/ixgbe/ixgbe_rxtx.c | 1 - 38 files changed, 14 insertions(+), 61 deletions(-)
drivers/net/intel/cpfl/cpfl_flow_engine_fxp.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2022 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/e1000/e1000_ethdev.h +0 -1
@@ -6,7 +6,6 @@#define _E1000_ETHDEV_H_#include <stdint.h> -#include <sys/queue.h> #include <rte_flow.h> #include <rte_time.h>
drivers/net/intel/e1000/em_ethdev.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2010-2016 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/e1000/em_rxtx.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2010-2016 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <stdlib.h>
drivers/net/intel/e1000/igb_ethdev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2010-2016 Intel Corporation */ -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/e1000/igb_flow.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2010-2016 Intel Corporation */ -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/e1000/igb_rxtx.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2010-2016 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <stdlib.h>
drivers/net/intel/i40e/i40e_ethdev.c +3 -6
@@ -12,6 +12,7 @@#include <inttypes.h> #include <assert.h> +#include <rte_bsd_queue.h> #include <rte_common.h> #include <rte_eal.h> #include <rte_string_fns.h>
@@ -5097,16 +5098,12 @@ i40e_res_pool_destroy(struct i40e_res_pool_info *pool)if (pool ==NULL )return ; -for (entry =LIST_FIRST (&pool->alloc_list); - entry && (next_entry =LIST_NEXT (entry, next),1 ); - entry = next_entry) { + LIST_FOREACH_SAFE(entry, &pool->alloc_list, next, next_entry) {LIST_REMOVE (entry, next);rte_free (entry); } -for (entry =LIST_FIRST (&pool->free_list); - entry && (next_entry =LIST_NEXT (entry, next),1 ); - entry = next_entry) { + LIST_FOREACH_SAFE(entry, &pool->free_list, next, next_entry) {LIST_REMOVE (entry, next);rte_free (entry); }
drivers/net/intel/i40e/i40e_ethdev.h +0 -1
@@ -6,7 +6,6 @@#define _I40E_ETHDEV_H_#include <stdint.h> -#include <sys/queue.h> #include <rte_time.h> #include <rte_kvargs.h>
drivers/net/intel/i40e/i40e_fdir.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2010-2015 Intel Corporation */ -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/i40e/i40e_flow.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2016-2017 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/i40e/i40e_hash.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2020 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/i40e/i40e_pf.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/i40e/i40e_rxtx.c +0 -1
@@ -10,7 +10,6 @@#include <stdarg.h> #include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <rte_string_fns.h> #include <rte_memzone.h>
drivers/net/intel/iavf/iavf.h +0 -1
@@ -5,7 +5,6 @@#ifndef _IAVF_ETHDEV_H_#define _IAVF_ETHDEV_H_ -#include <sys/queue.h> #include <rte_kvargs.h> #include <rte_tm_driver.h>
drivers/net/intel/iavf/iavf_ethdev.c +0 -1
@@ -3,7 +3,6 @@*/ #include <ctype.h> -#include <sys/queue.h> #include <stdalign.h> #include <stdio.h> #include <errno.h>
drivers/net/intel/iavf/iavf_fdir.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2020 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/iavf/iavf_fsub.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2022 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/iavf/iavf_generic_flow.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2019 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/iavf/iavf_hash.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2020 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/iavf/iavf_rxtx.c +0 -1
@@ -10,7 +10,6 @@#include <stdarg.h> #include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include <eal_export.h> #include <rte_string_fns.h>
drivers/net/intel/iavf/iavf_vchnl.c +0 -7
@@ -52,13 +52,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) {
drivers/net/intel/ice/base/ice_osdep.h +1 -1
@@ -10,9 +10,9 @@#include <stdio.h> #include <stdarg.h> #include <inttypes.h> -#include <sys/queue.h> #include <stdbool.h> +#include <rte_bsd_queue.h> #include <rte_common.h> #include <rte_memcpy.h> #include <rte_malloc.h>
drivers/net/intel/ice/ice_acl_filter.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2020 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ice/ice_dcf.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2020 Intel Corporation */ -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ice/ice_dcf_ethdev.c +0 -1
@@ -4,7 +4,6 @@#include <errno.h> #include <stdbool.h> -#include <sys/queue.h> #include <sys/types.h> #include <unistd.h>
drivers/net/intel/ice/ice_ethdev.c +2 -6
@@ -883,16 +883,12 @@ ice_res_pool_destroy(struct ice_res_pool_info *pool)if (!pool)return ; -for (entry =LIST_FIRST (&pool->alloc_list); - entry && (next_entry =LIST_NEXT (entry, next),1 ); - entry = next_entry) { + LIST_FOREACH_SAFE(entry, &pool->alloc_list, next, next_entry) {LIST_REMOVE (entry, next);rte_free (entry); } -for (entry =LIST_FIRST (&pool->free_list); - entry && (next_entry =LIST_NEXT (entry, next),1 ); - entry = next_entry) { + LIST_FOREACH_SAFE(entry, &pool->free_list, next, next_entry) {LIST_REMOVE (entry, next);rte_free (entry); }
drivers/net/intel/ice/ice_generic_flow.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2019 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ice/ice_hash.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2019 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ice/ice_switch_filter.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2019 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/idpf/base/idpf_osdep.h +1 -8
@@ -10,7 +10,7 @@#include <stdio.h> #include <stdarg.h> #include <inttypes.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdbool.h> #include <rte_common.h>
@@ -343,13 +343,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)
drivers/net/intel/ipn3ke/ipn3ke_ethdev.h +0 -1
@@ -11,7 +11,6 @@#include <limits.h> #include <net/if.h> #include <netinet/in.h> -#include <sys/queue.h> #include <rte_mbuf.h> #include <rte_flow_driver.h>
drivers/net/intel/ipn3ke/ipn3ke_flow.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2019 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ixgbe/ixgbe_ethdev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ixgbe/ixgbe_ethdev.h +0 -1
@@ -7,7 +7,6 @@#include <stdint.h> #include <stdbool.h> -#include <sys/queue.h> #include "base/ixgbe_type.h" #include "base/ixgbe_dcb.h"
drivers/net/intel/ixgbe/ixgbe_fdir.c +1 -1
@@ -6,7 +6,7 @@#include <stdint.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_interrupts.h> #include <rte_log.h>
drivers/net/intel/ixgbe/ixgbe_flow.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2010-2016 Intel Corporation */ -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/intel/ixgbe/ixgbe_rxtx.c +0 -1
@@ -3,7 +3,6 @@* Copyright 2014 6WIND S.A. */ -#include <sys/queue.h> #include <stdio.h> #include <stdlib.h>
Signature · 1 line
2.47.2
PATCH v2 17/43 net/mlx5: remove unnecessary include of sys/queue.h
In reply to Stephen HemmingerAlready handled by rte_tailq.h in most places.
--- drivers/net/mlx5/hws/mlx5dr_internal.h | 1 - drivers/net/mlx5/linux/mlx5_verbs.c | 1 - drivers/net/mlx5/mlx5.h | 2 +- drivers/net/mlx5/mlx5_devx.c | 1 - drivers/net/mlx5/mlx5_flow.c | 2 +- drivers/net/mlx5/mlx5_flow.h | 2 +- drivers/net/mlx5/mlx5_flow_dv.c | 1 - drivers/net/mlx5/mlx5_flow_verbs.c | 2 +- drivers/net/mlx5/mlx5_rx.h | 1 - drivers/net/mlx5/mlx5_rxq.c | 2 +- drivers/net/mlx5/mlx5_rxtx.h | 1 - drivers/net/mlx5/mlx5_tx.h | 1 - 12 files changed, 5 insertions(+), 12 deletions(-)
drivers/net/mlx5/hws/mlx5dr_internal.h +0 -1
@@ -6,7 +6,6 @@#define MLX5DR_INTERNAL_H_ #include <stdint.h> -#include <sys/queue.h> /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC #pragma GCC diagnostic ignored "-Wpedantic"
drivers/net/mlx5/linux/mlx5_verbs.c +0 -1
@@ -8,7 +8,6 @@#include <stdint.h> #include <unistd.h> #include <inttypes.h> -#include <sys/queue.h> #include "mlx5_autoconf.h"
drivers/net/mlx5/mlx5.h +1 -1
@@ -10,7 +10,7 @@#include <stdbool.h> #include <stdint.h> #include <limits.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_pci.h> #include <rte_ether.h>
drivers/net/mlx5/mlx5_devx.c +0 -1
@@ -7,7 +7,6 @@#include <stdbool.h> #include <string.h> #include <stdint.h> -#include <sys/queue.h> #include <rte_malloc.h> #include <rte_common.h>
drivers/net/mlx5/mlx5_flow.c +1 -1
@@ -7,7 +7,7 @@#include <stdint.h> #include <string.h> #include <stdbool.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <eal_export.h> #include <rte_common.h>
drivers/net/mlx5/mlx5_flow.h +1 -1
@@ -8,7 +8,7 @@#include <stdalign.h> #include <stdint.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_alarm.h> #include <rte_mtr.h>
drivers/net/mlx5/mlx5_flow_dv.c +0 -1
@@ -2,7 +2,6 @@* Copyright 2018 Mellanox Technologies, Ltd */ -#include <sys/queue.h> #include <stdalign.h> #include <stdint.h> #include <string.h>
drivers/net/mlx5/mlx5_flow_verbs.c +1 -1
@@ -3,7 +3,7 @@*/ #include <netinet/in.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdalign.h> #include <stdint.h> #include <string.h>
drivers/net/mlx5/mlx5_rx.h +0 -1
@@ -7,7 +7,6 @@#define RTE_PMD_MLX5_RX_H_ #include <stdint.h> -#include <sys/queue.h> #include <rte_mbuf.h> #include <rte_mempool.h>
drivers/net/mlx5/mlx5_rxq.c +1 -1
@@ -8,7 +8,7 @@#include <string.h> #include <stdint.h> #include <fcntl.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <eal_export.h> #include <rte_mbuf.h>
drivers/net/mlx5/mlx5_rxtx.h +0 -1
@@ -8,7 +8,6 @@#include <stddef.h> #include <stdint.h> -#include <sys/queue.h> #include <rte_mbuf.h> #include <rte_mempool.h>
drivers/net/mlx5/mlx5_tx.h +0 -1
@@ -7,7 +7,6 @@#define RTE_PMD_MLX5_TX_H_ #include <stdint.h> -#include <sys/queue.h> #include <rte_mbuf.h> #include <rte_mempool.h>
Signature · 1 line
2.47.2
PATCH v2 18/43 net/mlx4: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/mlx4/mlx4.h | 1 - drivers/net/mlx4/mlx4_flow.c | 2 +- drivers/net/mlx4/mlx4_flow.h | 1 - drivers/net/mlx4/mlx4_mr.h | 1 - drivers/net/mlx4/mlx4_rxtx.h | 1 - 5 files changed, 1 insertion(+), 5 deletions(-)
drivers/net/mlx4/mlx4.h +0 -1
@@ -8,7 +8,6 @@#include <net/if.h> #include <stdint.h> -#include <sys/queue.h> /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC
drivers/net/mlx4/mlx4_flow.c +1 -1
@@ -14,7 +14,7 @@#include <stddef.h> #include <stdint.h> #include <string.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC
drivers/net/mlx4/mlx4_flow.h +0 -1
@@ -7,7 +7,6 @@#define RTE_PMD_MLX4_FLOW_H_ #include <stdint.h> -#include <sys/queue.h> /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC
drivers/net/mlx4/mlx4_mr.h +0 -1
@@ -8,7 +8,6 @@#include <stddef.h> #include <stdint.h> -#include <sys/queue.h> /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC
drivers/net/mlx4/mlx4_rxtx.h +0 -1
@@ -7,7 +7,6 @@#define MLX4_RXTX_H_ #include <stdint.h> -#include <sys/queue.h> /* Verbs headers do not support -pedantic. */ #ifdef PEDANTIC
Signature · 1 line
2.47.2
PATCH v2 19/43 net/tap: remove unnecessary include of sys/queue.h
In reply to Stephen HemmingerThe macros in sys/queue.h are not used here.
--- drivers/net/tap/rte_eth_tap.h | 1 - drivers/net/tap/tap_flow.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/tap/rte_eth_tap.h +0 -1
@@ -6,7 +6,6 @@#ifndef _RTE_ETH_TAP_H_#define _RTE_ETH_TAP_H_ -#include <sys/queue.h> #include <sys/uio.h> #include <inttypes.h> #include <net/if.h>
drivers/net/tap/tap_flow.c +0 -1
@@ -6,7 +6,6 @@#include <errno.h> #include <string.h> #include <unistd.h> -#include <sys/queue.h> #include <sys/resource.h> #include <rte_byteorder.h>
Signature · 1 line
2.47.2
PATCH v2 20/43 net/axgbe: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/axgbe/axgbe_common.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/axgbe/axgbe_common.h +0 -1
@@ -10,7 +10,6 @@#include <stdbool.h> #include <limits.h> -#include <sys/queue.h> #include <stdio.h> #include <stdlib.h> #include <string.h>
Signature · 1 line
2.47.2
PATCH v2 21/43 net/bnx2x: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/bnx2x/bnx2x_ethdev.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/bnx2x/bnx2x_ethdev.h +0 -1
@@ -8,7 +8,6 @@#ifndef PMD_BNX2X_ETHDEV_H #define PMD_BNX2X_ETHDEV_H -#include <sys/queue.h> #include <sys/param.h> #include <sys/user.h> #include <sys/stat.h>
Signature · 1 line
2.47.2
PATCH v2 22/43 net/bonding: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/bonding/eth_bond_private.h | 1 - drivers/net/bonding/rte_eth_bond_flow.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/bonding/eth_bond_private.h +0 -1
@@ -6,7 +6,6 @@#define _ETH_BOND_PRIVATE_H_#include <stdint.h> -#include <sys/queue.h> #include <ethdev_driver.h> #include <rte_flow.h>
drivers/net/bonding/rte_eth_bond_flow.c +0 -1
@@ -4,7 +4,6 @@#include <stddef.h> #include <string.h> -#include <sys/queue.h> #include <rte_errno.h> #include <rte_malloc.h>
Signature · 1 line
2.47.2
PATCH v2 23/43 net/cxgbe: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/cxgbe/cxgbe_main.c | 1 - drivers/net/cxgbe/sge.c | 1 - 3 files changed, 1 insertion(+), 3 deletions(-)
drivers/net/cxgbe/cxgbe_ethdev.c +1 -1
@@ -3,7 +3,7 @@* All rights reserved. */ -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/cxgbe/cxgbe_main.c +0 -1
@@ -3,7 +3,6 @@* All rights reserved. */ -#include <sys/queue.h> #include <sys/stat.h> #include <stdio.h> #include <errno.h>
drivers/net/cxgbe/sge.c +0 -1
@@ -3,7 +3,6 @@* All rights reserved. */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
Signature · 1 line
2.47.2
PATCH v2 24/43 net/enic: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/enic/enic.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/enic/enic.h +0 -1
@@ -21,7 +21,6 @@#include "enic_res.h" #include "cq_enet_desc.h" #include <stdbool.h> -#include <sys/queue.h> #include <rte_spinlock.h> #define DRV_NAME "enic_pmd"
Signature · 1 line
2.47.2
PATCH v2 25/43 net/failsafe: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/failsafe/failsafe_flow.c | 1 - drivers/net/failsafe/failsafe_private.h | 2 +- 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/net/failsafe/failsafe_flow.c +0 -1
@@ -5,7 +5,6 @@#include <stddef.h> #include <string.h> -#include <sys/queue.h> #include <rte_errno.h> #include <rte_malloc.h>
drivers/net/failsafe/failsafe_private.h +1 -1
@@ -7,7 +7,7 @@#define _ETH_FAILSAFE_PRIVATE_H_#include <stdint.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <pthread.h> #include <rte_atomic.h>
Signature · 1 line
2.47.2
PATCH v2 26/43 net/memif: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/memif/memif_socket.h | 1 - drivers/net/memif/rte_eth_memif.h | 1 - 2 files changed, 2 deletions(-)
drivers/net/memif/memif_socket.h +0 -1
@@ -5,7 +5,6 @@#ifndef _MEMIF_SOCKET_H_#define _MEMIF_SOCKET_H_ -#include <sys/queue.h> #include <sys/un.h> /**
drivers/net/memif/rte_eth_memif.h +0 -1
@@ -5,7 +5,6 @@#ifndef _RTE_ETH_MEMIF_H_#define _RTE_ETH_MEMIF_H_ -#include <sys/queue.h> #include <ethdev_driver.h> #include <rte_ether.h>
Signature · 1 line
2.47.2
PATCH v2 27/43 net/ngbe: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/ngbe/ngbe_ethdev_vf.c | 1 - drivers/net/ngbe/ngbe_rxtx.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/ngbe/ngbe_ethdev_vf.c +0 -1
@@ -3,7 +3,6 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/ngbe/ngbe_rxtx.c +0 -1
@@ -3,7 +3,6 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> #include <stdint.h> #include <rte_ethdev.h>
Signature · 1 line
2.47.2
PATCH v2 28/43 net/ntnic: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/ntnic/ntnic_ethdev.c | 3 --- 1 file changed, 3 deletions(-)
drivers/net/ntnic/ntnic_ethdev.c +0 -3
@@ -5,7 +5,6 @@#include <stdint.h> #include <stdarg.h> -#include <signal.h> #include <rte_eal.h>
@@ -16,8 +15,6 @@#include <ethdev_pci.h> #include <rte_kvargs.h> -#include <sys/queue.h> -#include "rte_spinlock.h" #include "ntlog.h" #include "ntdrv_4ga.h"
Signature · 1 line
2.47.2
PATCH v2 29/43 net/sfc: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/sfc/sfc_dp.c | 2 +- drivers/net/sfc/sfc_dp.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)
drivers/net/sfc/sfc_dp.c +1 -1
@@ -7,7 +7,7 @@* for Solarflare) and Solarflare Communications, Inc. */ -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <stdalign.h> #include <string.h> #include <errno.h>
drivers/net/sfc/sfc_dp.h +0 -1
@@ -11,7 +11,6 @@#define _SFC_DP_H#include <stdbool.h> -#include <sys/queue.h> #include <rte_pci.h>
Signature · 1 line
2.47.2
Re: [PATCH v2 29/43] net/sfc: replace use of sys/queue.h
Quoted 13 lines · Stephen Hemminger
Replace use of system
sys/queue.hwith DPDKrte_bsd_queue.hSigned-off-by Stephen Hemminger <[email protected]>--- drivers/net/sfc/sfc_dp.c | 2 +- drivers/net/sfc/sfc_dp.h | 1 - 2 files changed, 1 insertion(+), 2 deletions(-)drivers/net/sfc/sfc_dp.c +0
-0
drivers/net/sfc/sfc_dp.c line 10
Quoted 5 lines
drivers/net/sfc/sfc_dp.c +1
-1@@ -7,7 +7,7 @@* for Solarflare) and Solarflare Communications, Inc. */ -#include <sys/queue.h> +#include <rte_bsd_queue.h>
IMHO it is not nice since headers are grouped and rte headers group is located below.
drivers/net/sfc/sfc_dp.h line 14
Quoted 12 lines
drivers/net/sfc/sfc_dp.c +0
-0#include <stdalign.h> #include <string.h> #include <errno.h> drivers/net/sfc/sfc_dp.h +0
-1@@ -11,7 +11,6 @@#define _SFC_DP_H#include <stdbool.h> -#include <sys/queue.h>
#include <rte_bsd_queue.h> is required here since TAILQ_HEAD is used below in the header.
Quoted 3 lines
drivers/net/sfc/sfc_dp.h +0
-0#include <rte_pci.h>
PATCH v2 30/43 net/softnic: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/softnic/rte_eth_softnic_internals.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/softnic/rte_eth_softnic_internals.h +0 -1
@@ -7,7 +7,6 @@#include <stddef.h> #include <stdint.h> -#include <sys/queue.h> #include <rte_mempool.h> #include <rte_mbuf.h>
Signature · 1 line
2.47.2
PATCH v2 31/43 net/thunderx: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/thunderx/base/nicvf_bsvf.h | 2 +- drivers/net/thunderx/base/nicvf_plat.h | 1 + drivers/net/thunderx/nicvf_ethdev.c | 1 - 3 files changed, 2 insertions(+), 2 deletions(-)
drivers/net/thunderx/base/nicvf_bsvf.h +1 -1
@@ -5,7 +5,7 @@#ifndef __THUNDERX_NICVF_BSVF_H__#define __THUNDERX_NICVF_BSVF_H__ -#include <sys/queue.h> +#include <rte_bsd_queue.h> struct nicvf ;
drivers/net/thunderx/base/nicvf_plat.h +1 -0
@@ -6,6 +6,7 @@#define _THUNDERX_NICVF_H/* Platform/OS/arch specific abstractions */ +#include <rte_bsd_queue.h> /* log */ #include <rte_log.h>
drivers/net/thunderx/nicvf_ethdev.c +0 -1
@@ -12,7 +12,6 @@#include <stdarg.h> #include <inttypes.h> #include <netinet/in.h> -#include <sys/queue.h> #include <rte_alarm.h> #include <rte_branch_prediction.h>
Signature · 1 line
2.47.2
PATCH v2 32/43 net/txgbe: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/txgbe/txgbe_ethdev_vf.c | 1 - drivers/net/txgbe/txgbe_fdir.c | 2 +- drivers/net/txgbe/txgbe_flow.c | 2 +- drivers/net/txgbe/txgbe_rxtx.c | 1 - 4 files changed, 2 insertions(+), 4 deletions(-)
drivers/net/txgbe/txgbe_ethdev_vf.c +0 -1
@@ -3,7 +3,6 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <errno.h> #include <stdint.h>
drivers/net/txgbe/txgbe_fdir.c +1 -1
@@ -7,7 +7,7 @@#include <stdint.h> #include <stdarg.h> #include <errno.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <rte_malloc.h> #include "txgbe_logs.h"
drivers/net/txgbe/txgbe_flow.c +1 -1
@@ -3,7 +3,7 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <bus_pci_driver.h> #include <rte_malloc.h> #include <rte_flow.h>
drivers/net/txgbe/txgbe_rxtx.c +0 -1
@@ -3,7 +3,6 @@* Copyright(c) 2010-2017 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <stdlib.h>
Signature · 1 line
2.47.2
PATCH v2 33/43 net/vdev_netvsc: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-)
drivers/net/vdev_netvsc/vdev_netvsc.c +1 -1
@@ -19,7 +19,7 @@#include <stdio.h> #include <string.h> #include <sys/ioctl.h> -#include <sys/queue.h> +#include <rte_bsd_queue.h> #include <sys/socket.h> #include <unistd.h>
Signature · 1 line
2.47.2
PATCH v2 34/43 net/vmxnet3: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/vmxnet3/vmxnet3_ethdev.c | 1 - drivers/net/vmxnet3/vmxnet3_rxtx.c | 1 - 2 files changed, 2 deletions(-)
drivers/net/vmxnet3/vmxnet3_ethdev.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2010-2015 Intel Corporation */ -#include <sys/queue.h> #include <stdalign.h> #include <stdio.h> #include <errno.h>
drivers/net/vmxnet3/vmxnet3_rxtx.c +0 -1
@@ -2,7 +2,6 @@* Copyright(c) 2010-2015 Intel Corporation */ -#include <sys/queue.h> #include <stdio.h> #include <stdlib.h>
Signature · 1 line
2.47.2
PATCH v2 35/43 net/zxdh: replace use of sys/queue.h
In reply to Stephen HemmingerReplace use of system sys/queue.h with DPDK rte_bsd_queue.h
--- drivers/net/zxdh/zxdh_mtr.h | 1 - 1 file changed, 1 deletion(-)
drivers/net/zxdh/zxdh_mtr.h +0 -1
@@ -7,7 +7,6 @@#include <stddef.h> #include <stdint.h> -#include <sys/queue.h> #include <rte_mtr.h> #include "zxdh_np.h"
Signature · 1 line
2.47.2