Bus cleanup for 22.11
Subsystems (12)
PATCH v6 23/27 dev: hide driver object
In reply to David MarchandMake rte_driver opaque for non internal users.
This will make extending this object possible without breaking the ABI.
Introduce a new driver header and move rte_driver definition. Update drivers and library to use the internal header.
Some applications may have been dereferencing rte_driver objects, mark this object's accessors as stable.
---
Changes since RFC v2:
- updated release notes,
- marked accessors as stable,
--- doc/guides/rel_notes/release_22_11.rst | 2 ++ drivers/baseband/acc100/rte_acc100_pmd.c | 2 +- .../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 2 +- drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 2 +- drivers/bus/auxiliary/auxiliary_params.c | 2 +- drivers/bus/auxiliary/bus_auxiliary_driver.h | 2 +- drivers/bus/dpaa/bus_dpaa_driver.h | 2 +- drivers/bus/fslmc/bus_fslmc_driver.h | 2 +- drivers/bus/fslmc/fslmc_vfio.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dprc.c | 2 +- drivers/bus/pci/bus_pci_driver.h | 2 +- drivers/bus/pci/pci_params.c | 2 +- drivers/bus/vdev/bus_vdev_driver.h | 2 +- drivers/bus/vdev/vdev.c | 2 +- drivers/bus/vdev/vdev_params.c | 2 +- drivers/bus/vmbus/bus_vmbus_driver.h | 2 +- drivers/common/qat/dev/qat_dev_gen4.c | 2 +- drivers/common/qat/qat_qp.c | 2 +- drivers/compress/zlib/zlib_pmd_ops.c | 2 +- drivers/crypto/bcmfs/bcmfs_qp.c | 2 +- drivers/crypto/bcmfs/bcmfs_sym_pmd.c | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 2 +- drivers/crypto/cnxk/cn10k_cryptodev.c | 2 +- drivers/crypto/cnxk/cn9k_cryptodev.c | 2 +- drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +- drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +- drivers/crypto/scheduler/scheduler_pmd_ops.c | 2 +- drivers/dma/idxd/idxd_bus.c | 1 + drivers/event/dlb2/dlb2.c | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- drivers/event/dpaa/dpaa_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +- drivers/event/octeontx/ssovf_evdev.c | 2 +- drivers/event/skeleton/skeleton_eventdev.c | 2 +- drivers/gpu/cuda/cuda.c | 2 +- drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- drivers/net/ark/ark_global.h | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/axgbe/axgbe_common.h | 2 +- drivers/net/bnx2x/bnx2x_ethdev.c | 2 +- drivers/net/bnxt/bnxt_ethdev.c | 2 +- drivers/net/bnxt/rte_pmd_bnxt.c | 2 +- drivers/net/cxgbe/base/t4_hw.c | 2 +- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/cxgbe/cxgbe_main.c | 2 +- drivers/net/cxgbe/sge.c | 2 +- drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 2 +- drivers/net/dpaa2/dpaa2_ethdev.c | 2 +- drivers/net/dpaa2/dpaa2_recycle.c | 2 +- drivers/net/dpaa2/dpaa2_rxtx.c | 2 +- drivers/net/dpaa2/dpaa2_sparser.c | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/e1000/igb_flow.c | 2 +- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/enic/enic_vf_representor.c | 2 +- drivers/net/failsafe/failsafe_private.h | 2 +- drivers/net/fm10k/fm10k_ethdev.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/iavf/iavf_ethdev.c | 2 +- drivers/net/iavf/iavf_vchnl.c | 2 +- drivers/net/ice/ice_dcf.c | 2 +- drivers/net/ice/ice_dcf_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_flow.c | 2 +- drivers/net/mlx4/mlx4.c | 2 +- drivers/net/netvsc/hn_ethdev.c | 2 +- drivers/net/netvsc/hn_nvs.c | 2 +- drivers/net/netvsc/hn_rndis.c | 2 +- drivers/net/netvsc/hn_rxtx.c | 2 +- drivers/net/nfp/nfp_common.c | 2 +- drivers/net/nfp/nfp_ethdev.c | 2 +- drivers/net/octeontx/octeontx_ethdev.c | 2 +- drivers/net/qede/qede_ethdev.h | 2 +- drivers/net/sfc/sfc_ethdev.c | 2 +- drivers/net/sfc/sfc_sw_stats.c | 2 +- drivers/net/sfc/sfc_sw_stats.h | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 2 +- drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +- drivers/net/virtio/virtio_ethdev.c | 2 +- drivers/net/virtio/virtio_pci_ethdev.c | 2 +- drivers/net/vmxnet3/vmxnet3_ethdev.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy.c | 2 +- drivers/raw/skeleton/skeleton_rawdev.c | 2 +- drivers/raw/skeleton/skeleton_rawdev_test.c | 2 +- drivers/regex/mlx5/mlx5_regex_control.c | 2 +- lib/compressdev/rte_compressdev.c | 2 +- lib/compressdev/rte_compressdev_pmd.c | 2 +- lib/compressdev/rte_compressdev_pmd.h | 1 + lib/cryptodev/cryptodev_pmd.c | 2 +- lib/cryptodev/cryptodev_pmd.h | 1 + lib/cryptodev/rte_cryptodev.c | 2 +- lib/dmadev/rte_dmadev_pmd.h | 2 +- lib/eal/common/eal_common_dev.c | 2 +- lib/eal/include/dev_driver.h | 28 +++++++++++++++++++ lib/eal/include/meson.build | 1 + lib/eal/include/rte_dev.h | 15 ++-------- lib/eal/version.map | 4 +-- lib/ethdev/ethdev_driver.h | 1 + lib/eventdev/eventdev_pmd.h | 2 +- lib/eventdev/rte_event_crypto_adapter.c | 2 +- lib/eventdev/rte_event_eth_rx_adapter.c | 2 +- lib/eventdev/rte_eventdev.c | 2 +- lib/gpudev/gpudev_driver.h | 2 +- lib/mempool/rte_mempool_ops.c | 2 +- lib/pcapng/rte_pcapng.c | 2 +- lib/rawdev/rte_rawdev.c | 2 +- lib/rawdev/rte_rawdev_pmd.h | 2 +- lib/security/rte_security.c | 2 +- 115 files changed, 144 insertions(+), 122 deletions(-) create mode 100644 lib/eal/include/dev_driver.h
doc/guides/rel_notes/release_22_11.rst +2 -0
@@ -98,6 +98,8 @@ API Changes ``vdev``, ``vmbus`` buses has been marked as an internal API. External users may still register their driver using the associated driver headers (see ``enable_driver_sdk`` meson option). + The ``rte_driver`` object is now opaque and must be manipulated through added + accessors. * raw/ifgpa: The function ``rte_pmd_ifpga_get_pci_bus`` has been removed.
drivers/baseband/acc100/rte_acc100_pmd.c +1 -1
@@ -6,7 +6,7 @@#include <rte_common.h> #include <rte_log.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_malloc.h> #include <rte_mempool.h> #include <rte_byteorder.h>
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +1 -1
@@ -6,7 +6,7 @@#include <rte_common.h> #include <rte_log.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_malloc.h> #include <rte_mempool.h> #include <rte_errno.h>
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +1 -1
@@ -6,7 +6,7 @@#include <rte_common.h> #include <rte_log.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_malloc.h> #include <rte_mempool.h> #include <rte_errno.h>
drivers/bus/auxiliary/auxiliary_params.c +1 -1
@@ -5,7 +5,7 @@#include <string.h> #include <bus_driver.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_errno.h> #include <rte_kvargs.h>
drivers/bus/auxiliary/bus_auxiliary_driver.h +1 -1
@@ -25,7 +25,7 @@ extern "C" {#include <rte_compat.h> #include <rte_debug.h> #include <rte_interrupts.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_kvargs.h> #define RTE_BUS_AUXILIARY_NAME "auxiliary"
drivers/bus/dpaa/bus_dpaa_driver.h +1 -1
@@ -7,7 +7,7 @@#define BUS_DPAA_DRIVER_H #include <rte_compat.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_mbuf_dyn.h> #include <rte_mempool.h>
drivers/bus/fslmc/bus_fslmc_driver.h +1 -1
@@ -29,7 +29,7 @@ extern "C" {#include <rte_compat.h> #include <rte_debug.h> #include <rte_interrupts.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_tailq.h> #include <rte_devargs.h> #include <rte_mbuf.h>
drivers/bus/fslmc/fslmc_vfio.c +1 -1
@@ -28,7 +28,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_eal_memconfig.h> #include "private.h"
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +1 -1
@@ -18,7 +18,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <ethdev_driver.h> #include <rte_mbuf_pool_ops.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c +1 -1
@@ -17,7 +17,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <ethdev_driver.h> #include <fslmc_logs.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +1 -1
@@ -30,7 +30,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <fslmc_logs.h> #include <bus_fslmc_driver.h>
drivers/bus/fslmc/portal/dpaa2_hw_dprc.c +1 -1
@@ -10,7 +10,7 @@#include <errno.h> #include <rte_malloc.h> -#include <rte_dev.h> +#include <dev_driver.h> #include "private.h" #include <fslmc_logs.h>
drivers/bus/pci/bus_pci_driver.h +1 -1
@@ -11,7 +11,7 @@ extern "C" {#endif #include <rte_bus_pci.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_compat.h> /** Pathname of PCI devices directory. */
drivers/bus/pci/pci_params.c +1 -1
@@ -6,7 +6,7 @@#include <bus_driver.h> #include <rte_bus_pci.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_errno.h> #include <rte_kvargs.h> #include <rte_devargs.h>
drivers/bus/vdev/bus_vdev_driver.h +1 -1
@@ -11,7 +11,7 @@ extern "C" {#include <rte_bus_vdev.h> #include <rte_compat.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_devargs.h> struct rte_vdev_device {
drivers/bus/vdev/vdev.c +1 -1
@@ -11,7 +11,7 @@#include <sys/queue.h> #include <rte_eal.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <bus_driver.h> #include <rte_common.h> #include <rte_devargs.h>
drivers/bus/vdev/vdev_params.c +1 -1
@@ -4,7 +4,7 @@#include <string.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_kvargs.h> #include <rte_errno.h>
drivers/bus/vmbus/bus_vmbus_driver.h +1 -1
@@ -12,7 +12,7 @@ extern "C" {#include <rte_bus_vmbus.h> #include <rte_compat.h> -#include <rte_dev.h> +#include <dev_driver.h> struct vmbus_channel ;struct vmbus_mon_page ;
drivers/common/qat/dev/qat_dev_gen4.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2021 Intel Corporation */ -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_pci.h> #include "qat_device.h"
drivers/common/qat/qat_qp.c +1 -1
@@ -4,7 +4,7 @@#include <rte_common.h> #include <rte_cycles.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_malloc.h> #include <rte_memzone.h> #include <rte_pci.h>
drivers/compress/zlib/zlib_pmd_ops.c +1 -1
@@ -4,7 +4,7 @@#include <string.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_common.h> #include <rte_malloc.h>
drivers/crypto/bcmfs/bcmfs_qp.c +1 -1
@@ -8,7 +8,7 @@#include <rte_atomic.h> #include <rte_bitmap.h> #include <rte_common.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_malloc.h> #include <rte_memzone.h> #include <rte_prefetch.h>
drivers/crypto/bcmfs/bcmfs_sym_pmd.c +1 -1
@@ -4,7 +4,7 @@*/ #include <rte_common.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_errno.h> #include <rte_malloc.h> #include <cryptodev_pmd.h>
drivers/crypto/ccp/rte_ccp_pmd.c +1 -1
@@ -9,7 +9,7 @@#include <rte_cryptodev.h> #include <cryptodev_pmd.h> #include <rte_pci.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_malloc.h> #include "ccp_crypto.h"
drivers/crypto/cnxk/cn10k_cryptodev.c +1 -1
@@ -7,7 +7,7 @@#include <rte_crypto.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_pci.h> #include "cn10k_cryptodev.h"
drivers/crypto/cnxk/cn9k_cryptodev.c +1 -1
@@ -7,7 +7,7 @@#include <rte_crypto.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_pci.h> #include "cn9k_cryptodev.h"
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +1 -1
@@ -17,7 +17,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <cryptodev_pmd.h> #include <rte_common.h> #include <bus_fslmc_driver.h>
drivers/crypto/dpaa_sec/dpaa_sec.c +1 -1
@@ -19,7 +19,7 @@#include <rte_security_driver.h> #endif #include <rte_cycles.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_io.h> #include <rte_ip.h> #include <rte_kvargs.h>
drivers/crypto/scheduler/scheduler_pmd_ops.c +1 -1
@@ -5,7 +5,7 @@#include <rte_common.h> #include <rte_malloc.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h> #include <rte_reorder.h>
drivers/dma/idxd/idxd_bus.c +1 -0
@@ -9,6 +9,7 @@#include <libgen.h> #include <bus_driver.h> +#include <dev_driver.h> #include <rte_devargs.h> #include <rte_eal.h> #include <rte_log.h>
drivers/event/dlb2/dlb2.c +1 -1
@@ -17,7 +17,7 @@#include <rte_config.h> #include <rte_cycles.h> #include <rte_debug.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_errno.h> #include <rte_eventdev.h> #include <eventdev_pmd.h>
drivers/event/dlb2/pf/dlb2_pf.c +1 -1
@@ -15,7 +15,7 @@#include <rte_debug.h> #include <rte_log.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_devargs.h> #include <rte_mbuf.h> #include <rte_ring.h>
drivers/event/dpaa/dpaa_eventdev.c +1 -1
@@ -14,7 +14,7 @@#include <rte_byteorder.h> #include <rte_common.h> #include <rte_debug.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_eal.h> #include <rte_lcore.h> #include <rte_log.h>
drivers/event/dpaa2/dpaa2_eventdev.c +1 -1
@@ -14,7 +14,7 @@#include <rte_byteorder.h> #include <rte_common.h> #include <rte_debug.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_eal.h> #include <bus_fslmc_driver.h> #include <rte_lcore.h>
drivers/event/dpaa2/dpaa2_hw_dpcon.c +1 -1
@@ -17,7 +17,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <ethdev_driver.h> #include <bus_fslmc_driver.h>
drivers/event/octeontx/ssovf_evdev.c +1 -1
@@ -7,7 +7,7 @@#include <rte_common.h> #include <cryptodev_pmd.h> #include <rte_debug.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_eal.h> #include <ethdev_driver.h> #include <rte_event_eth_rx_adapter.h>
drivers/event/skeleton/skeleton_eventdev.c +1 -1
@@ -12,7 +12,7 @@#include <rte_byteorder.h> #include <rte_common.h> #include <rte_debug.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_eal.h> #include <rte_log.h> #include <rte_malloc.h>
drivers/gpu/cuda/cuda.c +1 -1
@@ -8,7 +8,7 @@#include <rte_pci.h> #include <bus_pci_driver.h> #include <rte_byteorder.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <gpudev_driver.h>
drivers/mempool/dpaa2/dpaa2_hw_mempool.c +1 -1
@@ -20,7 +20,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h> -#include <rte_dev.h> +#include <dev_driver.h> #include "rte_dpaa2_mempool.h" #include "fslmc_vfio.h"
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -1
@@ -24,7 +24,7 @@#include <rte_string_fns.h> #include <rte_branch_prediction.h> #include <rte_common.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_eal.h> #include <rte_ether.h> #include <rte_lcore.h>
drivers/net/ark/ark_global.h +1 -1
@@ -15,7 +15,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_version.h> #include "ark_pktdir.h"
drivers/net/avp/avp_ethdev.c +1 -1
@@ -22,7 +22,7 @@#include <rte_cycles.h> #include <rte_spinlock.h> #include <rte_byteorder.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_memory.h> #include <rte_eal.h> #include <rte_io.h>
drivers/net/axgbe/axgbe_common.h +1 -1
@@ -33,7 +33,7 @@#include <rte_memzone.h> #include <rte_ether.h> #include <rte_ethdev.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_errno.h> #include <ethdev_pci.h> #include <rte_common.h>
drivers/net/bnx2x/bnx2x_ethdev.c +1 -1
@@ -9,7 +9,7 @@#include "bnx2x_rxtx.h" #include <rte_string_fns.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <ethdev_pci.h> #include <rte_alarm.h>
drivers/net/bnxt/bnxt_ethdev.c +1 -1
@@ -6,7 +6,7 @@#include <inttypes.h> #include <stdbool.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_malloc.h>
drivers/net/bnxt/rte_pmd_bnxt.c +1 -1
@@ -7,7 +7,7 @@#include <stdbool.h> #include <unistd.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_cycles.h>
drivers/net/cxgbe/base/t4_hw.c +1 -1
@@ -18,7 +18,7 @@#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_random.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_byteorder.h> #include "common.h"
drivers/net/cxgbe/cxgbe_ethdev.c +1 -1
@@ -31,7 +31,7 @@#include <ethdev_pci.h> #include <rte_malloc.h> #include <rte_random.h> -#include <rte_dev.h> +#include <dev_driver.h> #include "cxgbe.h" #include "cxgbe_pfvf.h"
drivers/net/cxgbe/cxgbe_main.c +1 -1
@@ -31,7 +31,7 @@#include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_random.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_kvargs.h> #include "base/common.h"
drivers/net/cxgbe/sge.c +1 -1
@@ -30,7 +30,7 @@#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_random.h> -#include <rte_dev.h> +#include <dev_driver.h> #include "base/common.h" #include "base/t4_regs.h"
drivers/net/dpaa2/base/dpaa2_hw_dpni.c +1 -1
@@ -15,7 +15,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <dpaa2_pmd_logs.h> #include <dpaa2_hw_pvt.h>
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -15,7 +15,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <bus_fslmc_driver.h> #include <rte_flow_driver.h> #include "rte_dpaa2_mempool.h"
drivers/net/dpaa2/dpaa2_recycle.c +1 -1
@@ -14,7 +14,7 @@#include <rte_string_fns.h> #include <rte_cycles.h> #include <rte_kvargs.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <bus_fslmc_driver.h> #include <rte_flow_driver.h>
drivers/net/dpaa2/dpaa2_rxtx.c +1 -1
@@ -13,7 +13,7 @@#include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_string_fns.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_hexdump.h> #include <bus_fslmc_driver.h>
drivers/net/dpaa2/dpaa2_sparser.c +1 -1
@@ -7,7 +7,7 @@#include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_string_fns.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <fslmc_logs.h> #include <fslmc_vfio.h>
drivers/net/e1000/em_ethdev.c +1 -1
@@ -20,7 +20,7 @@#include <rte_memory.h> #include <rte_eal.h> #include <rte_malloc.h> -#include <rte_dev.h> +#include <dev_driver.h> #include "e1000_logs.h" #include "base/e1000_api.h"
drivers/net/e1000/igb_ethdev.c +1 -1
@@ -22,7 +22,7 @@#include <rte_memory.h> #include <rte_eal.h> #include <rte_malloc.h> -#include <rte_dev.h> +#include <dev_driver.h> #include "e1000_logs.h" #include "base/e1000_api.h"
drivers/net/e1000/igb_flow.c +1 -1
@@ -21,7 +21,7 @@#include <rte_eal.h> #include <rte_atomic.h> #include <rte_malloc.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_flow.h> #include <rte_flow_driver.h>
drivers/net/ena/ena_ethdev.h +1 -1
@@ -14,7 +14,7 @@#include <rte_pci.h> #include <bus_pci_driver.h> #include <rte_timer.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_net.h> #include "ena_com.h"
drivers/net/enic/enic_ethdev.c +1 -1
@@ -6,7 +6,7 @@#include <stdio.h> #include <stdint.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_pci.h> #include <bus_pci_driver.h> #include <ethdev_driver.h>
drivers/net/enic/enic_vf_representor.c +1 -1
@@ -7,7 +7,7 @@#include <bus_pci_driver.h> #include <rte_common.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_flow_driver.h>
drivers/net/failsafe/failsafe_private.h +1 -1
@@ -11,7 +11,7 @@#include <pthread.h> #include <rte_atomic.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <ethdev_driver.h> #include <rte_devargs.h> #include <rte_flow.h>
drivers/net/fm10k/fm10k_ethdev.c +1 -1
@@ -7,7 +7,7 @@#include <rte_malloc.h> #include <rte_memzone.h> #include <rte_string_fns.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_spinlock.h> #include <rte_kvargs.h> #include <rte_vect.h>
drivers/net/i40e/i40e_ethdev.c +1 -1
@@ -23,7 +23,7 @@#include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_alarm.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_tailq.h> #include <rte_hash_crc.h> #include <rte_bitmap.h>
drivers/net/iavf/iavf_ethdev.c +1 -1
@@ -24,7 +24,7 @@#include <ethdev_pci.h> #include <rte_malloc.h> #include <rte_memzone.h> -#include <rte_dev.h> +#include <dev_driver.h> #include "iavf.h" #include "iavf_rxtx.h"
drivers/net/iavf/iavf_vchnl.c +1 -1
@@ -19,7 +19,7 @@#include <rte_ether.h> #include <ethdev_driver.h> #include <ethdev_pci.h> -#include <rte_dev.h> +#include <dev_driver.h> #include "iavf.h" #include "iavf_rxtx.h"
drivers/net/ice/ice_dcf.c +1 -1
@@ -21,7 +21,7 @@#include <ethdev_pci.h> #include <rte_malloc.h> #include <rte_memzone.h> -#include <rte_dev.h> +#include <dev_driver.h> #include "ice_dcf.h" #include "ice_rxtx.h"
drivers/net/ice/ice_dcf_ethdev.c +1 -1
@@ -18,7 +18,7 @@#include <rte_kvargs.h> #include <rte_malloc.h> #include <rte_memzone.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <iavf_devids.h>
drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
@@ -30,7 +30,7 @@#include <ethdev_pci.h> #include <rte_malloc.h> #include <rte_random.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_hash_crc.h> #ifdef RTE_LIB_SECURITY #include <rte_security_driver.h>
drivers/net/ixgbe/ixgbe_flow.c +1 -1
@@ -27,7 +27,7 @@#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_random.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_hash_crc.h> #include <rte_flow.h> #include <rte_flow_driver.h>
drivers/net/mlx4/mlx4.c +1 -1
@@ -31,7 +31,7 @@#endif #include <rte_common.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_errno.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
drivers/net/netvsc/hn_ethdev.c +1 -1
@@ -30,7 +30,7 @@#include <rte_errno.h> #include <rte_memory.h> #include <rte_eal.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <bus_driver.h> #include <bus_vmbus_driver.h> #include <rte_alarm.h>
drivers/net/netvsc/hn_nvs.c +1 -1
@@ -28,7 +28,7 @@#include <rte_cycles.h> #include <rte_memory.h> #include <rte_eal.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <bus_vmbus_driver.h> #include "hn_logs.h"
drivers/net/netvsc/hn_rndis.c +1 -1
@@ -26,7 +26,7 @@#include <rte_cycles.h> #include <rte_memory.h> #include <rte_eal.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <bus_vmbus_driver.h> #include "hn_logs.h"
drivers/net/netvsc/hn_rxtx.c +1 -1
@@ -25,7 +25,7 @@#include <rte_errno.h> #include <rte_memory.h> #include <rte_eal.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_net.h> #include <bus_vmbus_driver.h> #include <rte_spinlock.h>
drivers/net/nfp/nfp_common.c +1 -1
@@ -19,7 +19,7 @@#include <rte_debug.h> #include <ethdev_driver.h> #include <ethdev_pci.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_ether.h> #include <rte_malloc.h> #include <rte_memzone.h>
drivers/net/nfp/nfp_ethdev.c +1 -1
@@ -16,7 +16,7 @@#include <rte_common.h> #include <ethdev_driver.h> #include <ethdev_pci.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_ether.h> #include <rte_malloc.h> #include <rte_memzone.h>
drivers/net/octeontx/octeontx_ethdev.c +1 -1
@@ -15,7 +15,7 @@#include <bus_vdev_driver.h> #include <rte_cycles.h> #include <rte_debug.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_devargs.h> #include <rte_kvargs.h> #include <rte_malloc.h>
drivers/net/qede/qede_ethdev.h +1 -1
@@ -13,7 +13,7 @@#include <rte_ether.h> #include <ethdev_driver.h> #include <ethdev_pci.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_ip.h> /* ecore includes */
drivers/net/sfc/sfc_ethdev.c +1 -1
@@ -7,7 +7,7 @@* for Solarflare) and Solarflare Communications, Inc. */ -#include <rte_dev.h> +#include <dev_driver.h> #include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_pci.h>
drivers/net/sfc/sfc_sw_stats.c +1 -1
@@ -2,7 +2,7 @@* * Copyright(c) 2021 Xilinx, Inc. */ -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_bitmap.h> #include "sfc.h"
drivers/net/sfc/sfc_sw_stats.h +1 -1
@@ -5,7 +5,7 @@#ifndef _SFC_SW_STATS_H#define _SFC_SW_STATS_H -#include <rte_dev.h> +#include <dev_driver.h> #include "sfc.h"
drivers/net/thunderx/nicvf_ethdev.c +1 -1
@@ -20,7 +20,7 @@#include <rte_common.h> #include <rte_cycles.h> #include <rte_debug.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_eal.h> #include <rte_ether.h> #include <ethdev_driver.h>
drivers/net/vdev_netvsc/vdev_netvsc.c +1 -1
@@ -27,7 +27,7 @@#include <bus_driver.h> #include <bus_vdev_driver.h> #include <rte_common.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_errno.h> #include <rte_ethdev.h> #include <rte_ether.h>
drivers/net/virtio/virtio_ethdev.c +1 -1
@@ -24,7 +24,7 @@#include <rte_memory.h> #include <rte_eal_paging.h> #include <rte_eal.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/net/virtio/virtio_pci_ethdev.c +1 -1
@@ -16,7 +16,7 @@#include <rte_memory.h> #include <rte_eal.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_kvargs.h> #include "virtio.h"
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -30,7 +30,7 @@#include <ethdev_pci.h> #include <rte_string_fns.h> #include <rte_malloc.h> -#include <rte_dev.h> +#include <dev_driver.h> #include "base/vmxnet3_defs.h"
drivers/raw/cnxk_bphy/cnxk_bphy.c +1 -1
@@ -3,7 +3,7 @@*/ #include <bus_pci_driver.h> #include <rte_common.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_eal.h> #include <rte_lcore.h> #include <rte_pci.h>
drivers/raw/skeleton/skeleton_rawdev.c +1 -1
@@ -13,7 +13,7 @@#include <rte_byteorder.h> #include <rte_common.h> #include <rte_debug.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_eal.h> #include <rte_kvargs.h> #include <rte_log.h>
drivers/raw/skeleton/skeleton_rawdev_test.c +1 -1
@@ -6,7 +6,7 @@#include <rte_mbuf.h> #include <rte_malloc.h> #include <rte_memcpy.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_rawdev.h> #include <bus_vdev_driver.h> #include <rte_test.h>
drivers/regex/mlx5/mlx5_regex_control.c +1 -1
@@ -11,7 +11,7 @@#include <rte_regexdev.h> #include <rte_regexdev_core.h> #include <rte_regexdev_driver.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <mlx5_common.h> #include <mlx5_glue.h>
lib/compressdev/rte_compressdev.c +1 -1
@@ -8,7 +8,7 @@#include <rte_string_fns.h> #include <rte_malloc.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_eal.h> #include <rte_memzone.h>
lib/compressdev/rte_compressdev_pmd.c +1 -1
@@ -5,7 +5,7 @@#include <rte_string_fns.h> #include <rte_malloc.h> #include <rte_kvargs.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_eal.h> #include "rte_compressdev_internal.h"
lib/compressdev/rte_compressdev_pmd.h +1 -0
@@ -19,6 +19,7 @@ extern "C" {#include <string.h> +#include <dev_driver.h> #include "rte_compressdev.h" #include "rte_compressdev_internal.h"
lib/cryptodev/cryptodev_pmd.c +1 -1
@@ -4,7 +4,7 @@#include <sys/queue.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_errno.h> #include <rte_string_fns.h> #include <rte_malloc.h>
lib/cryptodev/cryptodev_pmd.h +1 -0
@@ -19,6 +19,7 @@ extern "C" {#include <string.h> +#include <dev_driver.h> #include <rte_malloc.h> #include <rte_log.h> #include <rte_common.h>
lib/cryptodev/rte_cryptodev.c +1 -1
@@ -13,7 +13,7 @@#include <rte_log.h> #include <rte_debug.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_memory.h> #include <rte_memcpy.h> #include <rte_memzone.h>
lib/dmadev/rte_dmadev_pmd.h +1 -1
@@ -14,7 +14,7 @@* by any application. */ -#include <rte_dev.h> +#include <dev_driver.h> #include "rte_dmadev.h"
lib/eal/common/eal_common_dev.c +1 -1
@@ -9,7 +9,7 @@#include <bus_driver.h> #include <rte_class.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_devargs.h> #include <rte_errno.h> #include <rte_log.h>
lib/eal/include/dev_driver.h new file +28 -0
@@ -0,0 +1,28 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright (c) 2022 Red Hat, Inc. +*/ + +#ifndef DEV_DRIVER_H +#define DEV_DRIVER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <rte_common.h> +#include <rte_dev.h> + +/** +* A structure describing a device driver. +*/ +struct rte_driver { +RTE_TAILQ_ENTRY (rte_driver) next;/**< Next in list. */ +const char *name;/**< Driver name. */ +const char *alias;/**< Driver alias. */ +}; + +#ifdef __cplusplus +} +#endif + +#endif /* DEV_DRIVER_H */
lib/eal/include/meson.build +1 -0
@@ -57,6 +57,7 @@ headers += files( driver_sdk_headers = files( 'bus_driver.h', + 'dev_driver.h', ) # special case install the generic headers, since they go in a subdir
lib/eal/include/rte_dev.h +2 -13
@@ -24,6 +24,8 @@ extern "C" {#include <rte_compat.h> #include <rte_log.h> +struct rte_driver ; +/** * The device event type. */
@@ -67,27 +69,14 @@ struct rte_mem_resource {void *addr;/**< Virtual address, NULL when not mapped. */ }; -/** -* A structure describing a device driver. -*/ -struct rte_driver { -RTE_TAILQ_ENTRY (rte_driver) next;/**< Next in list. */ -const char *name;/**< Driver name. */ -const char *alias;/**< Driver alias. */ -}; -/** * Retrieve a driver name. * -* @warning -* @b EXPERIMENTAL: this API may change without prior notice -* * @param driver * A pointer to a driver structure. * @return * A pointer to the driver name string. */ -__rte_experimental const char *rte_driver_name (const struct rte_driver *driver);
lib/eal/version.map +1 -3
@@ -37,6 +37,7 @@ DPDK_23 { rte_devargs_parsef; rte_devargs_remove; rte_devargs_type_count; + rte_driver_name; rte_dump_physmem_layout; rte_dump_stack; rte_dump_tailq;
@@ -423,9 +424,6 @@ EXPERIMENTAL { rte_thread_self; rte_thread_set_affinity_by_id; rte_thread_set_priority; - - # added in 22.11 - rte_driver_name; }; INTERNAL {
lib/ethdev/ethdev_driver.h +1 -0
@@ -19,6 +19,7 @@ extern "C" {* */ +#include <dev_driver.h> #include <rte_ethdev.h> /**
lib/eventdev/eventdev_pmd.h +1 -1
@@ -22,7 +22,7 @@ extern "C" {#include <rte_common.h> #include <rte_compat.h> #include <rte_config.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_log.h> #include <rte_malloc.h> #include <rte_mbuf.h>
lib/eventdev/rte_event_crypto_adapter.c +1 -1
@@ -6,7 +6,7 @@#include <string.h> #include <stdbool.h> #include <rte_common.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_errno.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h>
lib/eventdev/rte_event_eth_rx_adapter.c +1 -1
@@ -9,7 +9,7 @@#include <rte_cycles.h> #include <rte_common.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_errno.h> #include <ethdev_driver.h> #include <rte_log.h>
lib/eventdev/rte_eventdev.c +1 -1
@@ -12,7 +12,7 @@#include <rte_string_fns.h> #include <rte_log.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_memzone.h> #include <rte_eal.h> #include <rte_common.h>
lib/gpudev/gpudev_driver.h +1 -1
@@ -14,7 +14,7 @@#include <stdint.h> #include <sys/queue.h> -#include <rte_dev.h> +#include <dev_driver.h> #include "rte_gpudev.h"
lib/mempool/rte_mempool_ops.c +1 -1
@@ -9,7 +9,7 @@#include <rte_string_fns.h> #include <rte_mempool.h> #include <rte_errno.h> -#include <rte_dev.h> +#include <dev_driver.h> #include "rte_mempool_trace.h"
lib/pcapng/rte_pcapng.c +1 -1
@@ -14,7 +14,7 @@#include <bus_driver.h> #include <rte_common.h> #include <rte_cycles.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_errno.h> #include <rte_ethdev.h> #include <rte_ether.h>
lib/rawdev/rte_rawdev.c +1 -1
@@ -12,7 +12,7 @@#include <rte_string_fns.h> #include <rte_log.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_common.h> #include <rte_malloc.h> #include <rte_telemetry.h>
lib/rawdev/rte_rawdev_pmd.h +1 -1
@@ -19,7 +19,7 @@ extern "C" {#include <string.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_malloc.h> #include <rte_log.h> #include <rte_common.h>
lib/security/rte_security.c +1 -1
@@ -5,7 +5,7 @@*/ #include <rte_cryptodev.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_telemetry.h> #include "rte_security.h" #include "rte_security_driver.h"
Signature · 1 line
2.37.3
PATCH v6 24/27 dev: introduce device accessors
In reply to David MarchandPrepare for making the device object opaque by adding accessors. Update existing "external" users.
---
Changes since v4:
- updated test_vdev.c,
Changes since RFC v2:
- added rte_dev_devargs,
- updated testpmd,
--- app/proc-info/main.c | 6 +-- app/test-pmd/config.c | 18 +++---- app/test-pmd/testpmd.c | 6 +-- app/test/test_vdev.c | 4 +- examples/ethtool/lib/rte_ethtool.c | 2 +- examples/l3fwd/l3fwd_em.c | 4 +- examples/l3fwd/l3fwd_fib.c | 8 +-- examples/l3fwd/l3fwd_lpm.c | 4 +- examples/vdpa/main.c | 16 +++--- lib/eal/common/eal_common_dev.c | 30 ++++++++++++ lib/eal/include/rte_dev.h | 78 ++++++++++++++++++++++++++++++ lib/eal/version.map | 7 +++ lib/ethdev/rte_ethdev.h | 2 +- 13 files changed, 150 insertions(+), 35 deletions(-)
app/proc-info/main.c +3 -3
@@ -755,7 +755,7 @@ show_port(void) }printf ("\t -- driver %s device %s socket %d\n" , - dev_info.driver_name, dev_info.device->name, + dev_info.driver_name,rte_dev_name (dev_info.device),rte_eth_dev_socket_id (i)); ret =rte_eth_dev_owner_get (i, &owner);
@@ -1254,7 +1254,7 @@ show_crypto(void)rte_cryptodev_name_get (i), dev_info.driver_name, dev_info.driver_id, - dev_info.device->numa_node, +rte_dev_numa_node (dev_info.device), rte_cryptodev_queue_pair_count(i));display_crypto_feature_info (dev_info.feature_flags);
@@ -1466,7 +1466,7 @@ dump_regs(char *file_prefix)else printf ("Device (%s) regs dumped successfully, " "driver:%s version:0X%08X\n" , - dev_info.device->name, +rte_dev_name (dev_info.device), dev_info.driver_name, reg_info.version);fclose (fp_regs);
app/test-pmd/config.c +9 -9
@@ -645,19 +645,19 @@ device_infos_display(const char *identifier)snprintf (devstr,sizeof (devstr),"bus=%s" ,rte_bus_name (next)); RTE_DEV_FOREACH(dev, devstr, &dev_iter) { -if (!dev->driver) +if (rte_dev_driver (dev) ==NULL )continue ;/* Check for matching device if identifier is present */ if (identifier && -strncmp (da.name, dev->name,strlen (dev->name))) +strncmp (da.name,rte_dev_name (dev),strlen (rte_dev_name (dev))))continue ;printf ("\n%s Infos for device %s %s\n" , - info_border, dev->name, info_border); -printf ("Bus name: %s" ,rte_bus_name (dev->bus)); -printf ("\nDriver name: %s" ,rte_driver_name (dev->driver)); + info_border,rte_dev_name (dev), info_border); +printf ("Bus name: %s" ,rte_bus_name (rte_dev_bus (dev))); +printf ("\nDriver name: %s" ,rte_driver_name (rte_dev_driver (dev)));printf ("\nDevargs: %s" , - dev->devargs ? dev->devargs->args :"" ); -printf ("\nConnect to socket: %d" , dev->numa_node); +rte_dev_devargs (dev) ?rte_dev_devargs (dev)->args :"" ); +printf ("\nConnect to socket: %d" ,rte_dev_numa_node (dev));printf ("\n" );/* List ports with matching device name */
@@ -802,8 +802,8 @@ port_infos_display(portid_t port_id)else printf ("\nFirmware-version: %s" ,"not available" ); -if (dev_info.device->devargs && dev_info.device->devargs->args) -printf ("\nDevargs: %s" , dev_info.device->devargs->args); +if (rte_dev_devargs (dev_info.device) &&rte_dev_devargs (dev_info.device)->args) +printf ("\nDevargs: %s" ,rte_dev_devargs (dev_info.device)->args);printf ("\nConnect to socket: %u" , port->socket_id);if (port_numa[port_id] !=NUMA_NO_CONFIG ) {
app/test-pmd/testpmd.c +3 -3
@@ -1057,7 +1057,7 @@ dma_unmap_cb(struct rte_mempool *mp __rte_unused, void *opaque __rte_unused,TESTPMD_LOG (DEBUG ,"unable to DMA unmap addr 0x%p " "for device %s\n" , - memhdr->addr, dev_info.device->name); + memhdr->addr,rte_dev_name (dev_info.device)); } } ret =rte_extmem_unregister (memhdr->addr, memhdr->len);
@@ -1098,7 +1098,7 @@ dma_map_cb(struct rte_mempool *mp __rte_unused, void *opaque __rte_unused,TESTPMD_LOG (DEBUG ,"unable to DMA map addr 0x%p " "for device %s\n" , - memhdr->addr, dev_info.device->name); + memhdr->addr,rte_dev_name (dev_info.device)); } } }
@@ -3441,7 +3441,7 @@ detach_device(struct rte_device *dev) }if (rte_dev_remove (dev) <0 ) { -TESTPMD_LOG (ERR ,"Failed to detach device %s\n" , dev->name); +TESTPMD_LOG (ERR ,"Failed to detach device %s\n" ,rte_dev_name (dev));return ; }remove_invalid_ports ();
app/test/test_vdev.c +2 -2
@@ -23,7 +23,7 @@ static const char * const valid_keys[] = {static int cmp_dev_name (const struct rte_device *dev,const void *name) { -return strcmp (dev->name, name); +return strcmp (rte_dev_name (dev), name); } static int
@@ -39,7 +39,7 @@ cmp_dev_match(const struct rte_device *dev, const void *_kvlist)/* if key is present in kvlist and does not match, filter device */ name =rte_kvargs_get (kvlist, key); -if (name !=NULL &&strcmp (name, dev->name)) +if (name !=NULL &&strcmp (name,rte_dev_name (dev)) !=0 )return -1 ;return 0 ;
examples/ethtool/lib/rte_ethtool.c +1 -1
@@ -49,7 +49,7 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo)strlcpy (drvinfo->driver, dev_info.driver_name,sizeof (drvinfo->driver));strlcpy (drvinfo->version,rte_version (),sizeof (drvinfo->version)); -strlcpy (drvinfo->bus_info, dev_info.device->name, +strlcpy (drvinfo->bus_info,rte_dev_name (dev_info.device),sizeof (drvinfo->bus_info));memset (®_info,0 ,sizeof (reg_info));
examples/l3fwd/l3fwd_em.c +2 -2
@@ -403,7 +403,7 @@ populate_ipv4_flow_into_table(const struct rte_hash *h) em_route_base_v4[i].v4_key.port_dst, em_route_base_v4[i].v4_key.port_src, em_route_base_v4[i].v4_key.proto, - em_route_base_v4[i].if_out, dev_info.device->name); + em_route_base_v4[i].if_out, rte_dev_name(dev_info.device)); }printf ("Hash: Adding 0x%" PRIx64" keys\n" , (uint64_t )route_num_v4);
@@ -455,7 +455,7 @@ populate_ipv6_flow_into_table(const struct rte_hash *h) em_route_base_v6[i].v6_key.port_dst, em_route_base_v6[i].v6_key.port_src, em_route_base_v6[i].v6_key.proto, - em_route_base_v6[i].if_out, dev_info.device->name); + em_route_base_v6[i].if_out, rte_dev_name(dev_info.device)); }printf ("Hash: Adding 0x%" PRIx64"keys\n" , (uint64_t )route_num_v6);
examples/l3fwd/l3fwd_fib.c +4 -4
@@ -640,11 +640,11 @@ setup_fib(const int socketid)printf ("FIB: Adding route %s / %d (%d) [%s]\n" , abuf, route_base_v4[i].depth, route_base_v4[i].if_out, - dev_info.device->name); +rte_dev_name (dev_info.device)); }else {printf ("FIB: IPv4 route added to port %d [%s]\n" , route_base_v4[i].if_out, - dev_info.device->name); +rte_dev_name (dev_info.device)); } }/* >8 End of setup fib. */
@@ -695,11 +695,11 @@ setup_fib(const int socketid)printf ("FIB: Adding route %s / %d (%d) [%s]\n" , abuf, route_base_v6[i].depth, route_base_v6[i].if_out, - dev_info.device->name); +rte_dev_name (dev_info.device)); }else {printf ("FIB: IPv6 route added to port %d [%s]\n" , route_base_v6[i].if_out, - dev_info.device->name); +rte_dev_name (dev_info.device)); } } }
examples/l3fwd/l3fwd_lpm.c +2 -2
@@ -598,7 +598,7 @@ setup_lpm(const int socketid)printf ("LPM: Adding route %s / %d (%d) [%s]\n" ,inet_ntop (AF_INET , &in, abuf,sizeof (abuf)), route_base_v4[i].depth, - route_base_v4[i].if_out, dev_info.device->name); + route_base_v4[i].if_out,rte_dev_name (dev_info.device)); }/* create the LPM6 table */
@@ -642,7 +642,7 @@ setup_lpm(const int socketid)inet_ntop (AF_INET6 , route_base_v6[i].ip_8, abuf,sizeof (abuf)), route_base_v6[i].depth, - route_base_v6[i].if_out, dev_info.device->name); + route_base_v6[i].if_out, rte_dev_name(dev_info.device)); } }
examples/vdpa/main.c +8 -8
@@ -119,7 +119,7 @@ new_device(int vid) "Failed to get generic device for port %d\n", i);continue ; } -printf ("\nnew port %s, device : %s\n" , ifname, dev->name); +printf ("\nnew port %s, device : %s\n" , ifname,rte_dev_name (dev)); vports[i].vid = vid;break ; }
@@ -149,7 +149,7 @@ destroy_device(int vid)continue ; } -printf ("\ndestroy port %s, device: %s\n" , ifname, dev->name); +printf ("\ndestroy port %s, device: %s\n" , ifname,rte_dev_name (dev));break ; } }
@@ -353,23 +353,23 @@ static void cmd_list_vdpa_devices_parsed(cmdline_printf (cl,"device name\tqueue num\tsupported features\n" ); RTE_DEV_FOREACH(dev, "class=vdpa", &dev_iter) { - vdev =rte_vdpa_find_device_by_name (dev->name); + vdev =rte_vdpa_find_device_by_name (rte_dev_name (dev));if (!vdev)continue ;if (rte_vdpa_get_queue_num (vdev, &queue_num) <0 ) {RTE_LOG (ERR ,VDPA ,"failed to get vdpa queue number " -"for device %s.\n" , dev->name); +"for device %s.\n" ,rte_dev_name (dev));continue ; }if (rte_vdpa_get_features (vdev, &features) <0 ) {RTE_LOG (ERR ,VDPA ,"failed to get vdpa features " -"for device %s.\n" , dev->name); +"for device %s.\n" ,rte_dev_name (dev));continue ; }cmdline_printf (cl,"%s\t\t%" PRIu32"\t\t0x%" PRIx64"\n" , - dev->name, queue_num, features); +rte_dev_name (dev), queue_num, features); } }
@@ -606,10 +606,10 @@ main(int argc, char *argv[])cmdline_stdin_exit (cl); }else { RTE_DEV_FOREACH(dev, "class=vdpa", &dev_iter) { - vdev =rte_vdpa_find_device_by_name (dev->name); + vdev =rte_vdpa_find_device_by_name (rte_dev_name (dev));if (vdev ==NULL ) {rte_panic ("Failed to find vDPA dev for %s\n" , - dev->name); +rte_dev_name (dev)); } vports[devcnt].dev = vdev; snprintf(vports[devcnt].ifname, MAX_PATH_LEN, "%s%d",
lib/eal/common/eal_common_dev.c +30 -0
@@ -25,6 +25,36 @@ rte_driver_name(const struct rte_driver *driver)return driver->name; } +const struct rte_bus * +rte_dev_bus (const struct rte_device *dev) +{ +return dev->bus; +} + +const struct rte_devargs * +rte_dev_devargs (const struct rte_device *dev) +{ +return dev->devargs; +} + +const struct rte_driver * +rte_dev_driver (const struct rte_device *dev) +{ +return dev->driver; +} + +const char * +rte_dev_name (const struct rte_device *dev) +{ +return dev->name; +} + +int +rte_dev_numa_node (const struct rte_device *dev) +{ +return dev->numa_node; +} +/** * The device event callback description. *
lib/eal/include/rte_dev.h +78 -0
90 lines not on this page · raw message
lib/eal/version.map +7 -0
@@ -424,6 +424,13 @@ EXPERIMENTAL { rte_thread_self; rte_thread_set_affinity_by_id; rte_thread_set_priority; + + # added in 22.11 + rte_dev_bus; + rte_dev_devargs; + rte_dev_driver; + rte_dev_name; + rte_dev_numa_node; }; INTERNAL {
lib/ethdev/rte_ethdev.h +1 -1
@@ -3380,7 +3380,7 @@ int rte_eth_macaddrs_get(uint16_t port_id, struct rte_ether_addr *ma,* exists for the device and the rte_eth_dev 'dev' has been populated * successfully with a call to it: * -* driver_name = rte_driver_name(dev->device->driver) +* driver_name = rte_driver_name(rte_dev_driver(dev->device)); * nb_rx_queues = dev->data->nb_rx_queues * nb_tx_queues = dev->data->nb_tx_queues * dev_flags = &dev->data->dev_flags
Signature · 1 line
2.37.3
PATCH v6 25/27 dev: provide bus specific information
In reply to David MarchandFor diagnostic, it may be useful to provide a description of the device with bus specific information.
---
Changes since RFC v3:
- split patch in two, as per Thomas offlist request,
--- app/test-pmd/config.c | 2 ++ lib/eal/common/eal_common_dev.c | 6 ++++++ lib/eal/include/rte_dev.h | 16 ++++++++++++++++ lib/eal/version.map | 1 + 4 files changed, 25 insertions(+)
app/test-pmd/config.c +2 -0
@@ -654,6 +654,8 @@ device_infos_display(const char *identifier)printf ("\n%s Infos for device %s %s\n" , info_border,rte_dev_name (dev), info_border);printf ("Bus name: %s" ,rte_bus_name (rte_dev_bus (dev))); +printf ("\nBus information: %s" , +rte_dev_bus_info (dev) ?rte_dev_bus_info (dev) :"" );printf ("\nDriver name: %s" ,rte_driver_name (rte_dev_driver (dev)));printf ("\nDevargs: %s" ,rte_dev_devargs (dev) ?rte_dev_devargs (dev)->args :"" );
lib/eal/common/eal_common_dev.c +6 -0
@@ -31,6 +31,12 @@ rte_dev_bus(const struct rte_device *dev)return dev->bus; } +const char * +rte_dev_bus_info (const struct rte_device *dev) +{ +return dev->bus_info; +} +const struct rte_devargs *rte_dev_devargs (const struct rte_device *dev) {
lib/eal/include/rte_dev.h +16 -0
@@ -98,6 +98,21 @@ __rte_experimentalconst struct rte_bus *rte_dev_bus (const struct rte_device *dev); +/** +* Retrieve bus specific information for a device. +* +* @warning +* @b EXPERIMENTAL: this API may change without prior notice +* +* @param dev +* A pointer to a device structure. +* @return +* A string describing this device or NULL if none is available. +*/ +__rte_experimental +const char * +rte_dev_bus_info (const struct rte_device *dev); +/** * Retrieve a device arguments. *
@@ -170,6 +185,7 @@ rte_dev_numa_node(const struct rte_device *dev);struct rte_device {RTE_TAILQ_ENTRY (rte_device) next;/**< Next device */ const char *name;/**< Device name */ +const char *bus_info;/**< Device bus specific information */ const struct rte_driver *driver;/**< Driver assigned after probing */ const struct rte_bus *bus;/**< Bus handle assigned on scan */ int numa_node;/**< NUMA node connection */
lib/eal/version.map +1 -0
@@ -427,6 +427,7 @@ EXPERIMENTAL { # added in 22.11 rte_dev_bus; + rte_dev_bus_info; rte_dev_devargs; rte_dev_driver; rte_dev_name;
Signature · 1 line
2.37.3
PATCH v6 26/27 bus/pci: fill bus specific information
In reply to David MarchandFor diagnostic, it may be useful to provide the PCI vendor and device id.
---
Changes since v5:
- fixed Windows build issue (bis...),
Changes since v4:
- fixed Windows build issue (missing asprintf implementation),
--- drivers/bus/pci/bsd/pci.c | 8 +++--- drivers/bus/pci/bus_pci_driver.h | 1 + drivers/bus/pci/linux/pci.c | 24 ++++++++-------- drivers/bus/pci/pci_common.c | 49 ++++++++++++++++++++++++++++++-- drivers/bus/pci/private.h | 10 +++++-- drivers/bus/pci/windows/pci.c | 6 ++-- 6 files changed, 75 insertions(+), 23 deletions(-)
drivers/bus/pci/bsd/pci.c +4 -4
@@ -248,7 +248,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)/* FreeBSD has no NUMA support (yet) */ dev->device.numa_node =0 ; -pci_name_set (dev); +pci_common_set (dev);/* FreeBSD has only one pass through driver */ dev->kdrv =RTE_PCI_KDRV_NIC_UIO ;
@@ -299,11 +299,11 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf) }else {/* already registered */ dev2->kdrv = dev->kdrv; dev2->max_vfs = dev->max_vfs; -pci_name_set (dev2); +pci_common_set (dev2);memmove (dev2->mem_resource, dev->mem_resource,sizeof (dev->mem_resource)); -free (dev); +pci_free (dev); }return 0 ; }
@@ -313,7 +313,7 @@ pci_scan_one(int dev_pci_fd, struct pci_conf *conf)return 0 ; skipdev: -free (dev); +pci_free (dev);return 0 ; }
drivers/bus/pci/bus_pci_driver.h +1 -0
@@ -43,6 +43,7 @@ struct rte_pci_device {uint16_t max_vfs;/**< sriov enable if not zero */ enum rte_pci_kernel_driver kdrv;/**< Kernel driver passthrough */ char name[PCI_PRI_STR_SIZE +1 ];/**< PCI location (ASCII) */ +char *bus_info;/**< PCI bus specific info */ struct rte_intr_handle *vfio_req_intr_handle;/**< Handler of VFIO request interrupt */ };
drivers/bus/pci/linux/pci.c +12 -12
@@ -226,7 +226,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)/* get vendor id */ snprintf (filename,sizeof (filename),"%s/vendor" , dirname);if (eal_parse_sysfs_value (filename, &tmp) <0 ) { -free (dev); +pci_free (dev);return -1 ; } dev->id.vendor_id = (uint16_t )tmp;
@@ -234,7 +234,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)/* get device id */ snprintf (filename,sizeof (filename),"%s/device" , dirname);if (eal_parse_sysfs_value (filename, &tmp) <0 ) { -free (dev); +pci_free (dev);return -1 ; } dev->id.device_id = (uint16_t )tmp;
@@ -243,7 +243,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)snprintf (filename,sizeof (filename),"%s/subsystem_vendor" , dirname);if (eal_parse_sysfs_value (filename, &tmp) <0 ) { -free (dev); +pci_free (dev);return -1 ; } dev->id.subsystem_vendor_id = (uint16_t )tmp;
@@ -252,7 +252,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)snprintf (filename,sizeof (filename),"%s/subsystem_device" , dirname);if (eal_parse_sysfs_value (filename, &tmp) <0 ) { -free (dev); +pci_free (dev);return -1 ; } dev->id.subsystem_device_id = (uint16_t )tmp;
@@ -261,7 +261,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)snprintf (filename,sizeof (filename),"%s/class" , dirname);if (eal_parse_sysfs_value (filename, &tmp) <0 ) { -free (dev); +pci_free (dev);return -1 ; }/* the least 24 bits are valid: class, subclass, program interface */
@@ -295,13 +295,13 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) dev->device.numa_node =0 ; } -pci_name_set (dev); +pci_common_set (dev);/* parse resources */ snprintf (filename,sizeof (filename),"%s/resource" , dirname);if (pci_parse_sysfs_resource (filename, dev) <0 ) {RTE_LOG (ERR ,EAL ,"%s(): cannot parse resource\n" , __func__); -free (dev); +pci_free (dev);return -1 ; }
@@ -310,7 +310,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) ret =pci_get_kernel_driver_by_path (filename, driver,sizeof (driver));if (ret <0 ) {RTE_LOG (ERR ,EAL ,"Fail to get kernel driver\n" ); -free (dev); +pci_free (dev);return -1 ; }
@@ -324,7 +324,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)else dev->kdrv =RTE_PCI_KDRV_UNKNOWN ; }else { -free (dev); +pci_free (dev);return 0 ; }/* device is valid, add in list (sorted) */
@@ -346,7 +346,7 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr) dev2->kdrv = dev->kdrv; dev2->max_vfs = dev->max_vfs; dev2->id = dev->id; -pci_name_set (dev2); +pci_common_set (dev2);memmove (dev2->mem_resource, dev->mem_resource,sizeof (dev->mem_resource));
@@ -376,10 +376,10 @@ pci_scan_one(const char *dirname, const struct rte_pci_addr *addr)else if (dev2->device.devargs != dev->device.devargs) {rte_devargs_remove (dev2->device.devargs); -pci_name_set (dev2); +pci_common_set (dev2); } } -free (dev); +pci_free (dev); }return 0 ; }
drivers/bus/pci/pci_common.c +47 -2
73 lines not on this page · raw message
drivers/bus/pci/private.h +8 -2
@@ -44,10 +44,16 @@ struct rte_pci_device;int rte_pci_scan (void );/** -* Find the name of a PCI device. +* Set common internal information for a PCI device. */ void -pci_name_set (struct rte_pci_device *dev); +pci_common_set (struct rte_pci_device *dev); + +/** +* Free a PCI device. +*/ +void +pci_free (struct rte_pci_device *dev);/** * Validate whether a device with given PCI address should be ignored or not.
drivers/bus/pci/windows/pci.c +3 -3
@@ -382,7 +382,7 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA device_info_data) dev->id = pci_id; dev->max_vfs =0 ;/* TODO: get max_vfs */ -pci_name_set (dev); +pci_common_set (dev);set_kernel_driver_type (device_info_data, dev);
@@ -410,7 +410,7 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA device_info_data) dev2->max_vfs = dev->max_vfs;memmove (dev2->mem_resource, dev->mem_resource,sizeof (dev->mem_resource)); -free (dev); +pci_free (dev); }return 0 ; }
@@ -419,7 +419,7 @@ pci_scan_one(HDEVINFO dev_info, PSP_DEVINFO_DATA device_info_data)return 0 ; end: -free (dev); +pci_free (dev);return ret; }
Signature · 1 line
2.37.3
PATCH v6 27/27 dev: hide device object
In reply to David MarchandMake rte_device opaque for non internal users.
This will make extending this object possible without breaking the ABI.
Some applications may have been dereferencing rte_device objects, mark this object's accessors as stable.
---
Changes since RFC v2:
- updated release notes,
- marked accessors as stable,
--- doc/guides/rel_notes/deprecation.rst | 7 ----- doc/guides/rel_notes/release_22_11.rst | 4 +-- lib/eal/common/eal_private.h | 2 +- lib/eal/include/dev_driver.h | 13 +++++++++ lib/eal/include/rte_dev.h | 37 -------------------------- lib/eal/version.map | 14 +++++----- lib/vhost/vdpa.c | 1 + 7 files changed, 23 insertions(+), 55 deletions(-)
doc/guides/rel_notes/deprecation.rst +0 -7
@@ -47,13 +47,6 @@ Deprecation Notices * mempool: The mempool API macros ``MEMPOOL_PG_*`` are deprecated and will be removed in DPDK 22.11. -* drivers: As a follow-up of the work on the ``rte_bus`` object, - the ``rte_driver`` and ``rte_device`` objects (and as a domino effect, - their bus-specific counterparts) will be made opaque in DPDK 22.11. - Registering a driver on a bus will be marked as an internal API: - external users may still register their drivers using the bus-specific - driver header (see ``enable_driver_sdk`` meson option). - * bus: The ``dev->device.numa_node`` field is set by each bus driver for every device it manages to indicate on which NUMA node this device lies. When this information is unknown, the assigned value is not consistent
doc/guides/rel_notes/release_22_11.rst +2 -2
@@ -98,8 +98,8 @@ API Changes ``vdev``, ``vmbus`` buses has been marked as an internal API. External users may still register their driver using the associated driver headers (see ``enable_driver_sdk`` meson option). - The ``rte_driver`` object is now opaque and must be manipulated through added - accessors. + The ``rte_driver`` and ``rte_device`` objects are now opaque and must be + manipulated through added accessors. * raw/ifgpa: The function ``rte_pmd_ifpga_get_pci_bus`` has been removed.
lib/eal/common/eal_private.h +1 -1
@@ -10,7 +10,7 @@#include <stdio.h> #include <sys/queue.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_lcore.h> #include <rte_memory.h>
lib/eal/include/dev_driver.h +13 -0
@@ -21,6 +21,19 @@ struct rte_driver {const char *alias;/**< Driver alias. */ }; +/** +* A structure describing a generic device. +*/ +struct rte_device { +RTE_TAILQ_ENTRY (rte_device) next;/**< Next device */ +const char *name;/**< Device name */ +const char *bus_info;/**< Device bus specific information */ +const struct rte_driver *driver;/**< Driver assigned after probing */ +const struct rte_bus *bus;/**< Bus handle assigned on scan */ +int numa_node;/**< NUMA node connection */ +struct rte_devargs *devargs;/**< Arguments for latest probing */ +}; + #ifdef __cplusplus }#endif
lib/eal/include/rte_dev.h +0 -37
@@ -86,90 +86,66 @@ rte_driver_name(const struct rte_driver *driver);/** * Retrieve a device bus. * -* @warning -* @b EXPERIMENTAL: this API may change without prior notice -* * @param dev * A pointer to a device structure. * @return * A pointer to this device bus. */ -__rte_experimental const struct rte_bus *rte_dev_bus (const struct rte_device *dev);/** * Retrieve bus specific information for a device. * -* @warning -* @b EXPERIMENTAL: this API may change without prior notice -* * @param dev * A pointer to a device structure. * @return * A string describing this device or NULL if none is available. */ -__rte_experimental const char *rte_dev_bus_info (const struct rte_device *dev);/** * Retrieve a device arguments. * -* @warning -* @b EXPERIMENTAL: this API may change without prior notice -* * @param dev * A pointer to a device structure. * @return * A pointer to this device devargs. */ -__rte_experimental const struct rte_devargs *rte_dev_devargs (const struct rte_device *dev);/** * Retrieve a device driver. * -* @warning -* @b EXPERIMENTAL: this API may change without prior notice -* * @param dev * A pointer to a device structure. * @return * A pointer to this device driver. */ -__rte_experimental const struct rte_driver *rte_dev_driver (const struct rte_device *dev);/** * Retrieve a device name. * -* @warning -* @b EXPERIMENTAL: this API may change without prior notice -* * @param dev * A pointer to a device structure. * @return * A pointer to this device name. */ -__rte_experimental const char *rte_dev_name (const struct rte_device *dev);/** * Retrieve a device numa node. * -* @warning -* @b EXPERIMENTAL: this API may change without prior notice -* * @param dev * A pointer to a device structure. * @return * A pointer to this device numa node. */ -__rte_experimental int rte_dev_numa_node (const struct rte_device *dev);
@@ -179,19 +155,6 @@ rte_dev_numa_node(const struct rte_device *dev);*/ #define RTE_DEV_NAME_MAX_LEN 64 -/** -* A structure describing a generic device. -*/ -struct rte_device { -RTE_TAILQ_ENTRY (rte_device) next;/**< Next device */ -const char *name;/**< Device name */ -const char *bus_info;/**< Device bus specific information */ -const struct rte_driver *driver;/**< Driver assigned after probing */ -const struct rte_bus *bus;/**< Bus handle assigned on scan */ -int numa_node;/**< NUMA node connection */ -struct rte_devargs *devargs;/**< Arguments for latest probing */ -}; -/** * Query status of a device. *
lib/eal/version.map +6 -8
@@ -26,7 +26,13 @@ DPDK_23 { rte_delay_us_block; rte_delay_us_callback_register; rte_delay_us_sleep; + rte_dev_bus; + rte_dev_bus_info; + rte_dev_devargs; + rte_dev_driver; rte_dev_is_probed; + rte_dev_name; + rte_dev_numa_node; rte_dev_probe; rte_dev_remove; rte_devargs_add;
@@ -424,14 +430,6 @@ EXPERIMENTAL { rte_thread_self; rte_thread_set_affinity_by_id; rte_thread_set_priority; - - # added in 22.11 - rte_dev_bus; - rte_dev_bus_info; - rte_dev_devargs; - rte_dev_driver; - rte_dev_name; - rte_dev_numa_node; }; INTERNAL {
lib/vhost/vdpa.c +1 -0
@@ -10,6 +10,7 @@#include <sys/queue.h> +#include <dev_driver.h> #include <rte_class.h> #include <rte_malloc.h> #include <rte_spinlock.h>
Signature · 1 line
2.37.3
Re: [PATCH v6 00/27] Bus and device cleanup for 22.11
In reply to David MarchandQuoted 21 lines · David Marchand
The
rte_bus,rte_driverandrte_deviceobjects are part of the public ABI and this has proved to be a problem when needing to extend them. This series hides them, and mark associated driver only API as internal.A good amount of the patches are preparation work on
rte_bus.h,rte_dev.h,rte_devargs.handrte_eal.hheaders, removing dependencies between them.PCI bus specific handling are removed from testpmd, unit tests and examples.
After this series, driver-only API headers for registering to buses are not exported anymore, unless the
enable_driver_sdkmeson option is selected.New accessors for
rte_bus,rte_driverandrte_devicehave been added, marked with an experimental tag first when introducing them, and later in the series marked as stable since external users will want to use those drop-in replacements right away.
Quoted 6 lines
A check is added to ensure we won't pollute app/ and examples/ again, though some unit tests are left intentionnally untouched as they test some internals of DPDK.
Changes since v5:
- fixed Windows build (bis...),
I rebased the series and pushed it to main.
I had tested the series against some next-* repositories before. It should be rather painless, but please subtree maintainers, don't wait too much and rebase your trees.
Signature · 1 line
David Marchand