Bus cleanup for 22.11
Subsystems (12)
cover Bus cleanup for 22.11
This is a PoC for hiding the rte_bus object and mark associated API as internal.
A good amount of the patches are preparation work on rte_bus.h, rte_dev.h, rte_devargs.h and rte_eal.h headers, removing dependencies between them. This is something I had in store for some time, maybe I should have dropped it from the PoC, but I think those cleanups are worth it in any case.
The last two patches do the actual job: add accessors and make the rte_bus object opaque to non internal users.
Disclaimer: this series is a bit rushed (I brute forced compilation tests in GHA so that it passes between patches, but there still may be something broken...).
Not surprisingly, the ABI check in the CI is expected to fail.
Comments welcome.
I also hope we can do the same work on other generic objects (rte_driver, rte_device), but this is another story.
Signature · 111 lines
David Marchand David Marchand (11): common/mlx5: rework check on driver registration raw/ifpga: remove PCI bus accessor dev: hide debug messages in device iterator dev: move unrelated macros from header devargs: remove dependency on bus header bus: remove unneded inclusion of bus header bus: move IOVA definition from header drivers/bus: remove back reference to bus objects drivers/bus: hide specific structures bus: introduce accessors bus: hide bus object app/test-compress-perf/comp_perf_options.h | 2 + app/test-pmd/config.c | 10 +- app/test-pmd/testpmd.c | 4 +- app/test-pmd/testpmd.h | 5 +- app/test/test_devargs.c | 6 +- app/test/test_kni.c | 7 +- app/test/test_vdev.c | 1 + drivers/bus/auxiliary/auxiliary_common.c | 2 - drivers/bus/auxiliary/linux/auxiliary.c | 1 - drivers/bus/auxiliary/private.h | 30 +- drivers/bus/auxiliary/rte_bus_auxiliary.h | 5 - drivers/bus/dpaa/dpaa_bus.c | 20 +- drivers/bus/dpaa/rte_dpaa_bus.h | 14 - drivers/bus/fslmc/fslmc_bus.c | 11 +- drivers/bus/fslmc/fslmc_vfio.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dprc.c | 1 + drivers/bus/fslmc/private.h | 27 ++ drivers/bus/fslmc/rte_fslmc.h | 21 -- drivers/bus/ifpga/ifpga_bus.c | 2 +- drivers/bus/ifpga/ifpga_common.c | 1 - drivers/bus/ifpga/rte_bus_ifpga.h | 1 - drivers/bus/pci/bsd/pci.c | 2 - drivers/bus/pci/linux/pci.c | 3 - drivers/bus/pci/pci_common.c | 2 - drivers/bus/pci/private.h | 18 +- drivers/bus/pci/rte_bus_pci.h | 23 -- drivers/bus/pci/windows/pci.c | 1 + drivers/bus/pci/windows/pci_netuio.c | 1 + drivers/bus/vdev/vdev.c | 2 +- drivers/bus/vdev/vdev_params.c | 1 - drivers/bus/vmbus/linux/vmbus_uio.c | 1 - drivers/bus/vmbus/private.h | 18 ++ drivers/bus/vmbus/rte_bus_vmbus.h | 21 -- drivers/bus/vmbus/vmbus_bufring.c | 1 - drivers/bus/vmbus/vmbus_channel.c | 1 - drivers/bus/vmbus/vmbus_common.c | 3 - drivers/bus/vmbus/vmbus_common_uio.c | 1 - .../common/mlx5/linux/mlx5_common_auxiliary.c | 10 +- drivers/common/mlx5/mlx5_common_pci.c | 3 +- drivers/common/qat/qat_device.c | 1 + drivers/compress/qat/qat_comp_pmd.c | 1 + drivers/compress/zlib/zlib_pmd_ops.c | 1 + .../scheduler/rte_cryptodev_scheduler.c | 1 + drivers/crypto/virtio/virtio_pci.c | 1 - drivers/dma/cnxk/cnxk_dmadev.c | 1 - drivers/dma/idxd/idxd_bus.c | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 1 + drivers/net/failsafe/failsafe.c | 3 +- drivers/net/failsafe/failsafe_eal.c | 3 +- drivers/net/ixgbe/rte_pmd_ixgbe.c | 1 + drivers/net/liquidio/lio_ethdev.c | 1 + drivers/net/mlx5/linux/mlx5_os.c | 3 +- drivers/net/netvsc/hn_ethdev.c | 5 +- drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 7 +- drivers/raw/ifpga/ifpga_rawdev.h | 1 - drivers/raw/ifpga/rte_pmd_ifpga.c | 6 - drivers/raw/ifpga/rte_pmd_ifpga.h | 10 - drivers/raw/ifpga/version.map | 1 - examples/ethtool/lib/rte_ethtool.c | 4 +- examples/ip_pipeline/kni.c | 3 +- examples/multi_process/hotplug_mp/commands.c | 6 +- lib/compressdev/rte_compressdev.c | 2 + lib/compressdev/rte_compressdev_pmd.c | 1 + lib/cryptodev/cryptodev_pmd.c | 2 + lib/dmadev/rte_dmadev.c | 1 + lib/eal/common/eal_common_bus.c | 28 +- lib/eal/common/eal_common_dev.c | 15 +- lib/eal/common/eal_common_devargs.c | 14 +- lib/eal/common/eal_thread.h | 1 + lib/eal/common/hotplug_mp.c | 9 +- lib/eal/include/bus_driver.h | 295 ++++++++++++++++++ lib/eal/include/meson.build | 4 + lib/eal/include/rte_bus.h | 290 +---------------- lib/eal/include/rte_common.h | 11 + lib/eal/include/rte_dev.h | 11 - lib/eal/include/rte_devargs.h | 4 +- lib/eal/include/rte_eal.h | 15 +- lib/eal/include/rte_lcore.h | 2 + lib/eal/linux/eal_dev.c | 2 +- lib/eal/version.map | 7 +- lib/eal/windows/eal.c | 1 + lib/ethdev/ethdev_driver.c | 1 + lib/ethdev/ethdev_pci.h | 1 + lib/ethdev/rte_ethdev.c | 11 +- lib/mempool/rte_mempool_ops.c | 1 + lib/pcapng/rte_pcapng.c | 3 +- lib/regexdev/rte_regexdev.c | 1 + lib/security/rte_security.c | 1 + lib/vhost/vdpa.c | 1 + 90 files changed, 554 insertions(+), 531 deletions(-) create mode 100644 drivers/bus/fslmc/private.h create mode 100644 lib/eal/include/bus_driver.h -- 2.36.1
RFC PATCH 1/11 common/mlx5: rework check on driver registration
Rely on a local flag rather than dereference a bus object. This will help next commits.
--- drivers/common/mlx5/linux/mlx5_common_auxiliary.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/common/mlx5/linux/mlx5_common_auxiliary.c +8 -2
@@ -179,14 +179,20 @@ static struct rte_auxiliary_driver mlx5_auxiliary_driver = { .dma_unmap = mlx5_common_auxiliary_dma_unmap, }; +static bool mlx5_common_auxiliary_initialized; +void mlx5_common_auxiliary_init (void ) { -if (mlx5_auxiliary_driver.bus ==NULL ) +if (!mlx5_common_auxiliary_initialized) {rte_auxiliary_register (&mlx5_auxiliary_driver); + mlx5_common_auxiliary_initialized = true; + } }RTE_FINI (mlx5_common_auxiliary_driver_finish) { -if (mlx5_auxiliary_driver.bus !=NULL ) +if (mlx5_common_auxiliary_initialized) {rte_auxiliary_unregister (&mlx5_auxiliary_driver); + mlx5_common_auxiliary_initialized = false; + } }
Signature · 1 line
2.36.1
RFC PATCH 2/11 raw/ifpga: remove PCI bus accessor
In reply to David MarchandThere is no in-tree user for this accessor that returns the PCI bus object.
On the other hand, a bus object can be retrieved by name using rte_bus_find_by_name.
We can remove driver specific API.
--- drivers/raw/ifpga/ifpga_rawdev.c | 7 +------ drivers/raw/ifpga/ifpga_rawdev.h | 1 - drivers/raw/ifpga/rte_pmd_ifpga.c | 6 ------ drivers/raw/ifpga/rte_pmd_ifpga.h | 10 ---------- drivers/raw/ifpga/version.map | 1 - 5 files changed, 1 insertion(+), 24 deletions(-)
drivers/raw/ifpga/ifpga_rawdev.c +1 -6
@@ -10,8 +10,8 @@#include <fcntl.h> #include <sys/ioctl.h> #include <sys/epoll.h> +#include <rte_log.h> -#include <rte_bus.h> #include <rte_malloc.h> #include <rte_devargs.h> #include <rte_memcpy.h>
@@ -1888,11 +1888,6 @@ RTE_PMD_REGISTER_PARAM_STRING(ifpga_rawdev_cfg,"port=<int> " "afu_bts=<path>"); -struct rte_pci_bus *ifpga_get_pci_bus (void ) -{ -return rte_ifpga_rawdev_pmd.bus; -} -int ifpga_rawdev_partial_reconfigure (struct rte_rawdev *dev,int port,const char *file) {
drivers/raw/ifpga/ifpga_rawdev.h +0 -1
@@ -91,7 +91,6 @@ int ifpga_unregister_msix_irq(struct ifpga_rawdev *dev, enum ifpga_irq_type type, int vec_start, rte_intr_callback_fn handler, void *arg); -struct rte_pci_bus *ifpga_get_pci_bus (void );int ifpga_rawdev_partial_reconfigure (struct rte_rawdev *dev,int port,const char *file);void ifpga_rawdev_cleanup (void );
drivers/raw/ifpga/rte_pmd_ifpga.c +0 -6
@@ -402,12 +402,6 @@ rte_pmd_ifpga_reload(uint16_t dev_id, int type, int page)return opae_mgr_reload (adapter->mgr, type, page); } -const struct rte_pci_bus * -rte_pmd_ifpga_get_pci_bus (void ) -{ -return ifpga_get_pci_bus (); -} -int rte_pmd_ifpga_partial_reconfigure (uint16_t dev_id,int port,const char *file) {
drivers/raw/ifpga/rte_pmd_ifpga.h +0 -10
@@ -220,16 +220,6 @@ rte_pmd_ifpga_reboot_try(uint16_t dev_id);int rte_pmd_ifpga_reload (uint16_t dev_id,int type,int page); -/** -* Get PCI bus the Intel FPGA driver register to -* -* @return -* - (valid pointer) if successful. -* - (NULL) if the Intel FPGA driver is not registered to any PCI bus. -*/ -const struct rte_pci_bus * -rte_pmd_ifpga_get_pci_bus (void ); -/** * Perform PR (partial reconfiguration) on specified Intel FPGA device *
drivers/raw/ifpga/version.map +0 -1
@@ -10,7 +10,6 @@ DPDK_22 { rte_pmd_ifpga_stop_update; rte_pmd_ifpga_reboot_try; rte_pmd_ifpga_reload; - rte_pmd_ifpga_get_pci_bus; rte_pmd_ifpga_partial_reconfigure; rte_pmd_ifpga_cleanup;
Signature · 1 line
2.36.1
RFC PATCH 3/11 dev: hide debug messages in device iterator
In reply to David MarchandFor any bus that does not support device iteration, rte_dev_iterator_init both returned an error code and logged an error message.
An application (like testpmd) that only wants to list devices, would have no choice but to inspect a bus object to avoid spewing error logs.
Make those log messages debug level, and remove the check in testpmd.
--- app/test-pmd/config.c | 4 ---- lib/eal/common/eal_common_dev.c | 7 +++---- 2 files changed, 3 insertions(+), 8 deletions(-)
app/test-pmd/config.c +0 -4
@@ -612,10 +612,6 @@ device_infos_display(const char *identifier)if (identifier && da.bus != next)continue ; -/* Skip buses that don't have iterate method */ -if (!next->dev_iterate) -continue ; -snprintf (devstr,sizeof (devstr),"bus=%s" , next->name); RTE_DEV_FOREACH(dev, devstr, &dev_iter) {
lib/eal/common/eal_common_dev.c +3 -4
@@ -592,18 +592,17 @@ rte_dev_iterator_init(struct rte_dev_iterator *it,* one layer specified. */ if (bus ==NULL && cls ==NULL ) { -RTE_LOG (ERR ,EAL , -"Either bus or class must be specified.\n" ); +RTE_LOG (DEBUG ,EAL ,"Either bus or class must be specified.\n" ); rte_errno =EINVAL ; goto get_out; }if (bus !=NULL && bus->dev_iterate ==NULL ) { -RTE_LOG (ERR ,EAL ,"Bus %s not supported\n" , bus->name); +RTE_LOG (DEBUG ,EAL ,"Bus %s not supported\n" , bus->name); rte_errno =ENOTSUP ; goto get_out; }if (cls !=NULL && cls->dev_iterate ==NULL ) { -RTE_LOG (ERR ,EAL ,"Class %s not supported\n" , cls->name); +RTE_LOG (DEBUG ,EAL ,"Class %s not supported\n" , cls->name); rte_errno =ENOTSUP ; goto get_out; }
Signature · 1 line
2.36.1
RFC PATCH 4/11 dev: move unrelated macros from header
In reply to David MarchandRTE_FUNC_PTR_OR_* macros have nothing to do with the rte_device object and associated API.
Move them to rte_common.h and include it where needed.
--- drivers/common/qat/qat_device.c | 1 + drivers/compress/qat/qat_comp_pmd.c | 1 + drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 1 + drivers/net/ixgbe/rte_pmd_ixgbe.c | 1 + drivers/net/liquidio/lio_ethdev.c | 1 + lib/compressdev/rte_compressdev.c | 1 + lib/dmadev/rte_dmadev.c | 1 + lib/eal/include/rte_common.h | 11 +++++++++++ lib/eal/include/rte_dev.h | 11 ----------- lib/ethdev/ethdev_driver.c | 1 + lib/ethdev/ethdev_pci.h | 1 + lib/mempool/rte_mempool_ops.c | 1 + lib/regexdev/rte_regexdev.c | 1 + lib/security/rte_security.c | 1 + lib/vhost/vdpa.c | 1 + 15 files changed, 24 insertions(+), 11 deletions(-)
drivers/common/qat/qat_device.c +1 -0
@@ -2,6 +2,7 @@* Copyright(c) 2018-2022 Intel Corporation */ +#include <rte_common.h> #include <rte_string_fns.h> #include <rte_devargs.h> #include <ctype.h>
drivers/compress/qat/qat_comp_pmd.c +1 -0
@@ -2,6 +2,7 @@* Copyright(c) 2015-2022 Intel Corporation */ +#include <rte_common.h> #include <rte_malloc.h> #include "qat_comp.h"
drivers/crypto/scheduler/rte_cryptodev_scheduler.c +1 -0
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ +#include <rte_common.h> #include <rte_string_fns.h> #include <rte_reorder.h> #include <rte_cryptodev.h>
drivers/net/ixgbe/rte_pmd_ixgbe.c +1 -0
@@ -2,6 +2,7 @@* Copyright(c) 2010-2017 Intel Corporation */ +#include <rte_common.h> #include <ethdev_driver.h> #include "base/ixgbe_api.h"
drivers/net/liquidio/lio_ethdev.c +1 -0
@@ -2,6 +2,7 @@* Copyright(c) 2017 Cavium, Inc */ +#include <rte_common.h> #include <rte_string_fns.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
lib/compressdev/rte_compressdev.c +1 -0
@@ -6,6 +6,7 @@#include <stdio.h> #include <inttypes.h> +#include <rte_common.h> #include <rte_string_fns.h> #include <rte_malloc.h> #include <rte_eal.h>
lib/dmadev/rte_dmadev.c +1 -0
@@ -5,6 +5,7 @@#include <inttypes.h> +#include <rte_common.h> #include <rte_eal.h> #include <rte_lcore.h> #include <rte_log.h>
lib/eal/include/rte_common.h +11 -0
@@ -861,6 +861,17 @@ rte_log2_u64(uint64_t v)/** Number of elements in the array. */ #define RTE_DIM (a) (sizeof (a) / sizeof ((a)[0])) +/* Macros to check for invalid function pointers */ +#define RTE_FUNC_PTR_OR_ERR_RET (func, retval) do { \ + if ((func) == NULL) \ + return retval; \ +} while (0) + +#define RTE_FUNC_PTR_OR_RET (func) do { \ + if ((func) == NULL) \ + return; \ +} while (0) +/** * Converts a numeric string to the equivalent uint64_t value. * As well as straight number conversion, also recognises the suffixes
lib/eal/include/rte_dev.h +0 -11
@@ -36,17 +36,6 @@ typedef void (*rte_dev_event_cb_fn)(const char *device_name,enum rte_dev_event_type event, void *cb_arg); -/* Macros to check for invalid function pointers */ -#define RTE_FUNC_PTR_OR_ERR_RET (func, retval) do { \ - if ((func) == NULL) \ - return retval; \ -} while (0) - -#define RTE_FUNC_PTR_OR_RET (func) do { \ - if ((func) == NULL) \ - return; \ -} while (0) -/** * Device policies. */
lib/ethdev/ethdev_driver.c +1 -0
@@ -2,6 +2,7 @@* Copyright(c) 2022 Intel Corporation */ +#include <rte_common.h> #include <rte_kvargs.h> #include <rte_malloc.h>
lib/ethdev/ethdev_pci.h +1 -0
@@ -10,6 +10,7 @@extern "C" {#endif +#include <rte_common.h> #include <rte_malloc.h> #include <rte_pci.h> #include <rte_bus_pci.h>
lib/mempool/rte_mempool_ops.c +1 -0
@@ -6,6 +6,7 @@#include <stdio.h> #include <string.h> +#include <rte_common.h> #include <rte_string_fns.h> #include <rte_mempool.h> #include <rte_errno.h>
lib/regexdev/rte_regexdev.c +1 -0
@@ -5,6 +5,7 @@#include <string.h> +#include <rte_common.h> #include <rte_memzone.h> #include <rte_string_fns.h>
lib/security/rte_security.c +1 -0
@@ -4,6 +4,7 @@* Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved */ +#include <rte_common.h> #include <rte_cryptodev.h> #include <rte_dev.h> #include <rte_telemetry.h>
lib/vhost/vdpa.c +1 -0
@@ -10,6 +10,7 @@#include <sys/queue.h> +#include <rte_common.h> #include <rte_class.h> #include <rte_malloc.h> #include <rte_spinlock.h>
Signature · 1 line
2.36.1
RFC PATCH 5/11 devargs: remove dependency on bus header
In reply to David MarchandWe don't need to include rte_bus.h.
Only a forward declaration of rte_bus and an inclusion of rte_dev.h are needed.
--- app/test/test_vdev.c | 1 + lib/eal/include/rte_devargs.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-)
app/test/test_vdev.c +1 -0
@@ -8,6 +8,7 @@#include <rte_common.h> #include <rte_kvargs.h> +#include <rte_bus.h> #include <rte_bus_vdev.h> #include "test.h"
lib/eal/include/rte_devargs.h +3 -1
@@ -22,7 +22,9 @@ extern "C" {#include <stdio.h> #include <rte_compat.h> -#include <rte_bus.h> +#include <rte_dev.h> + +struct rte_bus ;/** * Bus type key in global devargs syntax.
Signature · 1 line
2.36.1
RFC PATCH 6/11 bus: remove unneeded inclusion of bus header
In reply to David MarchandThose files don't need to include rte_bus.h.
--- drivers/bus/auxiliary/linux/auxiliary.c | 1 - drivers/bus/ifpga/ifpga_common.c | 1 - drivers/bus/ifpga/rte_bus_ifpga.h | 1 - drivers/bus/vdev/vdev_params.c | 1 - drivers/bus/vmbus/linux/vmbus_uio.c | 1 - drivers/bus/vmbus/vmbus_bufring.c | 1 - drivers/bus/vmbus/vmbus_channel.c | 1 - drivers/bus/vmbus/vmbus_common_uio.c | 1 - drivers/crypto/virtio/virtio_pci.c | 1 - drivers/dma/cnxk/cnxk_dmadev.c | 1 - 10 files changed, 10 deletions(-)
drivers/bus/auxiliary/linux/auxiliary.c +0 -1
@@ -6,7 +6,6 @@#include <dirent.h> #include <rte_log.h> -#include <rte_bus.h> #include <rte_malloc.h> #include <rte_devargs.h> #include <rte_memcpy.h>
drivers/bus/ifpga/ifpga_common.c +0 -1
@@ -14,7 +14,6 @@#include <fcntl.h> #include <rte_errno.h> -#include <rte_bus.h> #include <rte_per_lcore.h> #include <rte_memory.h> #include <rte_memzone.h>
drivers/bus/ifpga/rte_bus_ifpga.h +0 -1
@@ -15,7 +15,6 @@extern "C" {#endif /* __cplusplus */ -#include <rte_bus.h> #include <rte_pci.h> #include <rte_interrupts.h> #include <rte_spinlock.h>
drivers/bus/vdev/vdev_params.c +0 -1
@@ -5,7 +5,6 @@#include <string.h> #include <rte_dev.h> -#include <rte_bus.h> #include <rte_kvargs.h> #include <rte_errno.h>
drivers/bus/vmbus/linux/vmbus_uio.c +0 -1
@@ -13,7 +13,6 @@#include <rte_eal.h> #include <rte_log.h> -#include <rte_bus.h> #include <rte_memory.h> #include <rte_common.h> #include <rte_malloc.h>
drivers/bus/vmbus/vmbus_bufring.c +0 -1
@@ -15,7 +15,6 @@#include <rte_tailq.h> #include <rte_log.h> #include <rte_malloc.h> -#include <rte_bus.h> #include <rte_atomic.h> #include <rte_memory.h> #include <rte_pause.h>
drivers/bus/vmbus/vmbus_channel.c +0 -1
@@ -12,7 +12,6 @@#include <rte_tailq.h> #include <rte_log.h> #include <rte_malloc.h> -#include <rte_bus.h> #include <rte_atomic.h> #include <rte_memory.h> #include <rte_bus_vmbus.h>
drivers/bus/vmbus/vmbus_common_uio.c +0 -1
@@ -13,7 +13,6 @@#include <rte_tailq.h> #include <rte_log.h> #include <rte_malloc.h> -#include <rte_bus.h> #include <rte_bus_vmbus.h> #include "private.h"
drivers/crypto/virtio/virtio_pci.c +0 -1
@@ -10,7 +10,6 @@#endif #include <rte_io.h> -#include <rte_bus.h> #include "virtio_pci.h" #include "virtqueue.h"
drivers/dma/cnxk/cnxk_dmadev.c +0 -1
@@ -5,7 +5,6 @@#include <string.h> #include <unistd.h> -#include <rte_bus.h> #include <rte_bus_pci.h> #include <rte_common.h> #include <rte_eal.h>
Signature · 1 line
2.36.1
RFC PATCH 7/11 bus: move IOVA definition from header
In reply to David Marchandiova enum definition does not need to be defined as part of the bus API. Move it to rte_eal.h.
With this step, rte_eal.h does not depend on rte_bus.h and rte_dev.h. Fix existing code that was relying on these implicit inclusions.
--- app/test-compress-perf/comp_perf_options.h | 2 ++ drivers/bus/vmbus/rte_bus_vmbus.h | 1 + drivers/compress/zlib/zlib_pmd_ops.c | 1 + drivers/net/failsafe/failsafe.c | 1 + drivers/net/failsafe/failsafe_eal.c | 1 + examples/multi_process/hotplug_mp/commands.c | 2 ++ lib/compressdev/rte_compressdev.c | 1 + lib/compressdev/rte_compressdev_pmd.c | 1 + lib/cryptodev/cryptodev_pmd.c | 2 ++ lib/eal/common/eal_thread.h | 1 + lib/eal/common/hotplug_mp.c | 1 + lib/eal/include/rte_bus.h | 18 ++---------------- lib/eal/include/rte_eal.h | 15 ++++++++++++++- lib/eal/include/rte_lcore.h | 2 ++ lib/eal/windows/eal.c | 1 + lib/ethdev/rte_ethdev.c | 1 + lib/pcapng/rte_pcapng.c | 1 + 17 files changed, 35 insertions(+), 17 deletions(-)
app/test-compress-perf/comp_perf_options.h +2 -0
@@ -5,6 +5,8 @@#ifndef _COMP_PERF_OPS_#define _COMP_PERF_OPS_ +#include <rte_dev.h> +#define MAX_LIST 32#define MIN_COMPRESSED_BUF_SIZE 8#define EXPANSE_RATIO 1.1
drivers/bus/vmbus/rte_bus_vmbus.h +1 -0
@@ -23,6 +23,7 @@ extern "C" {#include <stdint.h> #include <inttypes.h> +#include <rte_bus.h> #include <rte_compat.h> #include <rte_uuid.h> #include <rte_debug.h>
drivers/compress/zlib/zlib_pmd_ops.c +1 -0
@@ -4,6 +4,7 @@#include <string.h> +#include <rte_dev.h> #include <rte_common.h> #include <rte_malloc.h>
drivers/net/failsafe/failsafe.c +1 -0
@@ -11,6 +11,7 @@#include <ethdev_vdev.h> #include <rte_devargs.h> #include <rte_kvargs.h> +#include <rte_bus.h> #include <rte_bus_vdev.h> #include "failsafe_private.h"
drivers/net/failsafe/failsafe_eal.c +1 -0
@@ -3,6 +3,7 @@* Copyright 2017 Mellanox Technologies, Ltd */ +#include <rte_bus.h> #include <rte_string_fns.h> #include <rte_malloc.h>
examples/multi_process/hotplug_mp/commands.c +2 -0
@@ -8,6 +8,8 @@#include <cmdline_parse_num.h> #include <cmdline_parse_string.h> #include <cmdline.h> + +#include <rte_bus.h> #include <rte_ethdev.h> /**********************************************************/
lib/compressdev/rte_compressdev.c +1 -0
@@ -9,6 +9,7 @@#include <rte_common.h> #include <rte_string_fns.h> #include <rte_malloc.h> +#include <rte_dev.h> #include <rte_eal.h> #include <rte_memzone.h>
lib/compressdev/rte_compressdev_pmd.c +1 -0
@@ -5,6 +5,7 @@#include <rte_string_fns.h> #include <rte_malloc.h> #include <rte_kvargs.h> +#include <rte_dev.h> #include <rte_eal.h> #include "rte_compressdev_internal.h"
lib/cryptodev/cryptodev_pmd.c +2 -0
@@ -3,6 +3,8 @@*/ #include <sys/queue.h> + +#include <rte_dev.h> #include <rte_errno.h> #include <rte_string_fns.h> #include <rte_malloc.h>
lib/eal/common/eal_thread.h +1 -0
@@ -5,6 +5,7 @@#ifndef EAL_THREAD_H #define EAL_THREAD_H +#include <rte_common.h> #include <rte_lcore.h> /**
lib/eal/common/hotplug_mp.c +1 -0
@@ -3,6 +3,7 @@*/ #include <string.h> +#include <rte_bus.h> #include <rte_eal.h> #include <rte_errno.h> #include <rte_alarm.h>
lib/eal/include/rte_bus.h +2 -16
@@ -20,27 +20,13 @@ extern "C" {#include <stdio.h> -#include <rte_log.h> #include <rte_dev.h> +#include <rte_eal.h> +#include <rte_log.h> /** Double linked list of buses */ RTE_TAILQ_HEAD (rte_bus_list, rte_bus); - -/** -* IOVA mapping mode. -* -* IOVA mapping mode is iommu programming mode of a device. -* That device (for example: IOMMU backed DMA device) based -* on rte_iova_mode will generate physical or virtual address. -* -*/ -enum rte_iova_mode { -RTE_IOVA_DC =0 ,/* Don't care mode */ -RTE_IOVA_PA = (1 <<0 ),/* DMA using physical address */ -RTE_IOVA_VA = (1 <<1 )/* DMA using virtual address */ -}; -/** * Bus specific scan for devices attached on the bus. * For each bus object, the scan would be responsible for finding devices and
lib/eal/include/rte_eal.h +14 -1
@@ -17,7 +17,6 @@#include <rte_config.h> #include <rte_compat.h> #include <rte_per_lcore.h> -#include <rte_bus.h> #include <rte_uuid.h> #include <rte_pci_dev_feature_defs.h>
@@ -458,6 +457,20 @@ static inline int rte_gettid(void)__rte_internal uint64_t rte_eal_get_baseaddr(void); +/** +* IOVA mapping mode. +* +* IOVA mapping mode is iommu programming mode of a device. +* That device (for example: IOMMU backed DMA device) based +* on rte_iova_mode will generate physical or virtual address. +* +*/ +enum rte_iova_mode { +RTE_IOVA_DC =0 ,/* Don't care mode */ +RTE_IOVA_PA = (1 <<0 ),/* DMA using physical address */ +RTE_IOVA_VA = (1 <<1 )/* DMA using virtual address */ +}; +/** * Get the iova mode *
lib/eal/include/rte_lcore.h +2 -0
@@ -11,6 +11,8 @@* API for lcore and socket manipulation * */ +#include <stdio.h> +#include <rte_config.h> #include <rte_per_lcore.h> #include <rte_eal.h>
lib/eal/windows/eal.c +1 -0
@@ -10,6 +10,7 @@#include <sys/stat.h> #include <rte_debug.h> +#include <rte_bus.h> #include <rte_eal.h> #include <eal_memcfg.h> #include <rte_errno.h>
lib/ethdev/rte_ethdev.c +1 -0
@@ -11,6 +11,7 @@#include <string.h> #include <sys/queue.h> +#include <rte_bus.h> #include <rte_log.h> #include <rte_interrupts.h> #include <rte_memcpy.h>
lib/pcapng/rte_pcapng.c +1 -0
@@ -11,6 +11,7 @@#include <time.h> #include <unistd.h> +#include <rte_bus.h> #include <rte_common.h> #include <rte_cycles.h> #include <rte_dev.h>
Signature · 1 line
2.36.1
RFC PATCH 8/11 drivers/bus: remove back reference to bus objects
In reply to David MarchandThere is no need for a back reference to a singleton object in the bus driver objects: each function is contextually aware of which bus object it should manipulate.
--- drivers/bus/auxiliary/auxiliary_common.c | 2 -- drivers/bus/auxiliary/rte_bus_auxiliary.h | 2 -- drivers/bus/dpaa/dpaa_bus.c | 10 +--------- drivers/bus/dpaa/rte_dpaa_bus.h | 1 - drivers/bus/fslmc/fslmc_bus.c | 10 +--------- drivers/bus/fslmc/rte_fslmc.h | 1 - drivers/bus/pci/pci_common.c | 2 -- drivers/bus/pci/rte_bus_pci.h | 1 - drivers/bus/vmbus/rte_bus_vmbus.h | 2 -- drivers/bus/vmbus/vmbus_common.c | 2 -- 10 files changed, 2 insertions(+), 31 deletions(-)
drivers/bus/auxiliary/auxiliary_common.c +0 -2
@@ -259,7 +259,6 @@ void rte_auxiliary_register(struct rte_auxiliary_driver *driver) {TAILQ_INSERT_TAIL (&auxiliary_bus.driver_list, driver, next); - driver->bus = &auxiliary_bus; }/* Unregister a driver */
@@ -267,7 +266,6 @@ void rte_auxiliary_unregister(struct rte_auxiliary_driver *driver) {TAILQ_REMOVE (&auxiliary_bus.driver_list, driver, next); - driver->bus =NULL ; }/* Add a device to auxiliary bus */
drivers/bus/auxiliary/rte_bus_auxiliary.h +0 -2
@@ -32,7 +32,6 @@ extern "C" {/* Forward declarations */ struct rte_auxiliary_driver ; -struct rte_auxiliary_bus ;struct rte_auxiliary_device ;/**
@@ -125,7 +124,6 @@ struct rte_auxiliary_device {struct rte_auxiliary_driver {RTE_TAILQ_ENTRY (rte_auxiliary_driver) next;/**< Next in list. */ struct rte_driver driver;/**< Inherit core driver. */ -struct rte_auxiliary_bus *bus;/**< Auxiliary bus reference. */ rte_auxiliary_match_t *match;/**< Device match function. */ rte_auxiliary_probe_t *probe;/**< Device probe function. */ rte_auxiliary_remove_t *remove;/**< Device remove function. */
drivers/bus/dpaa/dpaa_bus.c +1 -9
@@ -520,23 +520,15 @@ rte_dpaa_driver_register(struct rte_dpaa_driver *driver)BUS_INIT_FUNC_TRACE ();TAILQ_INSERT_TAIL (&rte_dpaa_bus.driver_list, driver, next); -/* Update Bus references */ - driver->dpaa_bus = &rte_dpaa_bus; }/* un-register a dpaa bus based dpaa driver */ void rte_dpaa_driver_unregister (struct rte_dpaa_driver *driver) { -struct rte_dpaa_bus *dpaa_bus; -BUS_INIT_FUNC_TRACE (); - dpaa_bus = driver->dpaa_bus; - -TAILQ_REMOVE (&dpaa_bus->driver_list, driver, next); -/* Update Bus references */ - driver->dpaa_bus =NULL ; +TAILQ_REMOVE (&rte_dpaa_bus.driver_list, driver, next); } static int
drivers/bus/dpaa/rte_dpaa_bus.h +0 -1
@@ -119,7 +119,6 @@ typedef int (*rte_dpaa_remove_t)(struct rte_dpaa_device *dpaa_dev);struct rte_dpaa_driver {TAILQ_ENTRY (rte_dpaa_driver) next;struct rte_driver driver; -struct rte_dpaa_bus *dpaa_bus;enum rte_dpaa_type drv_type;rte_dpaa_probe_t probe;rte_dpaa_remove_t remove;
drivers/bus/fslmc/fslmc_bus.c +1 -9
@@ -530,27 +530,19 @@ rte_fslmc_driver_register(struct rte_dpaa2_driver *driver)RTE_VERIFY (driver);TAILQ_INSERT_TAIL (&rte_fslmc_bus.driver_list, driver, next); -/* Update Bus references */ - driver->fslmc_bus = &rte_fslmc_bus; }/*un-register a fslmc bus based dpaa2 driver */ void rte_fslmc_driver_unregister (struct rte_dpaa2_driver *driver) { -struct rte_fslmc_bus *fslmc_bus; - - fslmc_bus = driver->fslmc_bus; -/* Cleanup the PA->VA Translation table; From wherever this function * is called from. */ if (rte_eal_iova_mode () ==RTE_IOVA_PA )dpaax_iova_table_depopulate (); -TAILQ_REMOVE (&fslmc_bus->driver_list, driver, next); -/* Update Bus references */ - driver->fslmc_bus =NULL ; +TAILQ_REMOVE (&rte_fslmc_bus.driver_list, driver, next); }/*
drivers/bus/fslmc/rte_fslmc.h +0 -1
@@ -146,7 +146,6 @@ typedef int (*rte_dpaa2_remove_t)(struct rte_dpaa2_device *dpaa2_dev);struct rte_dpaa2_driver {TAILQ_ENTRY (rte_dpaa2_driver) next;/**< Next in list. */ struct rte_driver driver;/**< Inherit core driver. */ -struct rte_fslmc_bus *fslmc_bus;/**< FSLMC bus reference */ uint32_t drv_flags;/**< Flags for controlling device.*/ enum rte_dpaa2_dev_type drv_type;/**< Driver Type */ rte_dpaa2_probe_t probe;
drivers/bus/pci/pci_common.c +0 -2
@@ -443,7 +443,6 @@ void rte_pci_register(struct rte_pci_driver *driver) {TAILQ_INSERT_TAIL (&rte_pci_bus.driver_list, driver, next); - driver->bus = &rte_pci_bus; }/* unregister a driver */
@@ -451,7 +450,6 @@ void rte_pci_unregister(struct rte_pci_driver *driver) {TAILQ_REMOVE (&rte_pci_bus.driver_list, driver, next); - driver->bus =NULL ; }/* Add a device to PCI bus */
drivers/bus/pci/rte_bus_pci.h +0 -1
@@ -161,7 +161,6 @@ typedef int (pci_dma_unmap_t)(struct rte_pci_device *dev, void *addr,struct rte_pci_driver {RTE_TAILQ_ENTRY (rte_pci_driver) next;/**< Next in list. */ struct rte_driver driver;/**< Inherit core driver. */ -struct rte_pci_bus *bus;/**< PCI bus reference. */ rte_pci_probe_t *probe;/**< Device probe function. */ rte_pci_remove_t *remove;/**< Device remove function. */ pci_dma_map_t *dma_map;/**< device dma map function. */
drivers/bus/vmbus/rte_bus_vmbus.h +0 -2
@@ -34,7 +34,6 @@ extern "C" {/* Forward declarations */ struct rte_vmbus_device ;struct rte_vmbus_driver ; -struct rte_vmbus_bus ;struct vmbus_channel ;struct vmbus_mon_page ;
@@ -95,7 +94,6 @@ typedef int (vmbus_remove_t)(struct rte_vmbus_device *);struct rte_vmbus_driver {RTE_TAILQ_ENTRY (rte_vmbus_driver) next;/**< Next in list. */ struct rte_driver driver; -struct rte_vmbus_bus *bus;/**< VM bus reference. */ vmbus_probe_t *probe;/**< Device Probe function. */ vmbus_remove_t *remove;/**< Device Remove function. */
drivers/bus/vmbus/vmbus_common.c +0 -2
@@ -235,7 +235,6 @@ rte_vmbus_register(struct rte_vmbus_driver *driver) "Registered driver %s", driver->driver.name);TAILQ_INSERT_TAIL (&rte_vmbus_bus.driver_list, driver, next); - driver->bus = &rte_vmbus_bus; }/* unregister vmbus driver */
@@ -243,7 +242,6 @@ void rte_vmbus_unregister(struct rte_vmbus_driver *driver) {TAILQ_REMOVE (&rte_vmbus_bus.driver_list, driver, next); - driver->bus =NULL ; }/* Add a device to VMBUS bus */
Signature · 1 line
2.36.1
RFC PATCH 9/11 drivers/bus: hide specific structures
In reply to David MarchandNow that there is no bus specific object referenced in the driver objects, we can hide rte_dpaa_bus, rte_fslmc_bus, rte_pci_bus, rte_vmbus_bus specific structures into their bus code.
While at it:
- move enumerators only used in the bus code itself,
- remove unneeded list head structure type,
- reorder the definitions and macro manipulating the bus singleton object,
- remove inclusion of rte_bus.h and update code that relied on it,
--- app/test-pmd/testpmd.h | 1 + app/test/test_kni.c | 1 + drivers/bus/auxiliary/private.h | 30 +++++++++++------------ drivers/bus/auxiliary/rte_bus_auxiliary.h | 3 --- drivers/bus/dpaa/dpaa_bus.c | 8 ++++++ drivers/bus/dpaa/rte_dpaa_bus.h | 13 ---------- drivers/bus/fslmc/fslmc_bus.c | 1 + drivers/bus/fslmc/fslmc_vfio.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dprc.c | 1 + drivers/bus/fslmc/private.h | 27 ++++++++++++++++++++ drivers/bus/fslmc/rte_fslmc.h | 20 --------------- drivers/bus/pci/bsd/pci.c | 2 -- drivers/bus/pci/linux/pci.c | 3 --- drivers/bus/pci/private.h | 18 +++++++++++++- drivers/bus/pci/rte_bus_pci.h | 22 ----------------- drivers/bus/pci/windows/pci.c | 1 + drivers/bus/pci/windows/pci_netuio.c | 1 + drivers/bus/vmbus/private.h | 18 ++++++++++++++ drivers/bus/vmbus/rte_bus_vmbus.h | 20 --------------- drivers/bus/vmbus/vmbus_common.c | 1 - drivers/common/mlx5/mlx5_common_pci.c | 1 + drivers/net/bonding/rte_eth_bond_args.c | 1 + drivers/net/mlx5/linux/mlx5_os.c | 1 + drivers/net/netvsc/hn_ethdev.c | 1 + examples/ethtool/lib/rte_ethtool.c | 1 + examples/ip_pipeline/kni.c | 1 + 26 files changed, 98 insertions(+), 101 deletions(-) create mode 100644 drivers/bus/fslmc/private.h
app/test-pmd/testpmd.h +1 -0
@@ -8,6 +8,7 @@#include <stdbool.h> #include <rte_pci.h> +#include <rte_bus.h> #include <rte_bus_pci.h> #ifdef RTE_LIB_GRO #include <rte_gro.h>
app/test/test_kni.c +1 -0
@@ -25,6 +25,7 @@ test_kni(void)#include <rte_string_fns.h> #include <rte_mempool.h> #include <rte_ethdev.h> +#include <rte_bus.h> #include <rte_bus_pci.h> #include <rte_cycles.h> #include <rte_kni.h>
drivers/bus/auxiliary/private.h +15 -15
@@ -9,9 +9,10 @@#include <stdio.h> #include <sys/queue.h> +#include <rte_bus.h> +#include "rte_bus_auxiliary.h" -extern struct rte_auxiliary_bus auxiliary_bus;extern int auxiliary_bus_logtype;#define AUXILIARY_LOG (level, ...) \
@@ -19,27 +20,26 @@ extern int auxiliary_bus_logtype; RTE_FMT("auxiliary bus: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ RTE_FMT_TAIL(__VA_ARGS__,))) -/* Auxiliary bus iterators */ -#define FOREACH_DEVICE_ON_AUXILIARY_BUS (p) \ - TAILQ_FOREACH(p, &(auxiliary_bus.device_list), next) - -#define FOREACH_DRIVER_ON_AUXILIARY_BUS (p) \ - TAILQ_FOREACH(p, &(auxiliary_bus.driver_list), next) - -/* List of auxiliary devices. */ -TAILQ_HEAD (rte_auxiliary_device_list, rte_auxiliary_device); -/* List of auxiliary drivers. */ -TAILQ_HEAD (rte_auxiliary_driver_list, rte_auxiliary_driver); -/* * Structure describing the auxiliary bus */struct rte_auxiliary_bus {struct rte_bus bus;/* Inherit the generic class */ -struct rte_auxiliary_device_list device_list;/* List of devices */ -struct rte_auxiliary_driver_list driver_list;/* List of drivers */ + TAILQ_HEAD(, rte_auxiliary_device) device_list; /* List of devices */ + TAILQ_HEAD(, rte_auxiliary_driver) driver_list; /* List of drivers */ }; +#define RTE_BUS_AUXILIARY_NAME "auxiliary" + +extern struct rte_auxiliary_bus auxiliary_bus; + +/* Auxiliary bus iterators */ +#define FOREACH_DEVICE_ON_AUXILIARY_BUS (p) \ + TAILQ_FOREACH(p, &(auxiliary_bus.device_list), next) + +#define FOREACH_DRIVER_ON_AUXILIARY_BUS (p) \ + TAILQ_FOREACH(p, &(auxiliary_bus.driver_list), next) +/* * Test whether the auxiliary device exist. */
drivers/bus/auxiliary/rte_bus_auxiliary.h +0 -3
@@ -25,11 +25,8 @@ extern "C" {#include <rte_debug.h> #include <rte_interrupts.h> #include <rte_dev.h> -#include <rte_bus.h> #include <rte_kvargs.h> -#define RTE_BUS_AUXILIARY_NAME "auxiliary" -/* Forward declarations */ struct rte_auxiliary_driver ;struct rte_auxiliary_device ;
drivers/bus/dpaa/dpaa_bus.c +8 -0
@@ -43,6 +43,14 @@#include <fsl_bman.h> #include <netcfg.h> +struct rte_dpaa_bus { +struct rte_bus bus; + TAILQ_HEAD(, rte_dpaa_device) device_list; + TAILQ_HEAD(, rte_dpaa_driver) driver_list; +int device_count; +int detected; +}; +static struct rte_dpaa_bus rte_dpaa_bus;struct netcfg_info *dpaa_netcfg;
drivers/bus/dpaa/rte_dpaa_bus.h +0 -13
@@ -6,7 +6,6 @@#ifndef __RTE_DPAA_BUS_H__#define __RTE_DPAA_BUS_H__ -#include <rte_bus.h> #include <rte_mbuf_dyn.h> #include <rte_mempool.h> #include <dpaax_iova_table.h>
@@ -73,24 +72,12 @@ extern unsigned int dpaa_svr_family;struct rte_dpaa_device ;struct rte_dpaa_driver ; -/* DPAA Device and Driver lists for DPAA bus */ -TAILQ_HEAD (rte_dpaa_device_list, rte_dpaa_device); -TAILQ_HEAD (rte_dpaa_driver_list, rte_dpaa_driver); -enum rte_dpaa_type {FSL_DPAA_ETH =1 ,FSL_DPAA_CRYPTO ,FSL_DPAA_QDMA }; -struct rte_dpaa_bus { -struct rte_bus bus; -struct rte_dpaa_device_list device_list; -struct rte_dpaa_driver_list driver_list; -int device_count; -int detected; -}; -struct dpaa_device_id {uint8_t fman_id;/**< Fman interface ID, for ETH type device */ uint8_t mac_id;/**< Fman MAC interface ID, for ETH type device */
drivers/bus/fslmc/fslmc_bus.c +1 -0
@@ -16,6 +16,7 @@#include <ethdev_driver.h> #include <rte_mbuf_dyn.h> +#include "private.h" #include <rte_fslmc.h> #include <fslmc_vfio.h> #include "fslmc_logs.h"
drivers/bus/fslmc/fslmc_vfio.c +1 -1
@@ -29,9 +29,9 @@#include <rte_cycles.h> #include <rte_kvargs.h> #include <rte_dev.h> -#include <rte_bus.h> #include <rte_eal_memconfig.h> +#include "private.h" #include "rte_fslmc.h" #include "fslmc_vfio.h" #include "fslmc_logs.h"
drivers/bus/fslmc/portal/dpaa2_hw_dprc.c +1 -0
@@ -12,6 +12,7 @@#include <rte_malloc.h> #include <rte_dev.h> +#include "private.h" #include <fslmc_logs.h> #include <rte_fslmc.h> #include <mc/fsl_dprc.h>
drivers/bus/fslmc/private.h new file +27 -0
@@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2016,2021 NXP +*/ + +#ifndef __PRIVATE_H__ +#define __PRIVATE_H__ + +#include <rte_bus.h> + +#include <rte_fslmc.h> + +/* +* FSLMC bus +*/ +struct rte_fslmc_bus { +struct rte_bus bus;/**< Generic Bus object */ + TAILQ_HEAD(, rte_dpaa2_device) device_list; +/**< FSLMC DPAA2 Device list */ + TAILQ_HEAD(, rte_dpaa2_driver) driver_list; +/**< FSLMC DPAA2 Driver list */ +int device_count[DPAA2_DEVTYPE_MAX ]; +/**< Count of all devices scanned */ +}; + +extern struct rte_fslmc_bus rte_fslmc_bus; + +#endif /* __PRIVATE_H__ */
drivers/bus/fslmc/rte_fslmc.h +0 -20
@@ -29,7 +29,6 @@ extern "C" {#include <rte_debug.h> #include <rte_interrupts.h> #include <rte_dev.h> -#include <rte_bus.h> #include <rte_tailq.h> #include <rte_devargs.h> #include <rte_mbuf.h>
@@ -69,15 +68,9 @@ dpaa2_seqn(struct rte_mbuf *mbuf)struct rte_dpaa2_driver ; -/* DPAA2 Device and Driver lists for FSLMC bus */ -TAILQ_HEAD (rte_fslmc_device_list, rte_dpaa2_device); -TAILQ_HEAD (rte_fslmc_driver_list, rte_dpaa2_driver); -#define RTE_DEV_TO_FSLMC_CONST (ptr) \ container_of(ptr, const struct rte_dpaa2_device, device) -extern struct rte_fslmc_bus rte_fslmc_bus; -enum rte_dpaa2_dev_type {/* Devices backed by DPDK driver */ DPAA2_ETH ,/**< DPNI type device*/
@@ -152,19 +145,6 @@ struct rte_dpaa2_driver {rte_dpaa2_remove_t remove; }; -/* -* FSLMC bus -*/ -struct rte_fslmc_bus { -struct rte_bus bus;/**< Generic Bus object */ -struct rte_fslmc_device_list device_list; -/**< FSLMC DPAA2 Device list */ -struct rte_fslmc_driver_list driver_list; -/**< FSLMC DPAA2 Driver list */ -int device_count[DPAA2_DEVTYPE_MAX ]; -/**< Count of all devices scanned */ -}; -/** * Register a DPAA2 driver. *
drivers/bus/pci/bsd/pci.c +0 -2
@@ -48,8 +48,6 @@* PCI probing under BSD. */ -extern struct rte_pci_bus rte_pci_bus; -/* Map pci device */ int rte_pci_map_device (struct rte_pci_device *dev)
drivers/bus/pci/linux/pci.c +0 -3
@@ -6,7 +6,6 @@#include <dirent.h> #include <rte_log.h> -#include <rte_bus.h> #include <rte_pci.h> #include <rte_bus_pci.h> #include <rte_malloc.h>
@@ -24,8 +23,6 @@* PCI probing using Linux sysfs. */ -extern struct rte_pci_bus rte_pci_bus; -static int pci_get_kernel_driver_by_path (const char *filename,char *dri_name,size_t len)
drivers/bus/pci/private.h +17 -1
@@ -8,12 +8,28 @@#include <stdbool.h> #include <stdio.h> -#include <rte_bus_pci.h> +#include <rte_bus.h> #include <rte_os_shim.h> #include <rte_pci.h> +/** +* Structure describing the PCI bus +*/ +struct rte_pci_bus { +struct rte_bus bus;/**< Inherit the generic class */ + RTE_TAILQ_HEAD(, rte_pci_device) device_list; /**< List of PCI devices */ + RTE_TAILQ_HEAD(, rte_pci_driver) driver_list; /**< List of PCI drivers */ +}; +extern struct rte_pci_bus rte_pci_bus; +/* PCI Bus iterators */ +#define FOREACH_DEVICE_ON_PCIBUS (p) \ + RTE_TAILQ_FOREACH(p, &(rte_pci_bus.device_list), next) + +#define FOREACH_DRIVER_ON_PCIBUS (p) \ + RTE_TAILQ_FOREACH(p, &(rte_pci_bus.driver_list), next) +struct rte_pci_driver ;struct rte_pci_device ;
drivers/bus/pci/rte_bus_pci.h +0 -22
@@ -25,7 +25,6 @@ extern "C" {#include <rte_debug.h> #include <rte_interrupts.h> #include <rte_dev.h> -#include <rte_bus.h> #include <rte_pci.h> /** Pathname of PCI devices directory. */
@@ -35,18 +34,6 @@ const char *rte_pci_get_sysfs_path(void);struct rte_pci_device ;struct rte_pci_driver ; -/** List of PCI devices */ -RTE_TAILQ_HEAD (rte_pci_device_list, rte_pci_device); -/** List of PCI drivers */ -RTE_TAILQ_HEAD (rte_pci_driver_list, rte_pci_driver); - -/* PCI Bus iterators */ -#define FOREACH_DEVICE_ON_PCIBUS (p) \ - RTE_TAILQ_FOREACH(p, &(rte_pci_bus.device_list), next) - -#define FOREACH_DRIVER_ON_PCIBUS (p) \ - RTE_TAILQ_FOREACH(p, &(rte_pci_bus.driver_list), next) -struct rte_devargs ;enum rte_pci_kernel_driver {
@@ -169,15 +156,6 @@ struct rte_pci_driver {uint32_t drv_flags;/**< Flags RTE_PCI_DRV_*. */ }; -/** -* Structure describing the PCI bus -*/ -struct rte_pci_bus { -struct rte_bus bus;/**< Inherit the generic class */ -struct rte_pci_device_list device_list;/**< List of PCI devices */ -struct rte_pci_driver_list driver_list;/**< List of PCI drivers */ -}; -/** Device needs PCI BAR mapping (done with either IGB_UIO or VFIO) */ #define RTE_PCI_DRV_NEED_MAPPING 0x0001/** Device needs PCI BAR mapping with enabled write combining (wc) */
drivers/bus/pci/windows/pci.c +1 -0
@@ -9,6 +9,7 @@#include <rte_log.h> #include <rte_eal.h> #include <rte_memory.h> +#include <rte_bus_pci.h> #include "private.h" #include "pci_netuio.h"
drivers/bus/pci/windows/pci_netuio.c +1 -0
@@ -8,6 +8,7 @@#include <rte_errno.h> #include <rte_log.h> #include <rte_eal.h> +#include <rte_bus_pci.h> #ifdef __MINGW32__#include <ddk/ndisguid.h>
drivers/bus/vmbus/private.h +18 -0
@@ -8,13 +8,31 @@#include <stdbool.h> #include <sys/uio.h> + +#include <rte_bus.h> #include <rte_log.h> #include <rte_eal_paging.h> #include <rte_vmbus_reg.h> #include <rte_bus_vmbus.h> +/** +* Structure describing the VM bus +*/ +struct rte_vmbus_bus { +struct rte_bus bus;/**< Inherit the generic class */ + RTE_TAILQ_HEAD(, rte_vmbus_device) device_list; /**< List of devices */ + RTE_TAILQ_HEAD(, rte_vmbus_driver) driver_list; /**< List of drivers */ +}; +extern struct rte_vmbus_bus rte_vmbus_bus; +/* VMBus iterators */ +#define FOREACH_DEVICE_ON_VMBUS (p) \ + RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.device_list), next) + +#define FOREACH_DRIVER_ON_VMBUS (p) \ + RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.driver_list), next) +extern int vmbus_logtype_bus; #define VMBUS_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, vmbus_logtype_bus, "%s(): " fmt "\n", \
drivers/bus/vmbus/rte_bus_vmbus.h +0 -20
@@ -23,7 +23,6 @@ extern "C" {#include <stdint.h> #include <inttypes.h> -#include <rte_bus.h> #include <rte_compat.h> #include <rte_uuid.h> #include <rte_debug.h>
@@ -37,16 +36,6 @@ struct rte_vmbus_driver;struct vmbus_channel ;struct vmbus_mon_page ; -RTE_TAILQ_HEAD (rte_vmbus_device_list, rte_vmbus_device); -RTE_TAILQ_HEAD (rte_vmbus_driver_list, rte_vmbus_driver); - -/* VMBus iterators */ -#define FOREACH_DEVICE_ON_VMBUS (p) \ - RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.device_list), next) - -#define FOREACH_DRIVER_ON_VMBUS (p) \ - RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.driver_list), next) -/** Maximum number of VMBUS resources. */ enum hv_uio_map {HV_TXRX_RING_MAP =0 ,
@@ -101,15 +90,6 @@ struct rte_vmbus_driver { }; -/** -* Structure describing the VM bus -*/ -struct rte_vmbus_bus { -struct rte_bus bus;/**< Inherit the generic class */ -struct rte_vmbus_device_list device_list;/**< List of devices */ -struct rte_vmbus_driver_list driver_list;/**< List of drivers */ -}; -/** * Scan the content of the VMBUS bus, and the devices in the devices * list
drivers/bus/vmbus/vmbus_common.c +0 -1
@@ -11,7 +11,6 @@#include <sys/mman.h> #include <rte_log.h> -#include <rte_bus.h> #include <rte_eal.h> #include <rte_tailq.h> #include <rte_devargs.h>
drivers/common/mlx5/mlx5_common_pci.c +1 -0
@@ -9,6 +9,7 @@#include <rte_errno.h> #include <rte_class.h> #include <rte_pci.h> +#include <rte_bus.h> #include <rte_bus_pci.h> #include "mlx5_common_log.h"
drivers/net/bonding/rte_eth_bond_args.c +1 -0
@@ -4,6 +4,7 @@#include <rte_devargs.h> #include <rte_pci.h> +#include <rte_bus.h> #include <rte_bus_pci.h> #include <rte_kvargs.h>
drivers/net/mlx5/linux/mlx5_os.c +1 -0
@@ -19,6 +19,7 @@#include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_pci.h> +#include <rte_bus.h> #include <rte_bus_pci.h> #include <rte_bus_auxiliary.h> #include <rte_common.h>
drivers/net/netvsc/hn_ethdev.c +1 -0
@@ -31,6 +31,7 @@#include <rte_memory.h> #include <rte_eal.h> #include <rte_dev.h> +#include <rte_bus.h> #include <rte_bus_vmbus.h> #include <rte_alarm.h>
examples/ethtool/lib/rte_ethtool.c +1 -0
@@ -8,6 +8,7 @@#include <rte_version.h> #include <rte_ethdev.h> #include <rte_ether.h> +#include <rte_bus.h> #include <rte_bus_pci.h> #ifdef RTE_NET_IXGBE #include <rte_pmd_ixgbe.h>
examples/ip_pipeline/kni.c +1 -0
@@ -6,6 +6,7 @@#include <string.h> #include <rte_ethdev.h> +#include <rte_bus.h> #include <rte_bus_pci.h> #include <rte_string_fns.h>
Signature · 1 line
2.36.1
RFC PATCH 10/11 bus: introduce accessors
In reply to David MarchandPrepare for making the bus object opaque by adding one accessor. Update existing users.
--- app/test-pmd/config.c | 6 ++--- app/test-pmd/testpmd.c | 4 +-- app/test-pmd/testpmd.h | 4 +-- app/test/test_devargs.c | 4 +-- app/test/test_kni.c | 6 ++--- drivers/common/mlx5/mlx5_common_pci.c | 2 +- drivers/net/failsafe/failsafe.c | 2 +- drivers/net/failsafe/failsafe_eal.c | 2 +- drivers/net/mlx5/linux/mlx5_os.c | 2 +- drivers/net/netvsc/hn_ethdev.c | 4 +-- examples/ethtool/lib/rte_ethtool.c | 3 ++- examples/ip_pipeline/kni.c | 2 +- examples/multi_process/hotplug_mp/commands.c | 4 +-- lib/eal/common/eal_common_bus.c | 26 ++++++++++++-------- lib/eal/common/eal_common_dev.c | 8 +++--- lib/eal/common/eal_common_devargs.c | 12 ++++----- lib/eal/common/hotplug_mp.c | 8 +++--- lib/eal/include/rte_bus.h | 13 ++++++++++ lib/eal/version.map | 3 +++ lib/ethdev/rte_ethdev.c | 10 ++++---- lib/pcapng/rte_pcapng.c | 2 +- 21 files changed, 75 insertions(+), 52 deletions(-)
app/test-pmd/config.c +3 -3
@@ -612,7 +612,7 @@ device_infos_display(const char *identifier)if (identifier && da.bus != next)continue ; -snprintf (devstr,sizeof (devstr),"bus=%s" , next->name); +snprintf (devstr,sizeof (devstr),"bus=%s" ,rte_bus_name (next)); RTE_DEV_FOREACH(dev, devstr, &dev_iter) {if (!dev->driver)
@@ -623,7 +623,7 @@ device_infos_display(const char *identifier)continue ;printf ("\n%s Infos for device %s %s\n" , info_border, dev->name, info_border); -printf ("Bus name: %s" , dev->bus->name); +printf ("Bus name: %s" ,rte_bus_name (dev->bus));printf ("\nDriver name: %s" , dev->driver->name);printf ("\nDevargs: %s" , dev->devargs ? dev->devargs->args :"" );
@@ -1076,7 +1076,7 @@ port_reg_off_is_invalid(portid_t port_id, uint32_t reg_off) } bus =rte_bus_find_by_device (ports[port_id].dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { +if (bus && !strcmp (rte_bus_name (bus),"pci" )) { pci_dev =RTE_DEV_TO_PCI (ports[port_id].dev_info.device); }else {fprintf (stderr,"Not a PCI device\n" );
app/test-pmd/testpmd.c +2 -2
@@ -3507,9 +3507,9 @@ detach_devargs(char *identifier) } } -if (rte_eal_hotplug_remove (da.bus->name, da.name) !=0 ) { +if (rte_eal_hotplug_remove (rte_bus_name (da.bus), da.name) !=0 ) {TESTPMD_LOG (ERR ,"Failed to detach device %s(%s)\n" , - da.name, da.bus->name); + da.name,rte_bus_name (da.bus));rte_devargs_reset (&da);return ; }
app/test-pmd/testpmd.h +2 -2
@@ -817,7 +817,7 @@ port_pci_reg_read(struct rte_port *port, uint32_t reg_off) } bus =rte_bus_find_by_device (port->dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { +if (bus && !strcmp (rte_bus_name (bus),"pci" )) { pci_dev =RTE_DEV_TO_PCI (port->dev_info.device); }else {fprintf (stderr,"Not a PCI device\n" );
@@ -845,7 +845,7 @@ port_pci_reg_write(struct rte_port *port, uint32_t reg_off, uint32_t reg_v) } bus =rte_bus_find_by_device (port->dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { +if (bus && !strcmp (rte_bus_name (bus),"pci" )) { pci_dev =RTE_DEV_TO_PCI (port->dev_info.device); }else {fprintf (stderr,"Not a PCI device\n" );
app/test/test_devargs.c +2 -2
@@ -98,9 +98,9 @@ test_valid_devargs_cases(const struct devargs_case *list, size_t n) list[i].bus_kv) != 0) goto fail;if (list[i].bus !=NULL && -strcmp (da.bus->name, list[i].bus) !=0 ) { +strcmp (rte_bus_name (da.bus), list[i].bus) !=0 ) {printf ("rte_devargs_parse(%s) bus name (%s) not expected (%s)\n" , - list[i].devargs, da.bus->name, list[i].bus); + list[i].devargs,rte_bus_name (da.bus), list[i].bus); goto fail; } if ((list[i].class_kv > 0 || list[i].class != NULL) &&
app/test/test_kni.c +3 -3
@@ -446,7 +446,7 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp)if (info.device) bus =rte_bus_find_by_device (info.device); -if (bus && !strcmp (bus->name,"pci" )) { +if (bus && !strcmp (rte_bus_name (bus),"pci" )) { pci_dev =RTE_DEV_TO_PCI (info.device); conf.addr = pci_dev->addr; conf.id = pci_dev->id;
@@ -650,7 +650,7 @@ test_kni(void) bus =rte_bus_find_by_device (info.device); else bus =NULL ; -if (bus && !strcmp (bus->name,"pci" )) { +if (bus && !strcmp (rte_bus_name (bus),"pci" )) { pci_dev =RTE_DEV_TO_PCI (info.device); conf.addr = pci_dev->addr; conf.id = pci_dev->id;
@@ -694,7 +694,7 @@ test_kni(void) bus =rte_bus_find_by_device (info.device); else bus =NULL ; -if (bus && !strcmp (bus->name,"pci" )) { +if (bus && !strcmp (rte_bus_name (bus),"pci" )) { pci_dev =RTE_DEV_TO_PCI (info.device); conf.addr = pci_dev->addr; conf.id = pci_dev->id;
drivers/common/mlx5/mlx5_common_pci.c +1 -1
@@ -105,7 +105,7 @@ pci_ids_table_update(const struct rte_pci_id *driver_id_table)bool mlx5_dev_is_pci (const struct rte_device *dev) { -return strcmp (dev->bus->name,"pci" ) ==0 ; +return strcmp (rte_bus_name (dev->bus),"pci" ) ==0 ; }bool
drivers/net/failsafe/failsafe.c +1 -1
@@ -319,7 +319,7 @@ devargs_already_listed(struct rte_devargs *devargs) {struct rte_devargs *list_da; - RTE_EAL_DEVARGS_FOREACH(devargs->bus->name, list_da) { + RTE_EAL_DEVARGS_FOREACH(rte_bus_name(devargs->bus), list_da) {if (strcmp (list_da->name, devargs->name) ==0 )/* devargs already in the list */ return true;
drivers/net/failsafe/failsafe_eal.c +1 -1
@@ -46,7 +46,7 @@ fs_bus_init(struct rte_eth_dev *dev)if (fs_ethdev_portid_get (da->name, &pid) !=0 ) {struct rte_eth_dev_owner pid_owner; - ret =rte_eal_hotplug_add (da->bus->name, + ret =rte_eal_hotplug_add (rte_bus_name (da->bus), da->name, da->args);if (ret <0 ) {
drivers/net/mlx5/linux/mlx5_os.c +1 -1
@@ -1191,7 +1191,7 @@ mlx5_dev_spawn(struct rte_device *dpdk_dev,DRV_LOG (DEBUG ,"dev_port=%u bus=%s pci=%s master=%d representor=%d pf_bond=%d\n" , - priv->dev_port, dpdk_dev->bus->name, + priv->dev_port,rte_bus_name (dpdk_dev->bus), priv->pci_dev ? priv->pci_dev->name :"NONE" , priv->master, priv->representor, priv->pf_bond);
drivers/net/netvsc/hn_ethdev.c +2 -2
@@ -620,7 +620,7 @@ static void netvsc_hotplug_retry(void *args)/* If this device has been hot removed from this * parent device, restore its args. */ - ret =rte_eal_hotplug_add (d->bus->name, d->name, + ret =rte_eal_hotplug_add (rte_bus_name (d->bus), d->name, hv->vf_devargs ? hv->vf_devargs :"" );if (ret) {
@@ -686,7 +686,7 @@ netvsc_hotadd_callback(const char *device_name, enum rte_dev_event_type type, goto free_ctx; } -if (!strcmp (d->bus->name,"pci" )) { +if (!strcmp (rte_bus_name (d->bus),"pci" )) {/* Start the process of figuring out if this * PCI device is a VF device */
examples/ethtool/lib/rte_ethtool.c +2 -1
@@ -4,6 +4,7 @@#include <stdio.h> #include <string.h> #include <stdint.h> +#include <rte_string_fns.h> #include <rte_version.h> #include <rte_ethdev.h>
@@ -56,7 +57,7 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo)/* TODO: replace bus_info by rte_devargs.name */ if (dev_info.device) bus =rte_bus_find_by_device (dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { +if (bus && !strcmp (rte_bus_name (bus),"pci" )) { pci_dev =RTE_DEV_TO_PCI (dev_info.device); snprintf(drvinfo->bus_info, sizeof(drvinfo->bus_info), "%04x:%02x:%02x.%x",
examples/ip_pipeline/kni.c +1 -1
@@ -137,7 +137,7 @@ kni_create(const char *name, struct kni_params *params) kni_conf.mbuf_size = mempool->buffer_size;if (dev_info.device) bus =rte_bus_find_by_device (dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { +if (bus && !strcmp (rte_bus_name (bus),"pci" )) { pci_dev =RTE_DEV_TO_PCI (dev_info.device); kni_conf.addr = pci_dev->addr; kni_conf.id = pci_dev->id;
examples/multi_process/hotplug_mp/commands.c +2 -2
@@ -126,7 +126,7 @@ static void cmd_dev_attach_parsed(void *parsed_result,return ; } -if (!rte_eal_hotplug_add (da.bus->name, da.name, da.args)) +if (!rte_eal_hotplug_add (rte_bus_name (da.bus), da.name, da.args))cmdline_printf (cl,"attached device %s\n" , da.name);else cmdline_printf(cl, "failed to attached device %s\n",
@@ -173,7 +173,7 @@ static void cmd_dev_detach_parsed(void *parsed_result, }printf ("detaching...\n" ); -if (!rte_eal_hotplug_remove (da.bus->name, da.name)) +if (!rte_eal_hotplug_remove (rte_bus_name (da.bus), da.name))cmdline_printf (cl,"detached device %s\n" , da.name);else
lib/eal/common/eal_common_bus.c +16 -10
@@ -16,11 +16,17 @@static struct rte_bus_list rte_bus_list =TAILQ_HEAD_INITIALIZER (rte_bus_list); +const char * +rte_bus_name (const struct rte_bus *bus) +{ +return bus->name; +} +void rte_bus_register (struct rte_bus *bus) {RTE_VERIFY (bus); -RTE_VERIFY (bus->name &&strlen (bus->name)); +RTE_VERIFY (rte_bus_name (bus) &&strlen (rte_bus_name (bus)));/* A bus should mandatorily have the scan implemented */ RTE_VERIFY (bus->scan);RTE_VERIFY (bus->probe);
@@ -29,14 +35,14 @@ rte_bus_register(struct rte_bus *bus)RTE_VERIFY (!bus->plug || bus->unplug);TAILQ_INSERT_TAIL (&rte_bus_list, bus, next); -RTE_LOG (DEBUG ,EAL ,"Registered [%s] bus.\n" , bus->name); +RTE_LOG (DEBUG ,EAL ,"Registered [%s] bus.\n" ,rte_bus_name (bus)); }void rte_bus_unregister (struct rte_bus *bus) {TAILQ_REMOVE (&rte_bus_list, bus, next); -RTE_LOG (DEBUG ,EAL ,"Unregistered [%s] bus.\n" , bus->name); +RTE_LOG (DEBUG ,EAL ,"Unregistered [%s] bus.\n" ,rte_bus_name (bus)); }/* Scan all the buses for registered devices */
@@ -50,7 +56,7 @@ rte_bus_scan(void) ret = bus->scan ();if (ret)RTE_LOG (ERR ,EAL ,"Scan for (%s) bus failed.\n" , - bus->name); +rte_bus_name (bus)); }return 0 ;
@@ -64,7 +70,7 @@ rte_bus_probe(void)struct rte_bus *bus, *vbus =NULL ; TAILQ_FOREACH(bus, &rte_bus_list, next) { -if (!strcmp (bus->name,"vdev" )) { +if (!strcmp (rte_bus_name (bus),"vdev" )) { vbus = bus;continue ; }
@@ -72,14 +78,14 @@ rte_bus_probe(void) ret = bus->probe ();if (ret)RTE_LOG (ERR ,EAL ,"Bus (%s) probe failed.\n" , - bus->name); +rte_bus_name (bus)); }if (vbus) { ret = vbus->probe ();if (ret)RTE_LOG (ERR ,EAL ,"Bus (%s) probe failed.\n" , - vbus->name); +rte_bus_name (vbus)); }return 0 ;
@@ -92,7 +98,7 @@ bus_dump_one(FILE *f, struct rte_bus *bus)int ret;/* For now, dump only the bus name */ - ret =fprintf (f," %s\n" , bus->name); + ret =fprintf (f," %s\n" ,rte_bus_name (bus));/* Error in case of inability in writing to stream */ if (ret <0 )
@@ -163,7 +169,7 @@ cmp_bus_name(const struct rte_bus *bus, const void *_name) {const char *name = _name; -return strcmp (bus->name, name); +return strcmp (rte_bus_name (bus), name); } struct rte_bus *
@@ -213,7 +219,7 @@ rte_bus_get_iommu_class(void) bus_iova_mode = bus->get_iommu_class ();RTE_LOG (DEBUG ,EAL ,"Bus %s wants IOVA as '%s'\n" , - bus->name, +rte_bus_name (bus), bus_iova_mode ==RTE_IOVA_DC ?"DC" : (bus_iova_mode ==RTE_IOVA_PA ?"PA" :"VA" ));if (bus_iova_mode ==RTE_IOVA_PA )
lib/eal/common/eal_common_dev.c +4 -4
@@ -140,7 +140,7 @@ local_dev_probe(const char *devargs, struct rte_device **new_dev)if (da->bus->plug ==NULL ) {RTE_LOG (ERR ,EAL ,"Function plug not supported by bus (%s)\n" , - da->bus->name); +rte_bus_name (da->bus)); ret = -ENOTSUP ; goto err_devarg; }
@@ -309,7 +309,7 @@ local_dev_remove(struct rte_device *dev)if (dev->bus->unplug ==NULL ) {RTE_LOG (ERR ,EAL ,"Function unplug not supported by bus (%s)\n" , - dev->bus->name); +rte_bus_name (dev->bus));return -ENOTSUP ; }
@@ -335,7 +335,7 @@ rte_dev_remove(struct rte_device *dev)return -ENOENT ; } - ret =build_devargs (dev->bus->name, dev->name,"" , &devargs); + ret =build_devargs (rte_bus_name (dev->bus), dev->name,"" , &devargs);if (ret !=0 )return ret;
@@ -597,7 +597,7 @@ rte_dev_iterator_init(struct rte_dev_iterator *it, goto get_out; }if (bus !=NULL && bus->dev_iterate ==NULL ) { -RTE_LOG (DEBUG ,EAL ,"Bus %s not supported\n" , bus->name); +RTE_LOG (DEBUG ,EAL ,"Bus %s not supported\n" ,rte_bus_name (bus)); rte_errno =ENOTSUP ; goto get_out; }
lib/eal/common/eal_common_devargs.c +6 -6
@@ -176,7 +176,7 @@ rte_devargs_layers_parse(struct rte_devargs *devargs,static int bus_name_cmp (const struct rte_bus *bus,const void *name) { -return strncmp (bus->name, name,strlen (bus->name)); +return strncmp (rte_bus_name (bus), name,strlen (bus->name)); }int
@@ -206,7 +206,7 @@ rte_devargs_parse(struct rte_devargs *da, const char *dev) bus =rte_bus_find (bus, bus_name_cmp, dev);if (bus ==NULL )break ; - devname = dev +strlen (bus->name) +1 ; + devname = dev +strlen (rte_bus_name (bus)) +1 ;if (rte_bus_find_by_device_name (devname) == bus)break ; }while (1 );
@@ -301,7 +301,7 @@ rte_devargs_insert(struct rte_devargs **da)if (listed_da == *da)/* devargs already in the list */ return 0 ; -if (strcmp (listed_da->bus->name, (*da)->bus->name) ==0 && +if (strcmp (rte_bus_name (listed_da->bus), (*da)->bus->name) ==0 &&strcmp (listed_da->name, (*da)->name) ==0 ) {/* device already in devargs list, must be updated */ (*da)->next = listed_da->next;
@@ -365,7 +365,7 @@ rte_devargs_remove(struct rte_devargs *devargs)return -1 ; RTE_TAILQ_FOREACH_SAFE(d, &devargs_list, next, tmp) { -if (strcmp (d->bus->name, devargs->bus->name) ==0 && +if (strcmp (rte_bus_name (d->bus), devargs->bus->name) ==0 &&strcmp (d->name, devargs->name) ==0 ) {TAILQ_REMOVE (&devargs_list, d, next);rte_devargs_reset (d);
@@ -400,7 +400,7 @@ rte_devargs_dump(FILE *f)fprintf (f,"User device list:\n" ); TAILQ_FOREACH(devargs, &devargs_list, next) {fprintf (f," [%s]: %s %s\n" , - (devargs->bus ? devargs->bus->name :"??" ), + (devargs->bus ?rte_bus_name (devargs->bus) :"??" ), devargs->name, devargs->args); } }
@@ -417,7 +417,7 @@ rte_devargs_next(const char *busname, const struct rte_devargs *start) da =TAILQ_FIRST (&devargs_list);while (da !=NULL ) {if (busname ==NULL || - (strcmp (busname, da->bus->name) ==0 )) + (strcmp (busname,rte_bus_name (da->bus)) ==0 ))return da; da =TAILQ_NEXT (da, next); }
lib/eal/common/hotplug_mp.c +4 -4
@@ -127,9 +127,9 @@ __handle_secondary_request(void *param) goto rollback; } - bus =rte_bus_find_by_name (da.bus->name); + bus =rte_bus_find_by_name (rte_bus_name (da.bus));if (bus ==NULL ) { -RTE_LOG (ERR ,EAL ,"Cannot find bus (%s)\n" , da.bus->name); +RTE_LOG (ERR ,EAL ,"Cannot find bus (%s)\n" ,rte_bus_name (da.bus)); ret = -ENOENT ; goto finish; }
@@ -254,9 +254,9 @@ static void __handle_primary_request(void *param)if (ret !=0 ) goto quit; - bus =rte_bus_find_by_name (da->bus->name); + bus =rte_bus_find_by_name (rte_bus_name (da->bus));if (bus ==NULL ) { -RTE_LOG (ERR ,EAL ,"Cannot find bus (%s)\n" , da->bus->name); +RTE_LOG (ERR ,EAL ,"Cannot find bus (%s)\n" ,rte_bus_name (da->bus)); ret = -ENOENT ; goto quit; }
lib/eal/include/rte_bus.h +13 -0
@@ -266,6 +266,19 @@ struct rte_bus { }; +/** +* @warning +* @b EXPERIMENTAL: this API may change without prior notice +* +* @param bus +* A pointer to a rte_bus structure describing the bus +* to be registered. +* @return +* A pointer to the bus name string. +*/ +__rte_experimental +const char *rte_bus_name(const struct rte_bus *bus); +/** * Register a Bus handler. *
lib/eal/version.map +3 -0
@@ -424,6 +424,9 @@ EXPERIMENTAL { rte_thread_self; rte_thread_set_affinity_by_id; rte_thread_set_priority; + + # added in 22.11 + rte_bus_name; }; INTERNAL {
lib/ethdev/rte_ethdev.c +5 -5
@@ -232,11 +232,11 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str) }/* Convert bus args to new syntax for use with new API dev_iterate. */ -if ((strcmp (iter->bus->name,"vdev" ) ==0 ) || - (strcmp (iter->bus->name,"fslmc" ) ==0 ) || - (strcmp (iter->bus->name,"dpaa_bus" ) ==0 )) { +if ((strcmp (rte_bus_name (iter->bus),"vdev" ) ==0 ) || + (strcmp (rte_bus_name (iter->bus),"fslmc" ) ==0 ) || + (strcmp (rte_bus_name (iter->bus),"dpaa_bus" ) ==0 )) { bus_param_key ="name" ; - }else if (strcmp (iter->bus->name,"pci" ) ==0 ) { + }else if (strcmp (rte_bus_name (iter->bus),"pci" ) ==0 ) { bus_param_key ="addr" ; }else { ret = -ENOTSUP ;
@@ -264,7 +264,7 @@ rte_eth_iterator_init(struct rte_dev_iterator *iter, const char *devargs_str) error:if (ret == -ENOTSUP )RTE_ETHDEV_LOG (ERR ,"Bus %s does not support iterating.\n" , - iter->bus->name); +rte_bus_name (iter->bus));rte_devargs_reset (&devargs);free (bus_str);free (cls_str);
lib/pcapng/rte_pcapng.c +1 -1
@@ -211,7 +211,7 @@ pcapng_add_interface(rte_pcapng_t *self, uint16_t port) dev = dev_info.device;if (dev)snprintf (ifhw,sizeof (ifhw), -"%s-%s" , dev->bus->name, dev->name); +"%s-%s" ,rte_bus_name (dev->bus), dev->name);/* DPDK reports in units of Mbps */ if (rte_eth_link_get(port, &link) == 0 &&
Signature · 1 line
2.36.1
RFC PATCH 11/11 bus: hide bus object
In reply to David MarchandMake rte_bus opaque for non internal users.
This will make extending this object possible without breaking the ABI.
Introduce a new driver header and move rte_bus definition and helpers.
--- app/test/test_devargs.c | 2 +- app/test/test_vdev.c | 2 +- drivers/bus/auxiliary/private.h | 2 +- drivers/bus/dpaa/dpaa_bus.c | 2 +- drivers/bus/fslmc/private.h | 2 +- drivers/bus/ifpga/ifpga_bus.c | 2 +- drivers/bus/pci/private.h | 2 +- drivers/bus/vdev/vdev.c | 2 +- drivers/bus/vmbus/private.h | 2 +- drivers/dma/idxd/idxd_bus.c | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +- lib/eal/common/eal_common_bus.c | 2 +- lib/eal/common/eal_common_dev.c | 2 +- lib/eal/common/eal_common_devargs.c | 2 +- lib/eal/common/hotplug_mp.c | 2 +- lib/eal/include/bus_driver.h | 295 ++++++++++++++++++++++++ lib/eal/include/meson.build | 4 + lib/eal/include/rte_bus.h | 275 +--------------------- lib/eal/linux/eal_dev.c | 2 +- lib/eal/version.map | 4 +- lib/ethdev/rte_ethdev.c | 2 +- 22 files changed, 322 insertions(+), 292 deletions(-) create mode 100644 lib/eal/include/bus_driver.h
app/test/test_devargs.c +1 -1
@@ -9,7 +9,7 @@#include <rte_common.h> #include <rte_devargs.h> #include <rte_kvargs.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_class.h> #include "test.h"
app/test/test_vdev.c +1 -1
@@ -8,7 +8,7 @@#include <rte_common.h> #include <rte_kvargs.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_bus_vdev.h> #include "test.h"
drivers/bus/auxiliary/private.h +1 -1
@@ -9,7 +9,7 @@#include <stdio.h> #include <sys/queue.h> -#include <rte_bus.h> +#include <bus_driver.h> #include "rte_bus_auxiliary.h"
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -29,7 +29,7 @@#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_ring.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_mbuf_pool_ops.h> #include <rte_mbuf_dyn.h>
drivers/bus/fslmc/private.h +1 -1
@@ -5,7 +5,7 @@#ifndef __PRIVATE_H__#define __PRIVATE_H__ -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_fslmc.h>
drivers/bus/ifpga/ifpga_bus.c +1 -1
@@ -14,7 +14,7 @@#include <fcntl.h> #include <rte_errno.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_per_lcore.h> #include <rte_memory.h> #include <rte_memzone.h>
drivers/bus/pci/private.h +1 -1
@@ -8,7 +8,7 @@#include <stdbool.h> #include <stdio.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_os_shim.h> #include <rte_pci.h>
drivers/bus/vdev/vdev.c +1 -1
@@ -12,7 +12,7 @@#include <rte_eal.h> #include <rte_dev.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_common.h> #include <rte_devargs.h> #include <rte_memory.h>
drivers/bus/vmbus/private.h +1 -1
@@ -9,7 +9,7 @@#include <stdbool.h> #include <sys/uio.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_log.h> #include <rte_eal_paging.h> #include <rte_vmbus_reg.h>
drivers/dma/idxd/idxd_bus.c +1 -1
@@ -8,7 +8,7 @@#include <sys/mman.h> #include <libgen.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_devargs.h> #include <rte_eal.h> #include <rte_log.h>
drivers/net/bonding/rte_eth_bond_args.c +1 -1
@@ -4,7 +4,7 @@#include <rte_devargs.h> #include <rte_pci.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_bus_pci.h> #include <rte_kvargs.h>
drivers/net/vdev_netvsc/vdev_netvsc.c +1 -1
@@ -24,7 +24,7 @@#include <unistd.h> #include <rte_alarm.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_bus_vdev.h> #include <rte_common.h> #include <rte_dev.h>
lib/eal/common/eal_common_bus.c +1 -1
@@ -6,7 +6,7 @@#include <string.h> #include <sys/queue.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_debug.h> #include <rte_string_fns.h> #include <rte_errno.h>
lib/eal/common/eal_common_dev.c +1 -1
@@ -7,7 +7,7 @@#include <string.h> #include <sys/queue.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_class.h> #include <rte_dev.h> #include <rte_devargs.h>
lib/eal/common/eal_common_devargs.c +1 -1
@@ -10,7 +10,7 @@#include <string.h> #include <stdarg.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_class.h> #include <rte_dev.h> #include <rte_devargs.h>
lib/eal/common/hotplug_mp.c +1 -1
@@ -3,7 +3,7 @@*/ #include <string.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_eal.h> #include <rte_errno.h> #include <rte_alarm.h>
lib/eal/include/bus_driver.h new file +295 -0
295 lines not on this page · raw message
lib/eal/include/meson.build +4 -0
@@ -55,6 +55,10 @@ headers += files( 'rte_vfio.h', ) +driver_sdk_headers = files( + 'bus_driver.h', +) + # special case install the generic headers, since they go in a subdir generic_headers = files( 'generic/rte_atomic.h',
lib/eal/include/rte_bus.h +3 -272
295 lines not on this page · raw message
lib/eal/linux/eal_dev.c +1 -1
@@ -13,7 +13,7 @@#include <rte_dev.h> #include <rte_interrupts.h> #include <rte_alarm.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_spinlock.h> #include <rte_errno.h>
lib/eal/version.map +2 -2
@@ -13,9 +13,7 @@ DPDK_22 { rte_bus_find_by_name; rte_bus_get_iommu_class; rte_bus_probe; - rte_bus_register; rte_bus_scan; - rte_bus_unregister; rte_calloc; rte_calloc_socket; rte_cpu_get_flag_enabled;
@@ -432,6 +430,8 @@ EXPERIMENTAL { INTERNAL { global: + rte_bus_register; + rte_bus_unregister; rte_eal_get_baseaddr; rte_firmware_read; rte_intr_allow_others;
lib/ethdev/rte_ethdev.c +1 -1
@@ -11,7 +11,7 @@#include <string.h> #include <sys/queue.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_log.h> #include <rte_interrupts.h> #include <rte_memcpy.h>
Signature · 1 line
2.36.1
Re: [RFC PATCH 11/11] bus: hide bus object
Quoted 7 lines · David Marchand
Make
rte_busopaque for non internal users.
This will make extending this object possible without breaking the ABI.Introduce a new driver header and move
rte_busdefinition and helpers.Signed-off-by David Marchand <[email protected]>---
... snip ...
Quoted 11 lines
lib/eal/include/rte_bus.h +0
-11-struct rte_bus { -RTE_TAILQ_ENTRY (rte_bus) next;/**< Next bus object in linked list */ -const char *name;/**< Name of the bus */ -rte_bus_scan_t scan;/**< Scan for devices attached to bus */ -rte_bus_probe_t probe;/**< Probe devices on bus */ -rte_bus_find_device_t find_device;/**< Find a device on the bus */ -rte_bus_plug_t plug;/**< Probe single device for drivers */ -rte_bus_unplug_t unplug;/**< Remove single device from driver */ -rte_bus_parse_t parse;/**< Parse a device name */ -rte_bus_devargs_parse_t devargs_parse;/**< Parse bus devargs */ -rte_dev_dma_map_t dma_map;/**< DMA map for device in the bus */
lib/eal/include/rte_bus.h extern "C" { · line 267
Quoted 10 lines
lib/eal/include/rte_bus.h +0
-10-rte_dev_dma_unmap_t dma_unmap;/**< DMA unmap for device in the bus */ -struct rte_bus_conf conf;/**< Bus configuration */ -rte_bus_get_iommu_class_t get_iommu_class;/**< Get iommu class */ -rte_dev_iterate_t dev_iterate;/**< Device iterator. */ -rte_bus_hot_unplug_handler_t hot_unplug_handler; -/**< handle hot-unplug failure on the bus */ -rte_bus_sigbus_handler_t sigbus_handler; -/**< handle sigbus error on the bus */ - -};
since we're overhauling anyway we could follow suit with a number of the lessons from posix apis e.g. pthread and eliminate typed pointers for a little extra value.
lib/eal/include/rte_bus.h extern "C" { · line 27
Quoted 2 lines
lib/eal/include/rte_bus.h +2
-0+struct rte_bus ; +struct rte_device ;
to avoid people tripping over mishandling pointers in/out of the api surface taking the opaque object you could declare opaque handle for the api to operate on instead. it would force the use of a cast in the implementation but would avoid accidental void * of the wrong thing that got cached being passed in. if the cast was really undesirable just whack it under an inline / internal function.
e.g. make the opaque object an explicit type.
struct {
uintptr_t opaque;
} rte_bus_handle_t;// implementationrte_bus_handle_t
rte_bus_find(rte_bus_handle_t start,
rte_bus_cmp_t cmp, const void *data)
{
struct rte_bus *bus = (struct rte_bus *)start.opaque;
// do bus things on bus
return {.opaque = whatever};
}then you will get hard compile time failure if someone messes up argument passing.
e.g.
void *somerandomp = ...;
...rte_bus_find(somerandomp, ...); // compile fail
i would actually suggest this wrapping in a struct / handle approach for any opaque object that is passed over the api surface. the change is bigger of course...
it has various other advantages when/if we decide to make the bus/driver surface stable in abi which i understand is not a promise dpdk makes right now but still we might one day.
anyway, just a suggestion. i like the series either way.
Re: [RFC PATCH 11/11] bus: hide bus object
Quoted 3 lines · Tyler Retzlaff
e.g. make the opaque object an explicit type.
oops missed the typedef there but you probably know what i meant.
typedef
Quoted 4 lines
struct {
uintptr_t opaque;
} rte_bus_handle_t;Re: [RFC PATCH 11/11] bus: hide bus object
In reply to Tyler RetzlaffQuoted 37 lines · On Tue, 28 Jun 2022 09:22:13 -0700 Tyler Retzlaff…
Quoted 7 lines · David Marchand
Make
rte_busopaque for non internal users.
This will make extending this object possible without breaking the ABI.Introduce a new driver header and move
rte_busdefinition and helpers.Signed-off-by David Marchand <[email protected]>---
... snip ...
Quoted 11 lines
lib/eal/include/rte_bus.h +0
-11-struct rte_bus { -RTE_TAILQ_ENTRY (rte_bus) next;/**< Next bus object in linked list */ -const char *name;/**< Name of the bus */ -rte_bus_scan_t scan;/**< Scan for devices attached to bus */ -rte_bus_probe_t probe;/**< Probe devices on bus */ -rte_bus_find_device_t find_device;/**< Find a device on the bus */ -rte_bus_plug_t plug;/**< Probe single device for drivers */ -rte_bus_unplug_t unplug;/**< Remove single device from driver */ -rte_bus_parse_t parse;/**< Parse a device name */ -rte_bus_devargs_parse_t devargs_parse;/**< Parse bus devargs */ -rte_dev_dma_map_t dma_map;/**< DMA map for device in the bus */ lib/eal/include/rte_bus.h extern "C" { · line 267
Quoted 10 lines
lib/eal/include/rte_bus.h +0
-10-rte_dev_dma_unmap_t dma_unmap;/**< DMA unmap for device in the bus */ -struct rte_bus_conf conf;/**< Bus configuration */ -rte_bus_get_iommu_class_t get_iommu_class;/**< Get iommu class */ -rte_dev_iterate_t dev_iterate;/**< Device iterator. */ -rte_bus_hot_unplug_handler_t hot_unplug_handler; -/**< handle hot-unplug failure on the bus */ -rte_bus_sigbus_handler_t sigbus_handler; -/**< handle sigbus error on the bus */ - -};since we're overhauling anyway we could follow suit with a number of the lessons from posix apis e.g. pthread and eliminate typed pointers for a little extra value.
Quoted 9 lines
lib/eal/include/rte_bus.h extern "C" { · line 27
Quoted 2 lines
lib/eal/include/rte_bus.h +2
-0+struct rte_bus ; +struct rte_device ;to avoid people tripping over mishandling pointers in/out of the api surface taking the opaque object you could declare opaque handle for the api to operate on instead. it would force the use of a cast in the implementation but would avoid accidental void * of the wrong thing that got cached being passed in. if the cast was really undesirable just whack it under an inline / internal function.
I don't like that because it least to dangerous casts in the internal code. Better to keep the the type of the object. As long as the API only passes around an pointer to a struct, without exposing the contents of the struct; it is safer and easier to debug.
Re: [RFC PATCH 11/11] bus: hide bus object
Quoted 50 lines · Stephen Hemminger
Quoted 37 lines · On Tue, 28 Jun 2022 09:22:13 -0700 Tyler Retzlaff…
Quoted 7 lines · David Marchand
Make
rte_busopaque for non internal users.
This will make extending this object possible without breaking the ABI.Introduce a new driver header and move
rte_busdefinition and helpers.Signed-off-by David Marchand <[email protected]>---
... snip ...
Quoted 11 lines
lib/eal/include/rte_bus.h +0
-11-struct rte_bus { -RTE_TAILQ_ENTRY (rte_bus) next;/**< Next bus object in linked list */ -const char *name;/**< Name of the bus */ -rte_bus_scan_t scan;/**< Scan for devices attached to bus */ -rte_bus_probe_t probe;/**< Probe devices on bus */ -rte_bus_find_device_t find_device;/**< Find a device on the bus */ -rte_bus_plug_t plug;/**< Probe single device for drivers */ -rte_bus_unplug_t unplug;/**< Remove single device from driver */ -rte_bus_parse_t parse;/**< Parse a device name */ -rte_bus_devargs_parse_t devargs_parse;/**< Parse bus devargs */ -rte_dev_dma_map_t dma_map;/**< DMA map for device in the bus */ lib/eal/include/rte_bus.h extern "C" { · line 267
Quoted 10 lines
lib/eal/include/rte_bus.h +0
-10-rte_dev_dma_unmap_t dma_unmap;/**< DMA unmap for device in the bus */ -struct rte_bus_conf conf;/**< Bus configuration */ -rte_bus_get_iommu_class_t get_iommu_class;/**< Get iommu class */ -rte_dev_iterate_t dev_iterate;/**< Device iterator. */ -rte_bus_hot_unplug_handler_t hot_unplug_handler; -/**< handle hot-unplug failure on the bus */ -rte_bus_sigbus_handler_t sigbus_handler; -/**< handle sigbus error on the bus */ - -};since we're overhauling anyway we could follow suit with a number of the lessons from posix apis e.g. pthread and eliminate typed pointers for a little extra value.
Quoted 9 lines
lib/eal/include/rte_bus.h extern "C" { · line 27
Quoted 2 lines
lib/eal/include/rte_bus.h +2
-0+struct rte_bus ; +struct rte_device ;to avoid people tripping over mishandling pointers in/out of the api surface taking the opaque object you could declare opaque handle for the api to operate on instead. it would force the use of a cast in the implementation but would avoid accidental void * of the wrong thing that got cached being passed in. if the cast was really undesirable just whack it under an inline / internal function.
Quoted 4 lines
I don't like that because it least to dangerous casts in the internal code. Better to keep the the type of the object. As long as the API only passes around an pointer to a struct, without exposing the contents of the struct; it is safer and easier to debug.
as i mentioned you can use an inline/internal function or even a macro to hide the cast, you could provide some additional integrity checks here if desired as a value add.
the fact that you expose that it is a struct is an internal implementation detail, if truly opaque tomorrow you could convert it to a simple integer that indexes or enumerates something and prevents any meaningful interpretation in the application.
when you say it is safer to debug i think you mean for dpdk devs not the application developer because unless the app developer does something really gross/dangerous casting they really can't "mishandle" the opaque object except to use one that isn't initialized at all which we can detect and handle internally in a general way.
i will however concede there would be slightly more finger work when debugging dpdk itself since gdb / debugger doesn't automatically infer type so you end up having to tell gdb what is in the uintptr_t.
anyway just drawing from experience in the driver frameworks we maintain in windows, i think one of our regrets is that we didn't do this from day 1 and subsequentl that we initially only used one opaque type instead of defining separate (not implicitly convertable) types to each opaque type.
Re: [RFC PATCH 11/11] bus: hide bus object
Quoted 31 lines · On Tue, 28 Jun 2022 10:07:12 -0700 Tyler Retzlaff…
Quoted 11 lines
Quoted 6 lines
to avoid people tripping over mishandling pointers in/out of the api surface taking the opaque object you could declare opaque handle for the api to operate on instead. it would force the use of a cast in the implementation but would avoid accidental void * of the wrong thing that got cached being passed in. if the cast was really undesirable just whack it under an inline / internal function.
I don't like that because it least to dangerous casts in the internal code. Better to keep the the type of the object. As long as the API only passes around an pointer to a struct, without exposing the contents of the struct; it is safer and easier to debug.
as i mentioned you can use an inline/internal function or even a macro to hide the cast, you could provide some additional integrity checks here if desired as a value add.
the fact that you expose that it is a struct is an internal implementation detail, if truly opaque tomorrow you could convert it to a simple integer that indexes or enumerates something and prevents any meaningful interpretation in the application.
when you say it is safer to debug i think you mean for dpdk devs not the application developer because unless the app developer does something really gross/dangerous casting they really can't "mishandle" the opaque object except to use one that isn't initialized at all which we can detect and handle internally in a general way.
i will however concede there would be slightly more finger work when debugging dpdk itself since gdb / debugger doesn't automatically infer type so you end up having to tell gdb what is in the
uintptr_t.
Quoted 5 lines
anyway just drawing from experience in the driver frameworks we maintain in windows, i think one of our regrets is that we didn't do this from day 1 and subsequentl that we initially only used one opaque type instead of defining separate (not implicitly convertable) types to each opaque type.
It seems to be a difference in style/taste. The Linux/Unix side prefers opaque structure pointers. Windows (and LLVM) uses numeric handles.
At this point DPDK should follow the Linux bus.
Re: [RFC PATCH 11/11] bus: hide bus object
Quoted 34 lines · Stephen Hemminger
Quoted 31 lines · On Tue, 28 Jun 2022 10:07:12 -0700 Tyler Retzlaff…
Quoted 11 lines
Quoted 6 lines
to avoid people tripping over mishandling pointers in/out of the api surface taking the opaque object you could declare opaque handle for the api to operate on instead. it would force the use of a cast in the implementation but would avoid accidental void * of the wrong thing that got cached being passed in. if the cast was really undesirable just whack it under an inline / internal function.
I don't like that because it least to dangerous casts in the internal code. Better to keep the the type of the object. As long as the API only passes around an pointer to a struct, without exposing the contents of the struct; it is safer and easier to debug.
as i mentioned you can use an inline/internal function or even a macro to hide the cast, you could provide some additional integrity checks here if desired as a value add.
the fact that you expose that it is a struct is an internal implementation detail, if truly opaque tomorrow you could convert it to a simple integer that indexes or enumerates something and prevents any meaningful interpretation in the application.
when you say it is safer to debug i think you mean for dpdk devs not the application developer because unless the app developer does something really gross/dangerous casting they really can't "mishandle" the opaque object except to use one that isn't initialized at all which we can detect and handle internally in a general way.
i will however concede there would be slightly more finger work when debugging dpdk itself since gdb / debugger doesn't automatically infer type so you end up having to tell gdb what is in the
uintptr_t.
Quoted 7 lines
Quoted 5 lines
anyway just drawing from experience in the driver frameworks we maintain in windows, i think one of our regrets is that we didn't do this from day 1 and subsequentl that we initially only used one opaque type instead of defining separate (not implicitly convertable) types to each opaque type.
It seems to be a difference in style/taste.
it's not i've sited at least one example of a mistake that becomes a compile time failure where application code is incorrectly authored where use of a pointer offers no such protection.
Quoted 4 lines
The Linux/Unix side prefers opaque structure pointers. Windows (and LLVM) uses numeric handles.
At this point DPDK should follow the Linux bus.
dpdk is multi-platform and unix does not necessarily standardize on pointer to struct for opaque objects. freebsd has many apis notably bus_space that does uses handles and as previously mentioned posix threads uses handles.
i understand that linux is an important platform but it isn't the only platform dpdk targets and just because it is important doesn't mean it should always enjoy being the defacto standard.
anyway, i'll leave it for the patch author to decide. i still like the patch series either way. i just think this would make applications more robust.
Re: [RFC PATCH 11/11] bus: hide bus object
Quoted 58 lines · Tyler Retzlaff
Quoted 34 lines · Stephen Hemminger
Quoted 31 lines · On Tue, 28 Jun 2022 10:07:12 -0700 Tyler Retzlaff…
Quoted 11 lines
Quoted 6 lines
to avoid people tripping over mishandling pointers in/out of the api surface taking the opaque object you could declare opaque handle for the api to operate on instead. it would force the use of a cast in the implementation but would avoid accidental void * of the wrong thing that got cached being passed in. if the cast was really undesirable just whack it under an inline / internal function.
I don't like that because it least to dangerous casts in the internal code. Better to keep the the type of the object. As long as the API only passes around an pointer to a struct, without exposing the contents of the struct; it is safer and easier to debug.
as i mentioned you can use an inline/internal function or even a macro to hide the cast, you could provide some additional integrity checks here if desired as a value add.
the fact that you expose that it is a struct is an internal implementation detail, if truly opaque tomorrow you could convert it to a simple integer that indexes or enumerates something and prevents any meaningful interpretation in the application.
when you say it is safer to debug i think you mean for dpdk devs not the application developer because unless the app developer does something really gross/dangerous casting they really can't "mishandle" the opaque object except to use one that isn't initialized at all which we can detect and handle internally in a general way.
i will however concede there would be slightly more finger work when debugging dpdk itself since gdb / debugger doesn't automatically infer type so you end up having to tell gdb what is in the
uintptr_t.Quoted 7 lines
Quoted 5 lines
anyway just drawing from experience in the driver frameworks we maintain in windows, i think one of our regrets is that we didn't do this from day 1 and subsequentl that we initially only used one opaque type instead of defining separate (not implicitly convertable) types to each opaque type.
It seems to be a difference in style/taste.
it's not i've sited at least one example of a mistake that becomes a compile time failure where application code is incorrectly authored where use of a pointer offers no such protection.
Quoted 4 lines
The Linux/Unix side prefers opaque structure pointers. Windows (and LLVM) uses numeric handles.
At this point DPDK should follow the Linux bus.
dpdk is multi-platform and unix does not necessarily standardize on pointer to struct for opaque objects. freebsd has many apis notably
bus_spacethat does uses handles and as previously mentioned posix threads uses handles.
Quoted 7 lines
i understand that linux is an important platform but it isn't the only platform dpdk targets and just because it is important doesn't mean it should always enjoy being the defacto standard.
anyway, i'll leave it for the patch author to decide. i still like the patch series either way. i just think this would make applications more robust.
Thanks for this feedback Tyler.
I would lean towards Stephen opinion atm, but I am not decided yet.
For now, I'll post a v2, extending the series to other internal objects. We can conclude on this topic during 22.11.
Signature · 1 line
David Marchand
Re: [RFC PATCH 11/11] bus: hide bus object
Quoted 68 lines · On Sat, 9 Jul 2022 10:16:43 +0200 David Marchand <[email protected]>…
Quoted 58 lines · Tyler Retzlaff
Quoted 34 lines · Stephen Hemminger
Quoted 31 lines · On Tue, 28 Jun 2022 10:07:12 -0700 Tyler Retzlaff…
Quoted 11 lines
Quoted 6 lines
to avoid people tripping over mishandling pointers in/out of the api surface taking the opaque object you could declare opaque handle for the api to operate on instead. it would force the use of a cast in the implementation but would avoid accidental void * of the wrong thing that got cached being passed in. if the cast was really undesirable just whack it under an inline / internal function.
I don't like that because it least to dangerous casts in the internal code. Better to keep the the type of the object. As long as the API only passes around an pointer to a struct, without exposing the contents of the struct; it is safer and easier to debug.
as i mentioned you can use an inline/internal function or even a macro to hide the cast, you could provide some additional integrity checks here if desired as a value add.
the fact that you expose that it is a struct is an internal implementation detail, if truly opaque tomorrow you could convert it to a simple integer that indexes or enumerates something and prevents any meaningful interpretation in the application.
when you say it is safer to debug i think you mean for dpdk devs not the application developer because unless the app developer does something really gross/dangerous casting they really can't "mishandle" the opaque object except to use one that isn't initialized at all which we can detect and handle internally in a general way.
i will however concede there would be slightly more finger work when debugging dpdk itself since gdb / debugger doesn't automatically infer type so you end up having to tell gdb what is in the
uintptr_t.Quoted 7 lines
Quoted 5 lines
anyway just drawing from experience in the driver frameworks we maintain in windows, i think one of our regrets is that we didn't do this from day 1 and subsequentl that we initially only used one opaque type instead of defining separate (not implicitly convertable) types to each opaque type.
It seems to be a difference in style/taste.
it's not i've sited at least one example of a mistake that becomes a compile time failure where application code is incorrectly authored where use of a pointer offers no such protection.
Quoted 4 lines
The Linux/Unix side prefers opaque structure pointers. Windows (and LLVM) uses numeric handles.
At this point DPDK should follow the Linux bus.
dpdk is multi-platform and unix does not necessarily standardize on pointer to struct for opaque objects. freebsd has many apis notably
bus_spacethat does uses handles and as previously mentioned posix threads uses handles.Quoted 7 lines
i understand that linux is an important platform but it isn't the only platform dpdk targets and just because it is important doesn't mean it should always enjoy being the defacto standard.
anyway, i'll leave it for the patch author to decide. i still like the patch series either way. i just think this would make applications more robust.
Quoted 5 lines
Thanks for this feedback Tyler.
I would lean towards Stephen opinion atm, but I am not decided yet.For now, I'll post a v2, extending the series to other internal objects. We can conclude on this topic during 22.11.
If you get chance to deconstruct API, switching to a numeric index is safest similar to what Tyler suggested. Think of ethdev port number and Posix file descriptor model. The advantage of an index is that it can be validated more easily by the code that is called.
Re: [RFC PATCH 11/11] bus: hide bus object
Quoted 64 lines · Stephen Hemminger
Quoted 64 lines
Quoted 53 lines
Quoted 31 lines
Quoted 31 lines
Quoted 11 lines
Quoted 6 lines
to avoid people tripping over mishandling pointers in/out of the api surface taking the opaque object you could declare opaque handle for the api to operate on instead. it would force the use of a cast in the implementation but would avoid accidental void * of the wrong thing that got cached being passed in. if the cast was really undesirable just whack it under an inline / internal function.
I don't like that because it least to dangerous casts in the internal code. Better to keep the the type of the object. As long as the API only passes around an pointer to a struct, without exposing the contents of the struct; it is safer and easier to debug.
as i mentioned you can use an inline/internal function or even a macro to hide the cast, you could provide some additional integrity checks here if desired as a value add.
the fact that you expose that it is a struct is an internal implementation detail, if truly opaque tomorrow you could convert it to a simple integer that indexes or enumerates something and prevents any meaningful interpretation in the application.
when you say it is safer to debug i think you mean for dpdk devs not the application developer because unless the app developer does something really gross/dangerous casting they really can't "mishandle" the opaque object except to use one that isn't initialized at all which we can detect and handle internally in a general way.
i will however concede there would be slightly more finger work when debugging dpdk itself since gdb / debugger doesn't automatically infer type so you end up having to tell gdb what is in the
uintptr_t.Quoted 7 lines
Quoted 5 lines
anyway just drawing from experience in the driver frameworks we maintain in windows, i think one of our regrets is that we didn't do this from day 1 and subsequentl that we initially only used one opaque type instead of defining separate (not implicitly convertable) types to each opaque type.
It seems to be a difference in style/taste.
it's not i've sited at least one example of a mistake that becomes a compile time failure where application code is incorrectly authored where use of a pointer offers no such protection.
Quoted 4 lines
The Linux/Unix side prefers opaque structure pointers. Windows (and LLVM) uses numeric handles.
At this point DPDK should follow the Linux bus.
dpdk is multi-platform and unix does not necessarily standardize on pointer to struct for opaque objects. freebsd has many apis notably
bus_spacethat does uses handles and as previously mentioned posix threads uses handles.Quoted 7 lines
i understand that linux is an important platform but it isn't the only platform dpdk targets and just because it is important doesn't mean it should always enjoy being the defacto standard.
anyway, i'll leave it for the patch author to decide. i still like the patch series either way. i just think this would make applications more robust.
Thanks for this feedback Tyler.
I would lean towards Stephen opinion atm, but I am not decided yet.
Quoted 7 lines
Quoted 2 lines
For now, I'll post a v2, extending the series to other internal objects. We can conclude on this topic during 22.11.
If you get chance to deconstruct API, switching to a numeric index is safest similar to what Tyler suggested. Think of ethdev port number and Posix file descriptor model. The advantage of an index is that it can be validated more easily by the code that is called.
This is still a heavy change in the APIs.
The deprecation notice did not mention such change, and I don't think many people are aware of this suggestion.
This would need more discussion but I don't want to block the series on concluding on this question.
So I am for going ahead with the series in its current form.
Signature · 1 line
David Marchand
Re: [RFC PATCH 11/11] bus: hide bus object
23/09/2022 10:49, David Marchand:
Quoted 10 lines
Quoted 7 lines · Stephen Hemminger
Quoted 2 lines
For now, I'll post a v2, extending the series to other internal objects. We can conclude on this topic during 22.11.
If you get chance to deconstruct API, switching to a numeric index is safest similar to what Tyler suggested. Think of ethdev port number and Posix file descriptor model. The advantage of an index is that it can be validated more easily by the code that is called.
Quoted 7 lines
This is still a heavy change in the APIs.
The deprecation notice did not mention such change, and I don't think many people are aware of this suggestion.
This would need more discussion but I don't want to block the series on concluding on this question.So I am for going ahead with the series in its current form.
I agree that changing the object type would too much heavy. The goal of this series is to hide the object,
not changing the way we refer to it.
I understand the compilation check is stronger on a plain object than on a pointer, but I don't think this benefit is worth changing some basic API of DPDK.
It seems our users prefer having less API change.
v2 cover Bus and device cleanup for 22.11
In reply to David MarchandThis is a PoC for hiding the rte_bus, rte_driver and rte_device objects. 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.h and rte_eal.h headers, removing dependencies between them. This is something I had in store for some time, maybe I should have dropped it from the PoC, but I think those cleanups are worth it in any case.
Then PCI bus specific handling are moved from unit tests and examples, though there is still a special case left in testpmd that may require a new API, to be discussed.
After this series, driver-only API headers for registering to buses are not exported anymore, unless the enable_driver_sdk meson option is selected.
New accessors for rte_bus, rte_driver and rte_device have been added, marked with an experimental tag though we may declare them as stable right away so that users can switch to them directly. That's also something to agree on.
I simplified my series and switched to only update "external" users, like app/ and examples/ files.
We need some checkpatch new checks to be sure we won't get some driver-only headers included in these areas. That's something I'll work on in the non RFC series.
"Internal" users are simply using the internal headers. That helps greatly reducing the size of the changes.
Disclaimer: again, in this v2, this series is a bit rushed (I brute forced compilation tests in GHA so that it passes between patches, but there still may be something broken...).
Not surprisingly, the ABI check in the CI is expected to fail.
Comments welcome.
Changes since RFC v1:
- added two more cleanups (new patch 3 and 4) for unit test and examples relying on PCI specific info,
- went on with masking rte_driver and rte_device too,
Signature · 401 lines
David Marchand
David Marchand (29):
common/mlx5: rework check on driver registration
raw/ifpga: remove PCI bus accessor
kni: stop populating PCI info in examples
examples/ethtool: prefer device name
dev: hide debug messages in device iterator
dev: move unrelated macros from header
devargs: remove dependency on bus header
bus: remove unneeded inclusion of bus header
bus: move IOVA definition from header
drivers/bus: remove back reference to bus objects
drivers/bus: hide specific structures
bus: introduce accessors
bus: hide bus object
bbdev: mark driver header
ethdev: mark some headers as driver only
rawdev: mark driver header
drivers: export drivers headers
bus/auxiliary: make driver-only headers private
bus/dpaa: make driver-only headers private
bus/fslmc: make driver-only headers private
bus/ifpga: cleanup exported symbols
bus/ifpga: make driver-only headers private
bus/pci: make driver-only headers private
bus/vdev: make driver-only headers private
bus/vmbus: make driver-only headers private
dev: introduce driver name
dev: hide driver object
dev: introduce device accessors
dev: hide device object
app/proc-info/main.c | 6 +-
app/test-compress-perf/comp_perf_options.h | 2 +
app/test-pmd/config.c | 12 +-
app/test-pmd/testpmd.c | 4 +-
app/test-pmd/testpmd.h | 7 +-
app/test/test_devargs.c | 6 +-
app/test/test_kni.c | 30 --
app/test/test_vdev.c | 3 +-
app/test/virtual_pmd.c | 2 +-
drivers/baseband/acc100/rte_acc100_pmd.c | 4 +-
.../fpga_5gnr_fec/rte_fpga_5gnr_fec.c | 4 +-
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c | 4 +-
drivers/baseband/la12xx/bbdev_la12xx.c | 2 +-
drivers/baseband/null/bbdev_null.c | 2 +-
.../baseband/turbo_sw/bbdev_turbo_software.c | 2 +-
drivers/bus/auxiliary/auxiliary_common.c | 5 +-
drivers/bus/auxiliary/auxiliary_params.c | 5 +-
...bus_auxiliary.h => bus_auxiliary_driver.h} | 20 +-
drivers/bus/auxiliary/linux/auxiliary.c | 2 -
drivers/bus/auxiliary/meson.build | 4 +-
drivers/bus/auxiliary/private.h | 30 +-
drivers/bus/auxiliary/version.map | 3 +-
drivers/bus/dpaa/base/qbman/qman.c | 2 +-
.../{rte_dpaa_bus.h => bus_dpaa_driver.h} | 25 +-
drivers/bus/dpaa/dpaa_bus.c | 24 +-
.../fslmc/{rte_fslmc.h => bus_fslmc_driver.h} | 30 +-
drivers/bus/fslmc/fslmc_bus.c | 14 +-
drivers/bus/fslmc/fslmc_vfio.c | 5 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c | 4 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c | 4 +-
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c | 4 +-
drivers/bus/fslmc/portal/dpaa2_hw_dprc.c | 4 +-
drivers/bus/fslmc/private.h | 27 ++
.../{rte_bus_ifpga.h => bus_ifpga_driver.h} | 19 +-
drivers/bus/ifpga/ifpga_bus.c | 23 +-
drivers/bus/ifpga/ifpga_common.c | 88 ------
drivers/bus/ifpga/ifpga_common.h | 54 +++-
drivers/bus/ifpga/meson.build | 4 +-
drivers/bus/ifpga/version.map | 4 +-
drivers/bus/pci/bsd/pci.c | 3 -
drivers/bus/pci/bus_pci_driver.h | 200 ++++++++++++
drivers/bus/pci/linux/pci.c | 3 -
drivers/bus/pci/linux/pci_vfio.c | 2 +-
drivers/bus/pci/meson.build | 1 +
drivers/bus/pci/pci_common.c | 4 +-
drivers/bus/pci/pci_params.c | 4 +-
drivers/bus/pci/private.h | 19 +-
drivers/bus/pci/rte_bus_pci.h | 201 +-----------
drivers/bus/pci/version.map | 11 +-
drivers/bus/pci/windows/pci.c | 1 +
drivers/bus/pci/windows/pci_netuio.c | 1 +
drivers/bus/vdev/bus_vdev_driver.h | 151 +++++++++
drivers/bus/vdev/meson.build | 1 +
drivers/bus/vdev/rte_bus_vdev.h | 134 --------
drivers/bus/vdev/vdev.c | 12 +-
drivers/bus/vdev/vdev_params.c | 3 +-
drivers/bus/vdev/version.map | 9 +-
drivers/bus/vmbus/bus_vmbus_driver.h | 106 +++++++
drivers/bus/vmbus/linux/vmbus_uio.c | 1 -
drivers/bus/vmbus/meson.build | 1 +
drivers/bus/vmbus/private.h | 20 +-
drivers/bus/vmbus/rte_bus_vmbus.h | 104 ------
drivers/bus/vmbus/version.map | 9 +-
drivers/bus/vmbus/vmbus_bufring.c | 1 -
drivers/bus/vmbus/vmbus_channel.c | 1 -
drivers/bus/vmbus/vmbus_common.c | 3 -
drivers/bus/vmbus/vmbus_common_uio.c | 1 -
drivers/common/cnxk/roc_platform.h | 2 +-
.../common/mlx5/linux/mlx5_common_auxiliary.c | 12 +-
drivers/common/mlx5/linux/mlx5_common_os.c | 4 +-
drivers/common/mlx5/linux/mlx5_common_os.h | 2 +-
drivers/common/mlx5/mlx5_common.h | 2 +-
drivers/common/mlx5/mlx5_common_pci.c | 3 +-
drivers/common/mlx5/mlx5_common_private.h | 2 +-
drivers/common/mlx5/windows/mlx5_common_os.c | 2 +-
drivers/common/qat/dev/qat_dev_gen4.c | 2 +-
drivers/common/qat/qat_device.c | 1 +
drivers/common/qat/qat_device.h | 2 +-
drivers/common/qat/qat_qp.c | 4 +-
drivers/common/sfc_efx/sfc_efx.h | 2 +-
drivers/compress/isal/isal_compress_pmd.c | 2 +-
drivers/compress/mlx5/mlx5_compress.c | 2 +-
drivers/compress/octeontx/otx_zip.h | 2 +-
drivers/compress/qat/qat_comp.c | 2 +-
drivers/compress/qat/qat_comp_pmd.c | 1 +
drivers/compress/zlib/zlib_pmd.c | 2 +-
drivers/compress/zlib/zlib_pmd_ops.c | 1 +
drivers/crypto/armv8/rte_armv8_pmd.c | 2 +-
drivers/crypto/bcmfs/bcmfs_device.h | 2 +-
drivers/crypto/bcmfs/bcmfs_qp.c | 2 +-
drivers/crypto/bcmfs/bcmfs_sym_pmd.c | 2 +-
drivers/crypto/caam_jr/caam_jr.c | 2 +-
drivers/crypto/ccp/ccp_dev.h | 2 +-
drivers/crypto/ccp/ccp_pci.h | 2 +-
drivers/crypto/ccp/rte_ccp_pmd.c | 6 +-
drivers/crypto/cnxk/cn10k_cryptodev.c | 4 +-
drivers/crypto/cnxk/cn9k_cryptodev.c | 4 +-
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 4 +-
drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c | 2 +-
drivers/crypto/dpaa_sec/dpaa_sec.c | 4 +-
drivers/crypto/dpaa_sec/dpaa_sec_raw_dp.c | 2 +-
drivers/crypto/ipsec_mb/ipsec_mb_private.c | 2 +-
drivers/crypto/ipsec_mb/ipsec_mb_private.h | 2 +-
drivers/crypto/ipsec_mb/pmd_kasumi.c | 2 +-
drivers/crypto/mlx5/mlx5_crypto.c | 2 +-
drivers/crypto/mvsam/rte_mrvl_pmd.c | 2 +-
drivers/crypto/nitrox/nitrox_device.h | 2 +-
drivers/crypto/null/null_crypto_pmd.c | 2 +-
drivers/crypto/octeontx/otx_cryptodev.c | 2 +-
drivers/crypto/octeontx/otx_cryptodev_ops.c | 2 +-
drivers/crypto/openssl/rte_openssl_pmd.c | 2 +-
drivers/crypto/qat/qat_sym.c | 2 +-
.../scheduler/rte_cryptodev_scheduler.c | 1 +
drivers/crypto/scheduler/scheduler_pmd.c | 2 +-
drivers/crypto/scheduler/scheduler_pmd_ops.c | 2 +-
drivers/crypto/virtio/virtio_cryptodev.c | 2 +-
drivers/crypto/virtio/virtio_pci.c | 1 -
drivers/crypto/virtio/virtio_pci.h | 2 +-
drivers/dma/cnxk/cnxk_dmadev.c | 3 +-
drivers/dma/dpaa/dpaa_qdma.c | 2 +-
drivers/dma/dpaa2/dpaa2_qdma.c | 2 +-
drivers/dma/hisilicon/hisi_dmadev.c | 2 +-
drivers/dma/idxd/idxd_bus.c | 3 +-
drivers/dma/idxd/idxd_pci.c | 2 +-
drivers/dma/ioat/ioat_dmadev.c | 2 +-
drivers/dma/skeleton/skeleton_dmadev.c | 2 +-
drivers/event/dlb2/dlb2.c | 2 +-
drivers/event/dlb2/pf/dlb2_main.h | 2 +-
drivers/event/dlb2/pf/dlb2_pf.c | 4 +-
drivers/event/dpaa/dpaa_eventdev.c | 4 +-
drivers/event/dpaa2/dpaa2_eventdev.c | 6 +-
drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 4 +-
drivers/event/dpaa2/dpaa2_hw_dpcon.c | 4 +-
drivers/event/octeontx/ssovf_evdev.c | 4 +-
drivers/event/octeontx/ssovf_evdev_selftest.c | 2 +-
drivers/event/octeontx/ssovf_probe.c | 2 +-
drivers/event/octeontx/timvf_probe.c | 2 +-
drivers/event/opdl/opdl_evdev.c | 2 +-
drivers/event/opdl/opdl_evdev_init.c | 2 +-
drivers/event/opdl/opdl_test.c | 2 +-
drivers/event/skeleton/skeleton_eventdev.c | 4 +-
drivers/event/sw/sw_evdev.c | 2 +-
drivers/event/sw/sw_evdev_selftest.c | 2 +-
drivers/gpu/cuda/cuda.c | 4 +-
drivers/mempool/cnxk/cnxk_mempool.c | 2 +-
drivers/mempool/dpaa/dpaa_mempool.h | 2 +-
drivers/mempool/dpaa2/dpaa2_hw_mempool.c | 2 +-
drivers/mempool/octeontx/octeontx_fpavf.c | 2 +-
drivers/meson.build | 4 +
drivers/net/af_packet/rte_eth_af_packet.c | 2 +-
drivers/net/af_xdp/rte_eth_af_xdp.c | 4 +-
drivers/net/ark/ark_ethdev.c | 2 +-
drivers/net/ark/ark_global.h | 2 +-
drivers/net/avp/avp_ethdev.c | 4 +-
drivers/net/axgbe/axgbe_common.h | 2 +-
drivers/net/bnx2x/bnx2x.h | 2 +-
drivers/net/bnx2x/bnx2x_ethdev.c | 2 +-
drivers/net/bnxt/bnxt.h | 2 +-
drivers/net/bnxt/bnxt_ethdev.c | 2 +-
drivers/net/bnxt/rte_pmd_bnxt.c | 2 +-
drivers/net/bonding/rte_eth_bond_api.c | 2 +-
drivers/net/bonding/rte_eth_bond_args.c | 3 +-
drivers/net/bonding/rte_eth_bond_pmd.c | 2 +-
drivers/net/cxgbe/base/adapter.h | 2 +-
drivers/net/cxgbe/base/t4_hw.c | 2 +-
drivers/net/cxgbe/cxgbe_ethdev.c | 4 +-
drivers/net/cxgbe/cxgbe_main.c | 2 +-
drivers/net/cxgbe/sge.c | 2 +-
drivers/net/dpaa/dpaa_ethdev.c | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
drivers/net/dpaa2/base/dpaa2_hw_dpni.c | 2 +-
drivers/net/dpaa2/dpaa2_ethdev.c | 4 +-
drivers/net/dpaa2/dpaa2_ethdev.h | 2 +-
drivers/net/dpaa2/dpaa2_mux.c | 2 +-
drivers/net/dpaa2/dpaa2_ptp.c | 2 +-
drivers/net/dpaa2/dpaa2_recycle.c | 4 +-
drivers/net/dpaa2/dpaa2_rxtx.c | 4 +-
drivers/net/dpaa2/dpaa2_sparser.c | 2 +-
drivers/net/e1000/em_ethdev.c | 4 +-
drivers/net/e1000/em_rxtx.c | 2 +-
drivers/net/e1000/igb_ethdev.c | 4 +-
drivers/net/e1000/igb_flow.c | 2 +-
drivers/net/e1000/igb_pf.c | 2 +-
drivers/net/ena/ena_ethdev.h | 4 +-
drivers/net/enic/base/vnic_dev.h | 2 +-
drivers/net/enic/enic_ethdev.c | 4 +-
drivers/net/enic/enic_main.c | 2 +-
drivers/net/enic/enic_vf_representor.c | 4 +-
drivers/net/failsafe/failsafe.c | 3 +-
drivers/net/failsafe/failsafe_eal.c | 1 +
drivers/net/failsafe/failsafe_private.h | 2 +-
drivers/net/fm10k/fm10k_ethdev.c | 2 +-
drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +-
drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +-
drivers/net/hinic/base/hinic_pmd_nicio.c | 2 +-
drivers/net/hinic/hinic_pmd_ethdev.c | 2 +-
drivers/net/hns3/hns3_common.c | 2 +-
drivers/net/hns3/hns3_ethdev.c | 2 +-
drivers/net/hns3/hns3_rxtx.c | 2 +-
drivers/net/i40e/i40e_ethdev.c | 4 +-
drivers/net/i40e/i40e_vf_representor.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/igc/igc_ethdev.c | 2 +-
drivers/net/ionic/ionic.h | 2 +-
drivers/net/ionic/ionic_ethdev.c | 2 +-
drivers/net/ipn3ke/ipn3ke_ethdev.c | 4 +-
drivers/net/ipn3ke/ipn3ke_ethdev.h | 4 +-
drivers/net/ipn3ke/ipn3ke_flow.c | 2 +-
drivers/net/ipn3ke/ipn3ke_representor.c | 4 +-
drivers/net/ipn3ke/ipn3ke_tm.c | 4 +-
drivers/net/ixgbe/ixgbe_ethdev.c | 4 +-
drivers/net/ixgbe/ixgbe_ethdev.h | 2 +-
drivers/net/ixgbe/ixgbe_flow.c | 2 +-
drivers/net/ixgbe/rte_pmd_ixgbe.c | 1 +
drivers/net/kni/rte_eth_kni.c | 2 +-
drivers/net/liquidio/lio_ethdev.c | 1 +
drivers/net/memif/memif_socket.c | 2 +-
drivers/net/memif/rte_eth_memif.c | 2 +-
drivers/net/mlx4/mlx4.c | 2 +-
drivers/net/mlx4/mlx4_ethdev.c | 2 +-
drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +-
drivers/net/mlx5/linux/mlx5_os.c | 5 +-
drivers/net/mlx5/mlx5.c | 2 +-
drivers/net/mlx5/mlx5_ethdev.c | 2 +-
drivers/net/mlx5/mlx5_flow_dv.c | 2 +-
drivers/net/mlx5/mlx5_txq.c | 2 +-
drivers/net/mvneta/mvneta_ethdev.c | 2 +-
drivers/net/mvpp2/mrvl_ethdev.c | 2 +-
drivers/net/netvsc/hn_ethdev.c | 5 +-
drivers/net/netvsc/hn_nvs.c | 4 +-
drivers/net/netvsc/hn_rndis.c | 4 +-
drivers/net/netvsc/hn_rxtx.c | 4 +-
drivers/net/netvsc/hn_vf.c | 4 +-
drivers/net/nfp/nfp_common.c | 2 +-
drivers/net/nfp/nfp_ethdev.c | 2 +-
drivers/net/ngbe/base/ngbe_osdep.h | 2 +-
drivers/net/ngbe/ngbe_pf.c | 2 +-
drivers/net/null/rte_eth_null.c | 2 +-
drivers/net/octeontx/base/octeontx_pkivf.c | 2 +-
drivers/net/octeontx/base/octeontx_pkovf.c | 2 +-
drivers/net/octeontx/octeontx_ethdev.c | 4 +-
drivers/net/pcap/pcap_ethdev.c | 2 +-
drivers/net/pfe/pfe_ethdev.c | 2 +-
drivers/net/qede/base/bcm_osal.h | 2 +-
drivers/net/qede/qede_ethdev.h | 2 +-
drivers/net/ring/rte_eth_ring.c | 2 +-
drivers/net/sfc/sfc.h | 2 +-
drivers/net/sfc/sfc_ethdev.c | 4 +-
drivers/net/sfc/sfc_sriov.c | 2 +-
drivers/net/sfc/sfc_sw_stats.c | 2 +-
drivers/net/sfc/sfc_sw_stats.h | 2 +-
drivers/net/softnic/rte_eth_softnic.c | 2 +-
drivers/net/tap/rte_eth_tap.c | 2 +-
drivers/net/thunderx/nicvf_ethdev.c | 4 +-
drivers/net/txgbe/txgbe_ethdev.h | 2 +-
drivers/net/txgbe/txgbe_flow.c | 2 +-
drivers/net/txgbe/txgbe_pf.c | 2 +-
drivers/net/vdev_netvsc/vdev_netvsc.c | 6 +-
drivers/net/vhost/rte_eth_vhost.c | 2 +-
drivers/net/virtio/virtio_ethdev.c | 2 +-
drivers/net/virtio/virtio_pci.c | 2 +-
drivers/net/virtio/virtio_pci.h | 2 +-
drivers/net/virtio/virtio_pci_ethdev.c | 4 +-
drivers/net/virtio/virtio_user_ethdev.c | 2 +-
drivers/net/vmxnet3/vmxnet3_ethdev.c | 4 +-
drivers/raw/cnxk_bphy/cnxk_bphy.c | 4 +-
drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c | 2 +-
drivers/raw/cnxk_bphy/cnxk_bphy_irq.c | 2 +-
drivers/raw/cnxk_gpio/cnxk_gpio.c | 2 +-
drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 2 +-
drivers/raw/ifpga/afu_pmd_core.h | 2 +-
drivers/raw/ifpga/afu_pmd_he_hssi.c | 4 +-
drivers/raw/ifpga/afu_pmd_he_lpbk.c | 4 +-
drivers/raw/ifpga/afu_pmd_he_mem.c | 4 +-
drivers/raw/ifpga/afu_pmd_n3000.c | 4 +-
drivers/raw/ifpga/ifpga_rawdev.c | 15 +-
drivers/raw/ifpga/ifpga_rawdev.h | 1 -
drivers/raw/ifpga/rte_pmd_ifpga.c | 8 +-
drivers/raw/ifpga/rte_pmd_ifpga.h | 10 -
drivers/raw/ifpga/version.map | 1 -
drivers/raw/ioat/idxd_bus.c | 2 +-
drivers/raw/ioat/idxd_pci.c | 2 +-
drivers/raw/ioat/ioat_rawdev.c | 2 +-
drivers/raw/ntb/ntb.c | 2 +-
drivers/raw/ntb/ntb_hw_intel.c | 2 +-
drivers/raw/skeleton/skeleton_rawdev.c | 4 +-
drivers/raw/skeleton/skeleton_rawdev_test.c | 4 +-
drivers/regex/mlx5/mlx5_regex.c | 2 +-
drivers/regex/mlx5/mlx5_regex_control.c | 2 +-
drivers/regex/mlx5/mlx5_regex_fastpath.c | 2 +-
drivers/vdpa/ifc/base/ifcvf_osdep.h | 2 +-
drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +-
drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +-
drivers/vdpa/sfc/sfc_vdpa.h | 2 +-
examples/ethtool/lib/rte_ethtool.c | 17 +-
examples/ip_pipeline/kni.c | 10 -
examples/l3fwd/l3fwd_em.c | 4 +-
examples/l3fwd/l3fwd_fib.c | 8 +-
examples/l3fwd/l3fwd_lpm.c | 4 +-
examples/multi_process/hotplug_mp/commands.c | 6 +-
examples/vdpa/main.c | 16 +-
lib/bbdev/meson.build | 5 +-
lib/compressdev/rte_compressdev.c | 2 +
lib/compressdev/rte_compressdev_pmd.c | 1 +
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.c | 1 +
lib/dmadev/rte_dmadev_pmd.h | 2 +-
lib/eal/common/eal_common_bus.c | 28 +-
lib/eal/common/eal_common_dev.c | 41 ++-
lib/eal/common/eal_common_devargs.c | 2 +-
lib/eal/common/eal_private.h | 2 +-
lib/eal/common/eal_thread.h | 1 +
lib/eal/common/hotplug_mp.c | 1 +
lib/eal/include/bus_driver.h | 296 ++++++++++++++++++
lib/eal/include/dev_driver.h | 42 +++
lib/eal/include/meson.build | 5 +
lib/eal/include/rte_bus.h | 293 +----------------
lib/eal/include/rte_common.h | 11 +
lib/eal/include/rte_dev.h | 89 ++++--
lib/eal/include/rte_devargs.h | 4 +-
lib/eal/include/rte_eal.h | 15 +-
lib/eal/include/rte_lcore.h | 2 +
lib/eal/linux/eal_dev.c | 2 +-
lib/eal/version.map | 12 +-
lib/eal/windows/eal.c | 1 +
lib/ethdev/ethdev_driver.c | 1 +
lib/ethdev/ethdev_driver.h | 1 +
lib/ethdev/ethdev_pci.h | 5 +-
lib/ethdev/ethdev_vdev.h | 2 +-
lib/ethdev/meson.build | 6 +-
lib/ethdev/rte_ethdev.c | 1 +
lib/ethdev/rte_ethdev.h | 2 +-
lib/eventdev/eventdev_pmd.h | 2 +-
lib/eventdev/eventdev_pmd_pci.h | 2 +-
lib/eventdev/eventdev_pmd_vdev.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 | 3 +-
lib/pcapng/rte_pcapng.c | 3 +-
lib/rawdev/meson.build | 3 +-
lib/rawdev/rte_rawdev.c | 2 +-
lib/rawdev/rte_rawdev_pmd.h | 2 +-
lib/regexdev/rte_regexdev.c | 1 +
lib/security/rte_security.c | 3 +-
lib/vhost/vdpa.c | 2 +
353 files changed, 1605 insertions(+), 1480 deletions(-)
rename drivers/bus/auxiliary/{rte_bus_auxiliary.h => bus_auxiliary_driver.h} (91%)
rename drivers/bus/dpaa/{rte_dpaa_bus.h => bus_dpaa_driver.h} (92%)
rename drivers/bus/fslmc/{rte_fslmc.h => bus_fslmc_driver.h} (88%)
create mode 100644 drivers/bus/fslmc/private.h
rename drivers/bus/ifpga/{rte_bus_ifpga.h => bus_ifpga_driver.h} (91%)
delete mode 100644 drivers/bus/ifpga/ifpga_common.c
create mode 100644 drivers/bus/pci/bus_pci_driver.h
create mode 100644 drivers/bus/vdev/bus_vdev_driver.h
create mode 100644 drivers/bus/vmbus/bus_vmbus_driver.h
create mode 100644 lib/eal/include/bus_driver.h
create mode 100644 lib/eal/include/dev_driver.h
--
2.36.1RFC v2 1/29 common/mlx5: rework check on driver registration
Rely on a local flag rather than dereference a bus object. This will help next commits.
--- drivers/common/mlx5/linux/mlx5_common_auxiliary.c | 10 ++++++++-- 1 file changed, 8 insertions(+), 2 deletions(-)
drivers/common/mlx5/linux/mlx5_common_auxiliary.c +8 -2
@@ -179,14 +179,20 @@ static struct rte_auxiliary_driver mlx5_auxiliary_driver = { .dma_unmap = mlx5_common_auxiliary_dma_unmap, }; +static bool mlx5_common_auxiliary_initialized; +void mlx5_common_auxiliary_init (void ) { -if (mlx5_auxiliary_driver.bus ==NULL ) +if (!mlx5_common_auxiliary_initialized) {rte_auxiliary_register (&mlx5_auxiliary_driver); + mlx5_common_auxiliary_initialized = true; + } }RTE_FINI (mlx5_common_auxiliary_driver_finish) { -if (mlx5_auxiliary_driver.bus !=NULL ) +if (mlx5_common_auxiliary_initialized) {rte_auxiliary_unregister (&mlx5_auxiliary_driver); + mlx5_common_auxiliary_initialized = false; + } }
Signature · 1 line
2.36.1
RFC v2 2/29 raw/ifpga: remove PCI bus accessor
In reply to David MarchandThere is no in-tree user for this accessor that returns the PCI bus object.
On the other hand, a bus object can be retrieved by name using rte_bus_find_by_name.
We can remove driver specific API.
--- drivers/raw/ifpga/ifpga_rawdev.c | 7 +------ drivers/raw/ifpga/ifpga_rawdev.h | 1 - drivers/raw/ifpga/rte_pmd_ifpga.c | 6 ------ drivers/raw/ifpga/rte_pmd_ifpga.h | 10 ---------- drivers/raw/ifpga/version.map | 1 - 5 files changed, 1 insertion(+), 24 deletions(-)
drivers/raw/ifpga/ifpga_rawdev.c +1 -6
@@ -10,8 +10,8 @@#include <fcntl.h> #include <sys/ioctl.h> #include <sys/epoll.h> +#include <rte_log.h> -#include <rte_bus.h> #include <rte_malloc.h> #include <rte_devargs.h> #include <rte_memcpy.h>
@@ -1888,11 +1888,6 @@ RTE_PMD_REGISTER_PARAM_STRING(ifpga_rawdev_cfg,"port=<int> " "afu_bts=<path>"); -struct rte_pci_bus *ifpga_get_pci_bus (void ) -{ -return rte_ifpga_rawdev_pmd.bus; -} -int ifpga_rawdev_partial_reconfigure (struct rte_rawdev *dev,int port,const char *file) {
drivers/raw/ifpga/ifpga_rawdev.h +0 -1
@@ -91,7 +91,6 @@ int ifpga_unregister_msix_irq(struct ifpga_rawdev *dev, enum ifpga_irq_type type, int vec_start, rte_intr_callback_fn handler, void *arg); -struct rte_pci_bus *ifpga_get_pci_bus (void );int ifpga_rawdev_partial_reconfigure (struct rte_rawdev *dev,int port,const char *file);void ifpga_rawdev_cleanup (void );
drivers/raw/ifpga/rte_pmd_ifpga.c +0 -6
@@ -402,12 +402,6 @@ rte_pmd_ifpga_reload(uint16_t dev_id, int type, int page)return opae_mgr_reload (adapter->mgr, type, page); } -const struct rte_pci_bus * -rte_pmd_ifpga_get_pci_bus (void ) -{ -return ifpga_get_pci_bus (); -} -int rte_pmd_ifpga_partial_reconfigure (uint16_t dev_id,int port,const char *file) {
drivers/raw/ifpga/rte_pmd_ifpga.h +0 -10
@@ -220,16 +220,6 @@ rte_pmd_ifpga_reboot_try(uint16_t dev_id);int rte_pmd_ifpga_reload (uint16_t dev_id,int type,int page); -/** -* Get PCI bus the Intel FPGA driver register to -* -* @return -* - (valid pointer) if successful. -* - (NULL) if the Intel FPGA driver is not registered to any PCI bus. -*/ -const struct rte_pci_bus * -rte_pmd_ifpga_get_pci_bus (void ); -/** * Perform PR (partial reconfiguration) on specified Intel FPGA device *
drivers/raw/ifpga/version.map +0 -1
@@ -10,7 +10,6 @@ DPDK_22 { rte_pmd_ifpga_stop_update; rte_pmd_ifpga_reboot_try; rte_pmd_ifpga_reload; - rte_pmd_ifpga_get_pci_bus; rte_pmd_ifpga_partial_reconfigure; rte_pmd_ifpga_cleanup;
Signature · 1 line
2.36.1
RFC v2 3/29 kni: stop populating PCI info in examples
In reply to David Marchandaddr and id fields are deprecated and are not used in the kni library. Stop populating them in in-tree examples.
--- app/test/test_kni.c | 30 ------------------------------ examples/ip_pipeline/kni.c | 10 ---------- 2 files changed, 40 deletions(-)
app/test/test_kni.c +0 -30
@@ -25,7 +25,6 @@ test_kni(void)#include <rte_string_fns.h> #include <rte_mempool.h> #include <rte_ethdev.h> -#include <rte_bus_pci.h> #include <rte_cycles.h> #include <rte_kni.h>
@@ -426,8 +425,6 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp)struct rte_kni_conf conf;struct rte_eth_dev_info info;struct rte_kni_ops ops; -const struct rte_pci_device *pci_dev; -const struct rte_bus *bus =NULL ;if (!mp)return -1 ;
@@ -443,13 +440,6 @@ test_kni_processing(uint16_t port_id, struct rte_mempool *mp)return -1 ; } -if (info.device) - bus =rte_bus_find_by_device (info.device); -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (info.device); - conf.addr = pci_dev->addr; - conf.id = pci_dev->id; - }snprintf (conf.name,sizeof (conf.name),TEST_KNI_PORT );/* core id 1 configured for kernel thread */
@@ -545,8 +535,6 @@ test_kni(void)struct rte_kni_conf conf;struct rte_eth_dev_info info;struct rte_kni_ops ops; -const struct rte_pci_device *pci_dev; -const struct rte_bus *bus;FILE *fd;DIR *dir;char buf[16 ];
@@ -645,15 +633,6 @@ test_kni(void)return -1 ; } -if (info.device) - bus =rte_bus_find_by_device (info.device); -else - bus =NULL ; -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (info.device); - conf.addr = pci_dev->addr; - conf.id = pci_dev->id; - } conf.group_id = port_id; conf.mbuf_size =MAX_PACKET_SZ ;
@@ -689,15 +668,6 @@ test_kni(void) goto fail; } -if (info.device) - bus =rte_bus_find_by_device (info.device); -else - bus =NULL ; -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (info.device); - conf.addr = pci_dev->addr; - conf.id = pci_dev->id; - } conf.group_id = port_id; conf.mbuf_size =MAX_PACKET_SZ ;
examples/ip_pipeline/kni.c +0 -10
@@ -6,7 +6,6 @@#include <string.h> #include <rte_ethdev.h> -#include <rte_bus_pci.h> #include <rte_string_fns.h> #include "kni.h"
@@ -107,8 +106,6 @@ kni_create(const char *name, struct kni_params *params)struct mempool *mempool;struct link *link;struct rte_kni *k; -const struct rte_pci_device *pci_dev; -const struct rte_bus *bus =NULL ;int ret;/* Check input params */
@@ -134,13 +131,6 @@ kni_create(const char *name, struct kni_params *params) kni_conf.core_id = params->thread_id; kni_conf.group_id = link->port_id; kni_conf.mbuf_size = mempool->buffer_size; -if (dev_info.device) - bus =rte_bus_find_by_device (dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (dev_info.device); - kni_conf.addr = pci_dev->addr; - kni_conf.id = pci_dev->id; - }memset (&kni_ops,0 ,sizeof (kni_ops)); kni_ops.port_id = link->port_id;
Signature · 1 line
2.36.1
RFC v2 4/29 examples/ethtool: prefer device name
In reply to David MarchandRely on the generic device name rather than restrict to only supporting PCI devices.
--- examples/ethtool/lib/rte_ethtool.c | 17 ++--------------- 1 file changed, 2 insertions(+), 15 deletions(-)
examples/ethtool/lib/rte_ethtool.c +2 -15
@@ -8,7 +8,6 @@#include <rte_version.h> #include <rte_ethdev.h> #include <rte_ether.h> -#include <rte_bus_pci.h> #ifdef RTE_NET_IXGBE #include <rte_pmd_ixgbe.h> #endif
@@ -23,8 +22,6 @@ rte_ethtool_get_drvinfo(uint16_t port_id, struct ethtool_drvinfo *drvinfo) {struct rte_eth_dev_info dev_info;struct rte_dev_reg_info reg_info; -const struct rte_pci_device *pci_dev; -const struct rte_bus *bus =NULL ;int n;int ret;
@@ -52,18 +49,8 @@ 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)); -/* TODO: replace bus_info by rte_devargs.name */ -if (dev_info.device) - bus =rte_bus_find_by_device (dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { - pci_dev =RTE_DEV_TO_PCI (dev_info.device); -snprintf (drvinfo->bus_info,sizeof (drvinfo->bus_info), -"%04x:%02x:%02x.%x" , - pci_dev->addr.domain, pci_dev->addr.bus, - pci_dev->addr.devid, pci_dev->addr.function); - }else { -snprintf (drvinfo->bus_info,sizeof (drvinfo->bus_info),"N/A" ); - } +strlcpy (drvinfo->bus_info, dev_info.device->name, +sizeof (drvinfo->bus_info));memset (®_info,0 ,sizeof (reg_info));rte_eth_dev_get_reg_info (port_id, ®_info);
Signature · 1 line
2.36.1
RFC v2 5/29 dev: hide debug messages in device iterator
In reply to David MarchandFor any bus that does not support device iteration, rte_dev_iterator_init both returned an error code and logged an error message.
An application (like testpmd) that only wants to list devices, would have no choice but to inspect a bus object to avoid spewing error logs.
Make those log messages debug level, and remove the check in testpmd.
--- app/test-pmd/config.c | 4 ---- lib/eal/common/eal_common_dev.c | 7 +++---- 2 files changed, 3 insertions(+), 8 deletions(-)
app/test-pmd/config.c +0 -4
@@ -642,10 +642,6 @@ device_infos_display(const char *identifier)if (identifier && da.bus != next)continue ; -/* Skip buses that don't have iterate method */ -if (!next->dev_iterate) -continue ; -snprintf (devstr,sizeof (devstr),"bus=%s" , next->name); RTE_DEV_FOREACH(dev, devstr, &dev_iter) {
lib/eal/common/eal_common_dev.c +3 -4
@@ -592,18 +592,17 @@ rte_dev_iterator_init(struct rte_dev_iterator *it,* one layer specified. */ if (bus ==NULL && cls ==NULL ) { -RTE_LOG (ERR ,EAL , -"Either bus or class must be specified.\n" ); +RTE_LOG (DEBUG ,EAL ,"Either bus or class must be specified.\n" ); rte_errno =EINVAL ; goto get_out; }if (bus !=NULL && bus->dev_iterate ==NULL ) { -RTE_LOG (ERR ,EAL ,"Bus %s not supported\n" , bus->name); +RTE_LOG (DEBUG ,EAL ,"Bus %s not supported\n" , bus->name); rte_errno =ENOTSUP ; goto get_out; }if (cls !=NULL && cls->dev_iterate ==NULL ) { -RTE_LOG (ERR ,EAL ,"Class %s not supported\n" , cls->name); +RTE_LOG (DEBUG ,EAL ,"Class %s not supported\n" , cls->name); rte_errno =ENOTSUP ; goto get_out; }
Signature · 1 line
2.36.1
RFC v2 6/29 dev: move unrelated macros from header
In reply to David MarchandRTE_FUNC_PTR_OR_* macros have nothing to do with the rte_device object and associated API.
Move them to rte_common.h and include it where needed.
--- drivers/common/qat/qat_device.c | 1 + drivers/compress/qat/qat_comp_pmd.c | 1 + drivers/crypto/scheduler/rte_cryptodev_scheduler.c | 1 + drivers/net/ixgbe/rte_pmd_ixgbe.c | 1 + drivers/net/liquidio/lio_ethdev.c | 1 + lib/compressdev/rte_compressdev.c | 1 + lib/dmadev/rte_dmadev.c | 1 + lib/eal/include/rte_common.h | 11 +++++++++++ lib/eal/include/rte_dev.h | 11 ----------- lib/ethdev/ethdev_driver.c | 1 + lib/ethdev/ethdev_pci.h | 1 + lib/mempool/rte_mempool_ops.c | 1 + lib/regexdev/rte_regexdev.c | 1 + lib/security/rte_security.c | 1 + lib/vhost/vdpa.c | 1 + 15 files changed, 24 insertions(+), 11 deletions(-)
drivers/common/qat/qat_device.c +1 -0
@@ -2,6 +2,7 @@* Copyright(c) 2018-2022 Intel Corporation */ +#include <rte_common.h> #include <rte_string_fns.h> #include <rte_devargs.h> #include <ctype.h>
drivers/compress/qat/qat_comp_pmd.c +1 -0
@@ -2,6 +2,7 @@* Copyright(c) 2015-2022 Intel Corporation */ +#include <rte_common.h> #include <rte_malloc.h> #include "qat_comp.h"
drivers/crypto/scheduler/rte_cryptodev_scheduler.c +1 -0
@@ -1,6 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Intel Corporation */ +#include <rte_common.h> #include <rte_string_fns.h> #include <rte_reorder.h> #include <rte_cryptodev.h>
drivers/net/ixgbe/rte_pmd_ixgbe.c +1 -0
@@ -2,6 +2,7 @@* Copyright(c) 2010-2017 Intel Corporation */ +#include <rte_common.h> #include <ethdev_driver.h> #include "base/ixgbe_api.h"
drivers/net/liquidio/lio_ethdev.c +1 -0
@@ -2,6 +2,7 @@* Copyright(c) 2017 Cavium, Inc */ +#include <rte_common.h> #include <rte_string_fns.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
lib/compressdev/rte_compressdev.c +1 -0
@@ -6,6 +6,7 @@#include <stdio.h> #include <inttypes.h> +#include <rte_common.h> #include <rte_string_fns.h> #include <rte_malloc.h> #include <rte_eal.h>
lib/dmadev/rte_dmadev.c +1 -0
@@ -5,6 +5,7 @@#include <inttypes.h> +#include <rte_common.h> #include <rte_eal.h> #include <rte_lcore.h> #include <rte_log.h>
lib/eal/include/rte_common.h +11 -0
@@ -861,6 +861,17 @@ rte_log2_u64(uint64_t v)/** Number of elements in the array. */ #define RTE_DIM (a) (sizeof (a) / sizeof ((a)[0])) +/** Macros to check for invalid function pointers. */ +#define RTE_FUNC_PTR_OR_ERR_RET (func, retval) do { \ + if ((func) == NULL) \ + return retval; \ +} while (0) + +#define RTE_FUNC_PTR_OR_RET (func) do { \ + if ((func) == NULL) \ + return; \ +} while (0) +/** * Converts a numeric string to the equivalent uint64_t value. * As well as straight number conversion, also recognises the suffixes
lib/eal/include/rte_dev.h +0 -11
@@ -36,17 +36,6 @@ typedef void (*rte_dev_event_cb_fn)(const char *device_name,enum rte_dev_event_type event, void *cb_arg); -/* Macros to check for invalid function pointers */ -#define RTE_FUNC_PTR_OR_ERR_RET (func, retval) do { \ - if ((func) == NULL) \ - return retval; \ -} while (0) - -#define RTE_FUNC_PTR_OR_RET (func) do { \ - if ((func) == NULL) \ - return; \ -} while (0) -/** * Device policies. */
lib/ethdev/ethdev_driver.c +1 -0
@@ -2,6 +2,7 @@* Copyright(c) 2022 Intel Corporation */ +#include <rte_common.h> #include <rte_kvargs.h> #include <rte_malloc.h>
lib/ethdev/ethdev_pci.h +1 -0
@@ -10,6 +10,7 @@extern "C" {#endif +#include <rte_common.h> #include <rte_malloc.h> #include <rte_pci.h> #include <rte_bus_pci.h>
lib/mempool/rte_mempool_ops.c +1 -0
@@ -6,6 +6,7 @@#include <stdio.h> #include <string.h> +#include <rte_common.h> #include <rte_string_fns.h> #include <rte_mempool.h> #include <rte_errno.h>
lib/regexdev/rte_regexdev.c +1 -0
@@ -5,6 +5,7 @@#include <string.h> +#include <rte_common.h> #include <rte_memzone.h> #include <rte_string_fns.h>
lib/security/rte_security.c +1 -0
@@ -4,6 +4,7 @@* Copyright (c) 2020 Samsung Electronics Co., Ltd All Rights Reserved */ +#include <rte_common.h> #include <rte_cryptodev.h> #include <rte_dev.h> #include <rte_telemetry.h>
lib/vhost/vdpa.c +1 -0
@@ -10,6 +10,7 @@#include <sys/queue.h> +#include <rte_common.h> #include <rte_class.h> #include <rte_malloc.h> #include <rte_spinlock.h>
Signature · 1 line
2.36.1
RFC v2 7/29 devargs: remove dependency on bus header
In reply to David MarchandWe don't need to include rte_bus.h.
Only a forward declaration of rte_bus and an inclusion of rte_dev.h are needed.
--- app/test/test_vdev.c | 1 + lib/eal/include/rte_devargs.h | 4 +++- 2 files changed, 4 insertions(+), 1 deletion(-)
app/test/test_vdev.c +1 -0
@@ -8,6 +8,7 @@#include <rte_common.h> #include <rte_kvargs.h> +#include <rte_bus.h> #include <rte_bus_vdev.h> #include "test.h"
lib/eal/include/rte_devargs.h +3 -1
@@ -22,7 +22,9 @@ extern "C" {#include <stdio.h> #include <rte_compat.h> -#include <rte_bus.h> +#include <rte_dev.h> + +struct rte_bus ;/** * Bus type key in global devargs syntax.
Signature · 1 line
2.36.1
RFC v2 8/29 bus: remove unneeded inclusion of bus header
In reply to David MarchandThose files don't need to include rte_bus.h.
--- drivers/bus/auxiliary/linux/auxiliary.c | 1 - drivers/bus/ifpga/ifpga_common.c | 1 - drivers/bus/ifpga/rte_bus_ifpga.h | 1 - drivers/bus/vdev/vdev_params.c | 1 - drivers/bus/vmbus/linux/vmbus_uio.c | 1 - drivers/bus/vmbus/vmbus_bufring.c | 1 - drivers/bus/vmbus/vmbus_channel.c | 1 - drivers/bus/vmbus/vmbus_common_uio.c | 1 - drivers/crypto/virtio/virtio_pci.c | 1 - drivers/dma/cnxk/cnxk_dmadev.c | 1 - 10 files changed, 10 deletions(-)
drivers/bus/auxiliary/linux/auxiliary.c +0 -1
@@ -6,7 +6,6 @@#include <dirent.h> #include <rte_log.h> -#include <rte_bus.h> #include <rte_malloc.h> #include <rte_devargs.h> #include <rte_memcpy.h>
drivers/bus/ifpga/ifpga_common.c +0 -1
@@ -14,7 +14,6 @@#include <fcntl.h> #include <rte_errno.h> -#include <rte_bus.h> #include <rte_per_lcore.h> #include <rte_memory.h> #include <rte_memzone.h>
drivers/bus/ifpga/rte_bus_ifpga.h +0 -1
@@ -15,7 +15,6 @@extern "C" {#endif /* __cplusplus */ -#include <rte_bus.h> #include <rte_pci.h> #include <rte_interrupts.h> #include <rte_spinlock.h>
drivers/bus/vdev/vdev_params.c +0 -1
@@ -5,7 +5,6 @@#include <string.h> #include <rte_dev.h> -#include <rte_bus.h> #include <rte_kvargs.h> #include <rte_errno.h>
drivers/bus/vmbus/linux/vmbus_uio.c +0 -1
@@ -13,7 +13,6 @@#include <rte_eal.h> #include <rte_log.h> -#include <rte_bus.h> #include <rte_memory.h> #include <rte_common.h> #include <rte_malloc.h>
drivers/bus/vmbus/vmbus_bufring.c +0 -1
@@ -15,7 +15,6 @@#include <rte_tailq.h> #include <rte_log.h> #include <rte_malloc.h> -#include <rte_bus.h> #include <rte_atomic.h> #include <rte_memory.h> #include <rte_pause.h>
drivers/bus/vmbus/vmbus_channel.c +0 -1
@@ -12,7 +12,6 @@#include <rte_tailq.h> #include <rte_log.h> #include <rte_malloc.h> -#include <rte_bus.h> #include <rte_atomic.h> #include <rte_memory.h> #include <rte_bus_vmbus.h>
drivers/bus/vmbus/vmbus_common_uio.c +0 -1
@@ -13,7 +13,6 @@#include <rte_tailq.h> #include <rte_log.h> #include <rte_malloc.h> -#include <rte_bus.h> #include <rte_bus_vmbus.h> #include "private.h"
drivers/crypto/virtio/virtio_pci.c +0 -1
@@ -10,7 +10,6 @@#endif #include <rte_io.h> -#include <rte_bus.h> #include "virtio_pci.h" #include "virtqueue.h"
drivers/dma/cnxk/cnxk_dmadev.c +0 -1
@@ -5,7 +5,6 @@#include <string.h> #include <unistd.h> -#include <rte_bus.h> #include <rte_bus_pci.h> #include <rte_common.h> #include <rte_eal.h>
Signature · 1 line
2.36.1
RFC v2 9/29 bus: move IOVA definition from header
In reply to David Marchandiova enum definition does not need to be defined as part of the bus API. Move it to rte_eal.h.
With this step, rte_eal.h does not depend on rte_bus.h and rte_dev.h. Fix existing code that was relying on these implicit inclusions.
--- app/test-compress-perf/comp_perf_options.h | 2 ++ drivers/bus/vmbus/rte_bus_vmbus.h | 1 + drivers/compress/zlib/zlib_pmd_ops.c | 1 + drivers/net/failsafe/failsafe.c | 1 + drivers/net/failsafe/failsafe_eal.c | 1 + examples/multi_process/hotplug_mp/commands.c | 2 ++ lib/compressdev/rte_compressdev.c | 1 + lib/compressdev/rte_compressdev_pmd.c | 1 + lib/cryptodev/cryptodev_pmd.c | 2 ++ lib/eal/common/eal_thread.h | 1 + lib/eal/common/hotplug_mp.c | 1 + lib/eal/include/rte_bus.h | 18 ++---------------- lib/eal/include/rte_eal.h | 15 ++++++++++++++- lib/eal/include/rte_lcore.h | 2 ++ lib/eal/windows/eal.c | 1 + lib/ethdev/rte_ethdev.c | 1 + lib/pcapng/rte_pcapng.c | 1 + 17 files changed, 35 insertions(+), 17 deletions(-)
app/test-compress-perf/comp_perf_options.h +2 -0
@@ -5,6 +5,8 @@#ifndef _COMP_PERF_OPS_#define _COMP_PERF_OPS_ +#include <rte_dev.h> +#define MAX_LIST 32#define MIN_COMPRESSED_BUF_SIZE 8#define EXPANSE_RATIO 1.1
drivers/bus/vmbus/rte_bus_vmbus.h +1 -0
@@ -23,6 +23,7 @@ extern "C" {#include <stdint.h> #include <inttypes.h> +#include <rte_bus.h> #include <rte_compat.h> #include <rte_uuid.h> #include <rte_debug.h>
drivers/compress/zlib/zlib_pmd_ops.c +1 -0
@@ -4,6 +4,7 @@#include <string.h> +#include <rte_dev.h> #include <rte_common.h> #include <rte_malloc.h>
drivers/net/failsafe/failsafe.c +1 -0
@@ -11,6 +11,7 @@#include <ethdev_vdev.h> #include <rte_devargs.h> #include <rte_kvargs.h> +#include <rte_bus.h> #include <rte_bus_vdev.h> #include "failsafe_private.h"
drivers/net/failsafe/failsafe_eal.c +1 -0
@@ -3,6 +3,7 @@* Copyright 2017 Mellanox Technologies, Ltd */ +#include <rte_bus.h> #include <rte_string_fns.h> #include <rte_malloc.h>
examples/multi_process/hotplug_mp/commands.c +2 -0
@@ -8,6 +8,8 @@#include <cmdline_parse_num.h> #include <cmdline_parse_string.h> #include <cmdline.h> + +#include <rte_bus.h> #include <rte_ethdev.h> /**********************************************************/
lib/compressdev/rte_compressdev.c +1 -0
@@ -9,6 +9,7 @@#include <rte_common.h> #include <rte_string_fns.h> #include <rte_malloc.h> +#include <rte_dev.h> #include <rte_eal.h> #include <rte_memzone.h>
lib/compressdev/rte_compressdev_pmd.c +1 -0
@@ -5,6 +5,7 @@#include <rte_string_fns.h> #include <rte_malloc.h> #include <rte_kvargs.h> +#include <rte_dev.h> #include <rte_eal.h> #include "rte_compressdev_internal.h"
lib/cryptodev/cryptodev_pmd.c +2 -0
@@ -3,6 +3,8 @@*/ #include <sys/queue.h> + +#include <rte_dev.h> #include <rte_errno.h> #include <rte_string_fns.h> #include <rte_malloc.h>
lib/eal/common/eal_thread.h +1 -0
@@ -5,6 +5,7 @@#ifndef EAL_THREAD_H #define EAL_THREAD_H +#include <rte_common.h> #include <rte_lcore.h> /**
lib/eal/common/hotplug_mp.c +1 -0
@@ -3,6 +3,7 @@*/ #include <string.h> +#include <rte_bus.h> #include <rte_eal.h> #include <rte_errno.h> #include <rte_alarm.h>
lib/eal/include/rte_bus.h +2 -16
@@ -20,27 +20,13 @@ extern "C" {#include <stdio.h> -#include <rte_log.h> #include <rte_dev.h> +#include <rte_eal.h> +#include <rte_log.h> /** Double linked list of buses */ RTE_TAILQ_HEAD (rte_bus_list, rte_bus); - -/** -* IOVA mapping mode. -* -* IOVA mapping mode is iommu programming mode of a device. -* That device (for example: IOMMU backed DMA device) based -* on rte_iova_mode will generate physical or virtual address. -* -*/ -enum rte_iova_mode { -RTE_IOVA_DC =0 ,/* Don't care mode */ -RTE_IOVA_PA = (1 <<0 ),/* DMA using physical address */ -RTE_IOVA_VA = (1 <<1 )/* DMA using virtual address */ -}; -/** * Bus specific scan for devices attached on the bus. * For each bus object, the scan would be responsible for finding devices and
lib/eal/include/rte_eal.h +14 -1
@@ -17,7 +17,6 @@#include <rte_config.h> #include <rte_compat.h> #include <rte_per_lcore.h> -#include <rte_bus.h> #include <rte_uuid.h> #include <rte_pci_dev_feature_defs.h>
@@ -458,6 +457,20 @@ static inline int rte_gettid(void)__rte_internal uint64_t rte_eal_get_baseaddr(void); +/** +* IOVA mapping mode. +* +* IOVA mapping mode is iommu programming mode of a device. +* That device (for example: IOMMU backed DMA device) based +* on rte_iova_mode will generate physical or virtual address. +* +*/ +enum rte_iova_mode { +RTE_IOVA_DC =0 ,/* Don't care mode */ +RTE_IOVA_PA = (1 <<0 ),/* DMA using physical address */ +RTE_IOVA_VA = (1 <<1 )/* DMA using virtual address */ +}; +/** * Get the iova mode *
lib/eal/include/rte_lcore.h +2 -0
@@ -11,6 +11,8 @@* API for lcore and socket manipulation * */ +#include <stdio.h> +#include <rte_config.h> #include <rte_per_lcore.h> #include <rte_eal.h>
lib/eal/windows/eal.c +1 -0
@@ -10,6 +10,7 @@#include <sys/stat.h> #include <rte_debug.h> +#include <rte_bus.h> #include <rte_eal.h> #include <eal_memcfg.h> #include <rte_errno.h>
lib/ethdev/rte_ethdev.c +1 -0
@@ -11,6 +11,7 @@#include <string.h> #include <sys/queue.h> +#include <rte_bus.h> #include <rte_log.h> #include <rte_interrupts.h> #include <rte_memcpy.h>
lib/pcapng/rte_pcapng.c +1 -0
@@ -11,6 +11,7 @@#include <time.h> #include <unistd.h> +#include <rte_bus.h> #include <rte_common.h> #include <rte_cycles.h> #include <rte_dev.h>
Signature · 1 line
2.36.1
RFC v2 10/29 drivers/bus: remove back reference to bus objects
In reply to David MarchandThere is no need for a back reference to a singleton object in the bus driver objects: each function is contextually aware of which bus object it should manipulate.
--- drivers/bus/auxiliary/auxiliary_common.c | 2 -- drivers/bus/auxiliary/rte_bus_auxiliary.h | 2 -- drivers/bus/dpaa/dpaa_bus.c | 10 +--------- drivers/bus/dpaa/rte_dpaa_bus.h | 1 - drivers/bus/fslmc/fslmc_bus.c | 10 +--------- drivers/bus/fslmc/rte_fslmc.h | 1 - drivers/bus/pci/pci_common.c | 2 -- drivers/bus/pci/rte_bus_pci.h | 1 - drivers/bus/vmbus/rte_bus_vmbus.h | 2 -- drivers/bus/vmbus/vmbus_common.c | 2 -- 10 files changed, 2 insertions(+), 31 deletions(-)
drivers/bus/auxiliary/auxiliary_common.c +0 -2
@@ -259,7 +259,6 @@ void rte_auxiliary_register(struct rte_auxiliary_driver *driver) {TAILQ_INSERT_TAIL (&auxiliary_bus.driver_list, driver, next); - driver->bus = &auxiliary_bus; }/* Unregister a driver */
@@ -267,7 +266,6 @@ void rte_auxiliary_unregister(struct rte_auxiliary_driver *driver) {TAILQ_REMOVE (&auxiliary_bus.driver_list, driver, next); - driver->bus =NULL ; }/* Add a device to auxiliary bus */
drivers/bus/auxiliary/rte_bus_auxiliary.h +0 -2
@@ -32,7 +32,6 @@ extern "C" {/* Forward declarations */ struct rte_auxiliary_driver ; -struct rte_auxiliary_bus ;struct rte_auxiliary_device ;/**
@@ -125,7 +124,6 @@ struct rte_auxiliary_device {struct rte_auxiliary_driver {RTE_TAILQ_ENTRY (rte_auxiliary_driver) next;/**< Next in list. */ struct rte_driver driver;/**< Inherit core driver. */ -struct rte_auxiliary_bus *bus;/**< Auxiliary bus reference. */ rte_auxiliary_match_t *match;/**< Device match function. */ rte_auxiliary_probe_t *probe;/**< Device probe function. */ rte_auxiliary_remove_t *remove;/**< Device remove function. */
drivers/bus/dpaa/dpaa_bus.c +1 -9
@@ -520,23 +520,15 @@ rte_dpaa_driver_register(struct rte_dpaa_driver *driver)BUS_INIT_FUNC_TRACE ();TAILQ_INSERT_TAIL (&rte_dpaa_bus.driver_list, driver, next); -/* Update Bus references */ - driver->dpaa_bus = &rte_dpaa_bus; }/* un-register a dpaa bus based dpaa driver */ void rte_dpaa_driver_unregister (struct rte_dpaa_driver *driver) { -struct rte_dpaa_bus *dpaa_bus; -BUS_INIT_FUNC_TRACE (); - dpaa_bus = driver->dpaa_bus; - -TAILQ_REMOVE (&dpaa_bus->driver_list, driver, next); -/* Update Bus references */ - driver->dpaa_bus =NULL ; +TAILQ_REMOVE (&rte_dpaa_bus.driver_list, driver, next); } static int
drivers/bus/dpaa/rte_dpaa_bus.h +0 -1
@@ -119,7 +119,6 @@ typedef int (*rte_dpaa_remove_t)(struct rte_dpaa_device *dpaa_dev);struct rte_dpaa_driver {TAILQ_ENTRY (rte_dpaa_driver) next;struct rte_driver driver; -struct rte_dpaa_bus *dpaa_bus;enum rte_dpaa_type drv_type;rte_dpaa_probe_t probe;rte_dpaa_remove_t remove;
drivers/bus/fslmc/fslmc_bus.c +1 -9
@@ -530,27 +530,19 @@ rte_fslmc_driver_register(struct rte_dpaa2_driver *driver)RTE_VERIFY (driver);TAILQ_INSERT_TAIL (&rte_fslmc_bus.driver_list, driver, next); -/* Update Bus references */ - driver->fslmc_bus = &rte_fslmc_bus; }/*un-register a fslmc bus based dpaa2 driver */ void rte_fslmc_driver_unregister (struct rte_dpaa2_driver *driver) { -struct rte_fslmc_bus *fslmc_bus; - - fslmc_bus = driver->fslmc_bus; -/* Cleanup the PA->VA Translation table; From wherever this function * is called from. */ if (rte_eal_iova_mode () ==RTE_IOVA_PA )dpaax_iova_table_depopulate (); -TAILQ_REMOVE (&fslmc_bus->driver_list, driver, next); -/* Update Bus references */ - driver->fslmc_bus =NULL ; +TAILQ_REMOVE (&rte_fslmc_bus.driver_list, driver, next); }/*
drivers/bus/fslmc/rte_fslmc.h +0 -1
@@ -146,7 +146,6 @@ typedef int (*rte_dpaa2_remove_t)(struct rte_dpaa2_device *dpaa2_dev);struct rte_dpaa2_driver {TAILQ_ENTRY (rte_dpaa2_driver) next;/**< Next in list. */ struct rte_driver driver;/**< Inherit core driver. */ -struct rte_fslmc_bus *fslmc_bus;/**< FSLMC bus reference */ uint32_t drv_flags;/**< Flags for controlling device.*/ enum rte_dpaa2_dev_type drv_type;/**< Driver Type */ rte_dpaa2_probe_t probe;
drivers/bus/pci/pci_common.c +0 -2
@@ -443,7 +443,6 @@ void rte_pci_register(struct rte_pci_driver *driver) {TAILQ_INSERT_TAIL (&rte_pci_bus.driver_list, driver, next); - driver->bus = &rte_pci_bus; }/* unregister a driver */
@@ -451,7 +450,6 @@ void rte_pci_unregister(struct rte_pci_driver *driver) {TAILQ_REMOVE (&rte_pci_bus.driver_list, driver, next); - driver->bus =NULL ; }/* Add a device to PCI bus */
drivers/bus/pci/rte_bus_pci.h +0 -1
@@ -161,7 +161,6 @@ typedef int (pci_dma_unmap_t)(struct rte_pci_device *dev, void *addr,struct rte_pci_driver {RTE_TAILQ_ENTRY (rte_pci_driver) next;/**< Next in list. */ struct rte_driver driver;/**< Inherit core driver. */ -struct rte_pci_bus *bus;/**< PCI bus reference. */ rte_pci_probe_t *probe;/**< Device probe function. */ rte_pci_remove_t *remove;/**< Device remove function. */ pci_dma_map_t *dma_map;/**< device dma map function. */
drivers/bus/vmbus/rte_bus_vmbus.h +0 -2
@@ -34,7 +34,6 @@ extern "C" {/* Forward declarations */ struct rte_vmbus_device ;struct rte_vmbus_driver ; -struct rte_vmbus_bus ;struct vmbus_channel ;struct vmbus_mon_page ;
@@ -95,7 +94,6 @@ typedef int (vmbus_remove_t)(struct rte_vmbus_device *);struct rte_vmbus_driver {RTE_TAILQ_ENTRY (rte_vmbus_driver) next;/**< Next in list. */ struct rte_driver driver; -struct rte_vmbus_bus *bus;/**< VM bus reference. */ vmbus_probe_t *probe;/**< Device Probe function. */ vmbus_remove_t *remove;/**< Device Remove function. */
drivers/bus/vmbus/vmbus_common.c +0 -2
@@ -235,7 +235,6 @@ rte_vmbus_register(struct rte_vmbus_driver *driver) "Registered driver %s", driver->driver.name);TAILQ_INSERT_TAIL (&rte_vmbus_bus.driver_list, driver, next); - driver->bus = &rte_vmbus_bus; }/* unregister vmbus driver */
@@ -243,7 +242,6 @@ void rte_vmbus_unregister(struct rte_vmbus_driver *driver) {TAILQ_REMOVE (&rte_vmbus_bus.driver_list, driver, next); - driver->bus =NULL ; }/* Add a device to VMBUS bus */
Signature · 1 line
2.36.1
RFC v2 11/29 drivers/bus: hide specific structures
In reply to David MarchandNow that there is no bus specific object referenced in the driver objects, we can hide rte_dpaa_bus, rte_fslmc_bus, rte_pci_bus, rte_vmbus_bus specific structures into their bus code.
While at it:
- move enumerators only used in the bus code itself,
- remove unneeded list head structure type,
- reorder the definitions and macro manipulating the bus singleton object,
- remove inclusion of rte_bus.h and update code that relied on it,
---
Changes since RFC v1:
- dropped kni UT and ethtool example changes after new cleanup was added,
- cleaned ifgpa and vdev bus,
--- app/test-pmd/testpmd.h | 1 + drivers/bus/auxiliary/private.h | 28 +++++++++++------------ drivers/bus/auxiliary/rte_bus_auxiliary.h | 1 - drivers/bus/dpaa/dpaa_bus.c | 8 +++++++ drivers/bus/dpaa/rte_dpaa_bus.h | 13 ----------- drivers/bus/fslmc/fslmc_bus.c | 1 + drivers/bus/fslmc/fslmc_vfio.c | 2 +- drivers/bus/fslmc/portal/dpaa2_hw_dprc.c | 1 + drivers/bus/fslmc/private.h | 27 ++++++++++++++++++++++ drivers/bus/fslmc/rte_fslmc.h | 20 ---------------- drivers/bus/ifpga/ifpga_bus.c | 4 ++-- drivers/bus/ifpga/rte_bus_ifpga.h | 6 ----- drivers/bus/pci/bsd/pci.c | 2 -- drivers/bus/pci/linux/pci.c | 3 --- drivers/bus/pci/private.h | 18 ++++++++++++++- drivers/bus/pci/rte_bus_pci.h | 22 ------------------ drivers/bus/pci/windows/pci.c | 1 + drivers/bus/pci/windows/pci_netuio.c | 1 + drivers/bus/vdev/rte_bus_vdev.h | 3 --- drivers/bus/vdev/vdev.c | 6 ++--- drivers/bus/vmbus/private.h | 18 +++++++++++++++ drivers/bus/vmbus/rte_bus_vmbus.h | 20 ---------------- drivers/bus/vmbus/vmbus_common.c | 1 - drivers/common/mlx5/mlx5_common_pci.c | 1 + drivers/net/bonding/rte_eth_bond_args.c | 1 + drivers/net/mlx5/linux/mlx5_os.c | 1 + drivers/net/netvsc/hn_ethdev.c | 1 + 27 files changed, 97 insertions(+), 114 deletions(-) create mode 100644 drivers/bus/fslmc/private.h
app/test-pmd/testpmd.h +1 -0
@@ -8,6 +8,7 @@#include <stdbool.h> #include <rte_pci.h> +#include <rte_bus.h> #include <rte_bus_pci.h> #ifdef RTE_LIB_GRO #include <rte_gro.h>
drivers/bus/auxiliary/private.h +13 -15
@@ -9,9 +9,10 @@#include <stdio.h> #include <sys/queue.h> +#include <rte_bus.h> +#include "rte_bus_auxiliary.h" -extern struct rte_auxiliary_bus auxiliary_bus;extern int auxiliary_bus_logtype;#define AUXILIARY_LOG (level, ...) \
@@ -19,27 +20,24 @@ extern int auxiliary_bus_logtype; RTE_FMT("auxiliary bus: " RTE_FMT_HEAD(__VA_ARGS__,) "\n", \ RTE_FMT_TAIL(__VA_ARGS__,))) -/* Auxiliary bus iterators */ -#define FOREACH_DEVICE_ON_AUXILIARY_BUS (p) \ - TAILQ_FOREACH(p, &(auxiliary_bus.device_list), next) - -#define FOREACH_DRIVER_ON_AUXILIARY_BUS (p) \ - TAILQ_FOREACH(p, &(auxiliary_bus.driver_list), next) - -/* List of auxiliary devices. */ -TAILQ_HEAD (rte_auxiliary_device_list, rte_auxiliary_device); -/* List of auxiliary drivers. */ -TAILQ_HEAD (rte_auxiliary_driver_list, rte_auxiliary_driver); -/* * Structure describing the auxiliary bus */struct rte_auxiliary_bus {struct rte_bus bus;/* Inherit the generic class */ -struct rte_auxiliary_device_list device_list;/* List of devices */ -struct rte_auxiliary_driver_list driver_list;/* List of drivers */ + TAILQ_HEAD(, rte_auxiliary_device) device_list; /* List of devices */ + TAILQ_HEAD(, rte_auxiliary_driver) driver_list; /* List of drivers */ }; +extern struct rte_auxiliary_bus auxiliary_bus; + +/* Auxiliary bus iterators */ +#define FOREACH_DEVICE_ON_AUXILIARY_BUS (p) \ + TAILQ_FOREACH(p, &(auxiliary_bus.device_list), next) + +#define FOREACH_DRIVER_ON_AUXILIARY_BUS (p) \ + TAILQ_FOREACH(p, &(auxiliary_bus.driver_list), next) +/* * Test whether the auxiliary device exist. */
drivers/bus/auxiliary/rte_bus_auxiliary.h +0 -1
@@ -25,7 +25,6 @@ extern "C" {#include <rte_debug.h> #include <rte_interrupts.h> #include <rte_dev.h> -#include <rte_bus.h> #include <rte_kvargs.h> #define RTE_BUS_AUXILIARY_NAME "auxiliary"
drivers/bus/dpaa/dpaa_bus.c +8 -0
@@ -43,6 +43,14 @@#include <fsl_bman.h> #include <netcfg.h> +struct rte_dpaa_bus { +struct rte_bus bus; + TAILQ_HEAD(, rte_dpaa_device) device_list; + TAILQ_HEAD(, rte_dpaa_driver) driver_list; +int device_count; +int detected; +}; +static struct rte_dpaa_bus rte_dpaa_bus;struct netcfg_info *dpaa_netcfg;
drivers/bus/dpaa/rte_dpaa_bus.h +0 -13
@@ -6,7 +6,6 @@#ifndef __RTE_DPAA_BUS_H__#define __RTE_DPAA_BUS_H__ -#include <rte_bus.h> #include <rte_mbuf_dyn.h> #include <rte_mempool.h> #include <dpaax_iova_table.h>
@@ -73,24 +72,12 @@ extern unsigned int dpaa_svr_family;struct rte_dpaa_device ;struct rte_dpaa_driver ; -/* DPAA Device and Driver lists for DPAA bus */ -TAILQ_HEAD (rte_dpaa_device_list, rte_dpaa_device); -TAILQ_HEAD (rte_dpaa_driver_list, rte_dpaa_driver); -enum rte_dpaa_type {FSL_DPAA_ETH =1 ,FSL_DPAA_CRYPTO ,FSL_DPAA_QDMA }; -struct rte_dpaa_bus { -struct rte_bus bus; -struct rte_dpaa_device_list device_list; -struct rte_dpaa_driver_list driver_list; -int device_count; -int detected; -}; -struct dpaa_device_id {uint8_t fman_id;/**< Fman interface ID, for ETH type device */ uint8_t mac_id;/**< Fman MAC interface ID, for ETH type device */
drivers/bus/fslmc/fslmc_bus.c +1 -0
@@ -16,6 +16,7 @@#include <ethdev_driver.h> #include <rte_mbuf_dyn.h> +#include "private.h" #include <rte_fslmc.h> #include <fslmc_vfio.h> #include "fslmc_logs.h"
drivers/bus/fslmc/fslmc_vfio.c +1 -1
@@ -29,9 +29,9 @@#include <rte_cycles.h> #include <rte_kvargs.h> #include <rte_dev.h> -#include <rte_bus.h> #include <rte_eal_memconfig.h> +#include "private.h" #include "rte_fslmc.h" #include "fslmc_vfio.h" #include "fslmc_logs.h"
drivers/bus/fslmc/portal/dpaa2_hw_dprc.c +1 -0
@@ -12,6 +12,7 @@#include <rte_malloc.h> #include <rte_dev.h> +#include "private.h" #include <fslmc_logs.h> #include <rte_fslmc.h> #include <mc/fsl_dprc.h>
drivers/bus/fslmc/private.h new file +27 -0
@@ -0,0 +1,27 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright 2016,2021 NXP +*/ + +#ifndef __PRIVATE_H__ +#define __PRIVATE_H__ + +#include <rte_bus.h> + +#include <rte_fslmc.h> + +/* +* FSLMC bus +*/ +struct rte_fslmc_bus { +struct rte_bus bus;/**< Generic Bus object */ + TAILQ_HEAD(, rte_dpaa2_device) device_list; +/**< FSLMC DPAA2 Device list */ + TAILQ_HEAD(, rte_dpaa2_driver) driver_list; +/**< FSLMC DPAA2 Driver list */ +int device_count[DPAA2_DEVTYPE_MAX ]; +/**< Count of all devices scanned */ +}; + +extern struct rte_fslmc_bus rte_fslmc_bus; + +#endif /* __PRIVATE_H__ */
drivers/bus/fslmc/rte_fslmc.h +0 -20
@@ -29,7 +29,6 @@ extern "C" {#include <rte_debug.h> #include <rte_interrupts.h> #include <rte_dev.h> -#include <rte_bus.h> #include <rte_tailq.h> #include <rte_devargs.h> #include <rte_mbuf.h>
@@ -69,15 +68,9 @@ dpaa2_seqn(struct rte_mbuf *mbuf)struct rte_dpaa2_driver ; -/* DPAA2 Device and Driver lists for FSLMC bus */ -TAILQ_HEAD (rte_fslmc_device_list, rte_dpaa2_device); -TAILQ_HEAD (rte_fslmc_driver_list, rte_dpaa2_driver); -#define RTE_DEV_TO_FSLMC_CONST (ptr) \ container_of(ptr, const struct rte_dpaa2_device, device) -extern struct rte_fslmc_bus rte_fslmc_bus; -enum rte_dpaa2_dev_type {/* Devices backed by DPDK driver */ DPAA2_ETH ,/**< DPNI type device*/
@@ -152,19 +145,6 @@ struct rte_dpaa2_driver {rte_dpaa2_remove_t remove; }; -/* -* FSLMC bus -*/ -struct rte_fslmc_bus { -struct rte_bus bus;/**< Generic Bus object */ -struct rte_fslmc_device_list device_list; -/**< FSLMC DPAA2 Device list */ -struct rte_fslmc_driver_list driver_list; -/**< FSLMC DPAA2 Driver list */ -int device_count[DPAA2_DEVTYPE_MAX ]; -/**< Count of all devices scanned */ -}; -/** * Register a DPAA2 driver. *
drivers/bus/ifpga/ifpga_bus.c +2 -2
@@ -37,9 +37,9 @@*/ static struct rte_bus rte_ifpga_bus; -static struct ifpga_afu_dev_list ifpga_afu_dev_list = +static TAILQ_HEAD(, rte_afu_device) ifpga_afu_dev_list =TAILQ_HEAD_INITIALIZER (ifpga_afu_dev_list); -static struct ifpga_afu_drv_list ifpga_afu_drv_list = +static TAILQ_HEAD(, rte_afu_driver) ifpga_afu_drv_list =TAILQ_HEAD_INITIALIZER (ifpga_afu_drv_list);
drivers/bus/ifpga/rte_bus_ifpga.h +0 -6
@@ -19,18 +19,12 @@ extern "C" {#include <rte_interrupts.h> #include <rte_spinlock.h> -/** Name of Intel FPGA Bus */ #define IFPGA_BUS_NAME ifpga/* Forward declarations */ struct rte_afu_device ;struct rte_afu_driver ; -/** Double linked list of Intel FPGA AFU device. */ -RTE_TAILQ_HEAD (ifpga_afu_dev_list, rte_afu_device); -/** Double linked list of Intel FPGA AFU device drivers. */ -RTE_TAILQ_HEAD (ifpga_afu_drv_list, rte_afu_driver); -#define IFPGA_BUS_BITSTREAM_PATH_MAX_LEN 256struct rte_afu_uuid {
drivers/bus/pci/bsd/pci.c +0 -2
@@ -48,8 +48,6 @@* PCI probing under BSD. */ -extern struct rte_pci_bus rte_pci_bus; -/* Map pci device */ int rte_pci_map_device (struct rte_pci_device *dev)
drivers/bus/pci/linux/pci.c +0 -3
@@ -6,7 +6,6 @@#include <dirent.h> #include <rte_log.h> -#include <rte_bus.h> #include <rte_pci.h> #include <rte_bus_pci.h> #include <rte_malloc.h>
@@ -24,8 +23,6 @@* PCI probing using Linux sysfs. */ -extern struct rte_pci_bus rte_pci_bus; -static int pci_get_kernel_driver_by_path (const char *filename,char *dri_name,size_t len)
drivers/bus/pci/private.h +17 -1
@@ -8,12 +8,28 @@#include <stdbool.h> #include <stdio.h> -#include <rte_bus_pci.h> +#include <rte_bus.h> #include <rte_os_shim.h> #include <rte_pci.h> +/** +* Structure describing the PCI bus +*/ +struct rte_pci_bus { +struct rte_bus bus;/**< Inherit the generic class */ + RTE_TAILQ_HEAD(, rte_pci_device) device_list; /**< List of PCI devices */ + RTE_TAILQ_HEAD(, rte_pci_driver) driver_list; /**< List of PCI drivers */ +}; +extern struct rte_pci_bus rte_pci_bus; +/* PCI Bus iterators */ +#define FOREACH_DEVICE_ON_PCIBUS (p) \ + RTE_TAILQ_FOREACH(p, &(rte_pci_bus.device_list), next) + +#define FOREACH_DRIVER_ON_PCIBUS (p) \ + RTE_TAILQ_FOREACH(p, &(rte_pci_bus.driver_list), next) +struct rte_pci_driver ;struct rte_pci_device ;
drivers/bus/pci/rte_bus_pci.h +0 -22
@@ -25,7 +25,6 @@ extern "C" {#include <rte_debug.h> #include <rte_interrupts.h> #include <rte_dev.h> -#include <rte_bus.h> #include <rte_pci.h> /** Pathname of PCI devices directory. */
@@ -35,18 +34,6 @@ const char *rte_pci_get_sysfs_path(void);struct rte_pci_device ;struct rte_pci_driver ; -/** List of PCI devices */ -RTE_TAILQ_HEAD (rte_pci_device_list, rte_pci_device); -/** List of PCI drivers */ -RTE_TAILQ_HEAD (rte_pci_driver_list, rte_pci_driver); - -/* PCI Bus iterators */ -#define FOREACH_DEVICE_ON_PCIBUS (p) \ - RTE_TAILQ_FOREACH(p, &(rte_pci_bus.device_list), next) - -#define FOREACH_DRIVER_ON_PCIBUS (p) \ - RTE_TAILQ_FOREACH(p, &(rte_pci_bus.driver_list), next) -struct rte_devargs ;enum rte_pci_kernel_driver {
@@ -169,15 +156,6 @@ struct rte_pci_driver {uint32_t drv_flags;/**< Flags RTE_PCI_DRV_*. */ }; -/** -* Structure describing the PCI bus -*/ -struct rte_pci_bus { -struct rte_bus bus;/**< Inherit the generic class */ -struct rte_pci_device_list device_list;/**< List of PCI devices */ -struct rte_pci_driver_list driver_list;/**< List of PCI drivers */ -}; -/** Device needs PCI BAR mapping (done with either IGB_UIO or VFIO) */ #define RTE_PCI_DRV_NEED_MAPPING 0x0001/** Device needs PCI BAR mapping with enabled write combining (wc) */
drivers/bus/pci/windows/pci.c +1 -0
@@ -9,6 +9,7 @@#include <rte_log.h> #include <rte_eal.h> #include <rte_memory.h> +#include <rte_bus_pci.h> #include "private.h" #include "pci_netuio.h"
drivers/bus/pci/windows/pci_netuio.c +1 -0
@@ -8,6 +8,7 @@#include <rte_errno.h> #include <rte_log.h> #include <rte_eal.h> +#include <rte_bus_pci.h> #ifdef __MINGW32__#include <ddk/ndisguid.h>
drivers/bus/vdev/rte_bus_vdev.h +0 -3
@@ -51,9 +51,6 @@ rte_vdev_device_args(const struct rte_vdev_device *dev)return "" ; } -/** Double linked list of virtual device drivers. */ -RTE_TAILQ_HEAD (vdev_driver_list, rte_vdev_driver); -/** * Probe function called for each virtual device driver once. */
drivers/bus/vdev/vdev.c +2 -4
@@ -30,16 +30,14 @@/* Forward declare to access virtual bus name */ static struct rte_bus rte_vdev_bus; -/** Double linked list of virtual device drivers. */ -TAILQ_HEAD (vdev_device_list, rte_vdev_device); -static struct vdev_device_list vdev_device_list = +static TAILQ_HEAD(, rte_vdev_device) vdev_device_list =TAILQ_HEAD_INITIALIZER (vdev_device_list);/* The lock needs to be recursive because a vdev can manage another vdev. */ static rte_spinlock_recursive_t vdev_device_list_lock =RTE_SPINLOCK_RECURSIVE_INITIALIZER ; -static struct vdev_driver_list vdev_driver_list = +static TAILQ_HEAD(, rte_vdev_driver) vdev_driver_list =TAILQ_HEAD_INITIALIZER (vdev_driver_list);struct vdev_custom_scan {
drivers/bus/vmbus/private.h +18 -0
@@ -8,13 +8,31 @@#include <stdbool.h> #include <sys/uio.h> + +#include <rte_bus.h> #include <rte_log.h> #include <rte_eal_paging.h> #include <rte_vmbus_reg.h> #include <rte_bus_vmbus.h> +/** +* Structure describing the VM bus +*/ +struct rte_vmbus_bus { +struct rte_bus bus;/**< Inherit the generic class */ + RTE_TAILQ_HEAD(, rte_vmbus_device) device_list; /**< List of devices */ + RTE_TAILQ_HEAD(, rte_vmbus_driver) driver_list; /**< List of drivers */ +}; +extern struct rte_vmbus_bus rte_vmbus_bus; +/* VMBus iterators */ +#define FOREACH_DEVICE_ON_VMBUS (p) \ + RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.device_list), next) + +#define FOREACH_DRIVER_ON_VMBUS (p) \ + RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.driver_list), next) +extern int vmbus_logtype_bus; #define VMBUS_LOG(level, fmt, args...) \ rte_log(RTE_LOG_ ## level, vmbus_logtype_bus, "%s(): " fmt "\n", \
drivers/bus/vmbus/rte_bus_vmbus.h +0 -20
@@ -23,7 +23,6 @@ extern "C" {#include <stdint.h> #include <inttypes.h> -#include <rte_bus.h> #include <rte_compat.h> #include <rte_uuid.h> #include <rte_debug.h>
@@ -37,16 +36,6 @@ struct rte_vmbus_driver;struct vmbus_channel ;struct vmbus_mon_page ; -RTE_TAILQ_HEAD (rte_vmbus_device_list, rte_vmbus_device); -RTE_TAILQ_HEAD (rte_vmbus_driver_list, rte_vmbus_driver); - -/* VMBus iterators */ -#define FOREACH_DEVICE_ON_VMBUS (p) \ - RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.device_list), next) - -#define FOREACH_DRIVER_ON_VMBUS (p) \ - RTE_TAILQ_FOREACH(p, &(rte_vmbus_bus.driver_list), next) -/** Maximum number of VMBUS resources. */ enum hv_uio_map {HV_TXRX_RING_MAP =0 ,
@@ -101,15 +90,6 @@ struct rte_vmbus_driver { }; -/** -* Structure describing the VM bus -*/ -struct rte_vmbus_bus { -struct rte_bus bus;/**< Inherit the generic class */ -struct rte_vmbus_device_list device_list;/**< List of devices */ -struct rte_vmbus_driver_list driver_list;/**< List of drivers */ -}; -/** * Scan the content of the VMBUS bus, and the devices in the devices * list
drivers/bus/vmbus/vmbus_common.c +0 -1
@@ -11,7 +11,6 @@#include <sys/mman.h> #include <rte_log.h> -#include <rte_bus.h> #include <rte_eal.h> #include <rte_tailq.h> #include <rte_devargs.h>
drivers/common/mlx5/mlx5_common_pci.c +1 -0
@@ -9,6 +9,7 @@#include <rte_errno.h> #include <rte_class.h> #include <rte_pci.h> +#include <rte_bus.h> #include <rte_bus_pci.h> #include "mlx5_common_log.h"
drivers/net/bonding/rte_eth_bond_args.c +1 -0
@@ -4,6 +4,7 @@#include <rte_devargs.h> #include <rte_pci.h> +#include <rte_bus.h> #include <rte_bus_pci.h> #include <rte_kvargs.h>
drivers/net/mlx5/linux/mlx5_os.c +1 -0
@@ -19,6 +19,7 @@#include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_pci.h> +#include <rte_bus.h> #include <rte_bus_pci.h> #include <rte_bus_auxiliary.h> #include <rte_common.h>
drivers/net/netvsc/hn_ethdev.c +1 -0
@@ -31,6 +31,7 @@#include <rte_memory.h> #include <rte_eal.h> #include <rte_dev.h> +#include <rte_bus.h> #include <rte_bus_vmbus.h> #include <rte_alarm.h>
Signature · 1 line
2.36.1
RFC v2 12/29 bus: introduce accessors
In reply to David MarchandAdd helpers to get a rte_bus object details. This will be used externally.
Internal users may still dereference a rte_bus object.
---
Changes since RFC v1:
- changed approach: only external users are updated,
--- app/test-pmd/config.c | 6 ++--- app/test-pmd/testpmd.c | 4 +-- app/test-pmd/testpmd.h | 4 +-- app/test/test_devargs.c | 4 +-- examples/multi_process/hotplug_mp/commands.c | 4 +-- lib/eal/common/eal_common_bus.c | 26 ++++++++++++-------- lib/eal/include/rte_bus.h | 12 +++++++++ lib/eal/version.map | 3 +++ 8 files changed, 42 insertions(+), 21 deletions(-)
app/test-pmd/config.c +3 -3
@@ -642,7 +642,7 @@ device_infos_display(const char *identifier)if (identifier && da.bus != next)continue ; -snprintf (devstr,sizeof (devstr),"bus=%s" , next->name); +snprintf (devstr,sizeof (devstr),"bus=%s" ,rte_bus_name (next)); RTE_DEV_FOREACH(dev, devstr, &dev_iter) {if (!dev->driver)
@@ -653,7 +653,7 @@ device_infos_display(const char *identifier)continue ;printf ("\n%s Infos for device %s %s\n" , info_border, dev->name, info_border); -printf ("Bus name: %s" , dev->bus->name); +printf ("Bus name: %s" ,rte_bus_name (dev->bus));printf ("\nDriver name: %s" , dev->driver->name);printf ("\nDevargs: %s" , dev->devargs ? dev->devargs->args :"" );
@@ -1154,7 +1154,7 @@ port_reg_off_is_invalid(portid_t port_id, uint32_t reg_off) } bus =rte_bus_find_by_device (ports[port_id].dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { +if (bus && !strcmp (rte_bus_name (bus),"pci" )) { pci_dev =RTE_DEV_TO_PCI (ports[port_id].dev_info.device); }else {fprintf (stderr,"Not a PCI device\n" );
app/test-pmd/testpmd.c +2 -2
@@ -3507,9 +3507,9 @@ detach_devargs(char *identifier) } } -if (rte_eal_hotplug_remove (da.bus->name, da.name) !=0 ) { +if (rte_eal_hotplug_remove (rte_bus_name (da.bus), da.name) !=0 ) {TESTPMD_LOG (ERR ,"Failed to detach device %s(%s)\n" , - da.name, da.bus->name); + da.name,rte_bus_name (da.bus));rte_devargs_reset (&da);return ; }
app/test-pmd/testpmd.h +2 -2
@@ -819,7 +819,7 @@ port_pci_reg_read(struct rte_port *port, uint32_t reg_off) } bus =rte_bus_find_by_device (port->dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { +if (bus && !strcmp (rte_bus_name (bus),"pci" )) { pci_dev =RTE_DEV_TO_PCI (port->dev_info.device); }else {fprintf (stderr,"Not a PCI device\n" );
@@ -847,7 +847,7 @@ port_pci_reg_write(struct rte_port *port, uint32_t reg_off, uint32_t reg_v) } bus =rte_bus_find_by_device (port->dev_info.device); -if (bus && !strcmp (bus->name,"pci" )) { +if (bus && !strcmp (rte_bus_name (bus),"pci" )) { pci_dev =RTE_DEV_TO_PCI (port->dev_info.device); }else {fprintf (stderr,"Not a PCI device\n" );
app/test/test_devargs.c +2 -2
@@ -98,9 +98,9 @@ test_valid_devargs_cases(const struct devargs_case *list, size_t n) list[i].bus_kv) != 0) goto fail;if (list[i].bus !=NULL && -strcmp (da.bus->name, list[i].bus) !=0 ) { +strcmp (rte_bus_name (da.bus), list[i].bus) !=0 ) {printf ("rte_devargs_parse(%s) bus name (%s) not expected (%s)\n" , - list[i].devargs, da.bus->name, list[i].bus); + list[i].devargs,rte_bus_name (da.bus), list[i].bus); goto fail; } if ((list[i].class_kv > 0 || list[i].class != NULL) &&
examples/multi_process/hotplug_mp/commands.c +2 -2
@@ -126,7 +126,7 @@ static void cmd_dev_attach_parsed(void *parsed_result,return ; } -if (!rte_eal_hotplug_add (da.bus->name, da.name, da.args)) +if (!rte_eal_hotplug_add (rte_bus_name (da.bus), da.name, da.args))cmdline_printf (cl,"attached device %s\n" , da.name);else cmdline_printf(cl, "failed to attached device %s\n",
@@ -173,7 +173,7 @@ static void cmd_dev_detach_parsed(void *parsed_result, }printf ("detaching...\n" ); -if (!rte_eal_hotplug_remove (da.bus->name, da.name)) +if (!rte_eal_hotplug_remove (rte_bus_name (da.bus), da.name))cmdline_printf (cl,"detached device %s\n" , da.name);else
lib/eal/common/eal_common_bus.c +16 -10
@@ -16,11 +16,17 @@static struct rte_bus_list rte_bus_list =TAILQ_HEAD_INITIALIZER (rte_bus_list); +const char * +rte_bus_name (const struct rte_bus *bus) +{ +return bus->name; +} +void rte_bus_register (struct rte_bus *bus) {RTE_VERIFY (bus); -RTE_VERIFY (bus->name &&strlen (bus->name)); +RTE_VERIFY (rte_bus_name (bus) &&strlen (rte_bus_name (bus)));/* A bus should mandatorily have the scan implemented */ RTE_VERIFY (bus->scan);RTE_VERIFY (bus->probe);
@@ -29,14 +35,14 @@ rte_bus_register(struct rte_bus *bus)RTE_VERIFY (!bus->plug || bus->unplug);TAILQ_INSERT_TAIL (&rte_bus_list, bus, next); -RTE_LOG (DEBUG ,EAL ,"Registered [%s] bus.\n" , bus->name); +RTE_LOG (DEBUG ,EAL ,"Registered [%s] bus.\n" ,rte_bus_name (bus)); }void rte_bus_unregister (struct rte_bus *bus) {TAILQ_REMOVE (&rte_bus_list, bus, next); -RTE_LOG (DEBUG ,EAL ,"Unregistered [%s] bus.\n" , bus->name); +RTE_LOG (DEBUG ,EAL ,"Unregistered [%s] bus.\n" ,rte_bus_name (bus)); }/* Scan all the buses for registered devices */
@@ -50,7 +56,7 @@ rte_bus_scan(void) ret = bus->scan ();if (ret)RTE_LOG (ERR ,EAL ,"Scan for (%s) bus failed.\n" , - bus->name); +rte_bus_name (bus)); }return 0 ;
@@ -64,7 +70,7 @@ rte_bus_probe(void)struct rte_bus *bus, *vbus =NULL ; TAILQ_FOREACH(bus, &rte_bus_list, next) { -if (!strcmp (bus->name,"vdev" )) { +if (!strcmp (rte_bus_name (bus),"vdev" )) { vbus = bus;continue ; }
@@ -72,14 +78,14 @@ rte_bus_probe(void) ret = bus->probe ();if (ret)RTE_LOG (ERR ,EAL ,"Bus (%s) probe failed.\n" , - bus->name); +rte_bus_name (bus)); }if (vbus) { ret = vbus->probe ();if (ret)RTE_LOG (ERR ,EAL ,"Bus (%s) probe failed.\n" , - vbus->name); +rte_bus_name (vbus)); }return 0 ;
@@ -92,7 +98,7 @@ bus_dump_one(FILE *f, struct rte_bus *bus)int ret;/* For now, dump only the bus name */ - ret =fprintf (f," %s\n" , bus->name); + ret =fprintf (f," %s\n" ,rte_bus_name (bus));/* Error in case of inability in writing to stream */ if (ret <0 )
@@ -163,7 +169,7 @@ cmp_bus_name(const struct rte_bus *bus, const void *_name) {const char *name = _name; -return strcmp (bus->name, name); +return strcmp (rte_bus_name (bus), name); } struct rte_bus *
@@ -213,7 +219,7 @@ rte_bus_get_iommu_class(void) bus_iova_mode = bus->get_iommu_class ();RTE_LOG (DEBUG ,EAL ,"Bus %s wants IOVA as '%s'\n" , - bus->name, +rte_bus_name (bus), bus_iova_mode ==RTE_IOVA_DC ?"DC" : (bus_iova_mode ==RTE_IOVA_PA ?"PA" :"VA" ));if (bus_iova_mode ==RTE_IOVA_PA )
lib/eal/include/rte_bus.h +12 -0
@@ -266,6 +266,18 @@ struct rte_bus { }; +/** +* @warning +* @b EXPERIMENTAL: this API may change without prior notice +* +* @param bus +* A pointer to a rte_bus structure. +* @return +* A pointer to the bus name string. +*/ +__rte_experimental +const char *rte_bus_name(const struct rte_bus *bus); +/** * Register a Bus handler. *
lib/eal/version.map +3 -0
@@ -424,6 +424,9 @@ EXPERIMENTAL { rte_thread_self; rte_thread_set_affinity_by_id; rte_thread_set_priority; + + # added in 22.11 + rte_bus_name; }; INTERNAL {
Signature · 1 line
2.36.1
RFC v2 13/29 bus: hide bus object
In reply to David MarchandMake rte_bus opaque for non internal users.
This will make extending this object possible without breaking the ABI.
Introduce a new driver header and move rte_bus definition and helpers. Update drivers and library to use the internal header.
---
Changes since RFC v1:
- update all existing users of the public header to use the internal one,
--- app/test/test_devargs.c | 2 +- app/test/test_vdev.c | 2 +- drivers/bus/auxiliary/auxiliary_common.c | 2 +- drivers/bus/auxiliary/auxiliary_params.c | 2 +- drivers/bus/auxiliary/private.h | 2 +- drivers/bus/dpaa/dpaa_bus.c | 4 +- drivers/bus/fslmc/fslmc_bus.c | 2 +- drivers/bus/fslmc/private.h | 2 +- drivers/bus/ifpga/ifpga_bus.c | 2 +- drivers/bus/pci/linux/pci_vfio.c | 2 +- drivers/bus/pci/pci_common.c | 2 +- drivers/bus/pci/pci_params.c | 2 +- drivers/bus/pci/private.h | 2 +- drivers/bus/vdev/vdev.c | 2 +- drivers/bus/vmbus/private.h | 2 +- drivers/common/mlx5/mlx5_common_pci.c | 2 +- drivers/dma/idxd/idxd_bus.c | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/failsafe/failsafe.c | 2 +- drivers/net/failsafe/failsafe_eal.c | 2 +- drivers/net/mlx5/linux/mlx5_os.c | 2 +- drivers/net/netvsc/hn_ethdev.c | 2 +- drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +- drivers/net/virtio/virtio_pci.c | 2 +- drivers/raw/ioat/idxd_bus.c | 2 +- lib/eal/common/eal_common_bus.c | 2 +- lib/eal/common/eal_common_dev.c | 2 +- lib/eal/common/eal_common_devargs.c | 2 +- lib/eal/common/hotplug_mp.c | 2 +- lib/eal/include/bus_driver.h | 296 +++++++++++++++++++++++ lib/eal/include/meson.build | 4 + lib/eal/include/rte_bus.h | 275 +-------------------- lib/eal/linux/eal_dev.c | 2 +- lib/eal/version.map | 4 +- lib/ethdev/rte_ethdev.c | 2 +- lib/pcapng/rte_pcapng.c | 2 +- 36 files changed, 338 insertions(+), 307 deletions(-) create mode 100644 lib/eal/include/bus_driver.h
app/test/test_devargs.c +1 -1
@@ -6,10 +6,10 @@#include <stdio.h> #include <string.h> +#include <bus_driver.h> #include <rte_common.h> #include <rte_devargs.h> #include <rte_kvargs.h> -#include <rte_bus.h> #include <rte_class.h> #include "test.h"
app/test/test_vdev.c +1 -1
@@ -6,9 +6,9 @@#include <stdio.h> #include <string.h> +#include <bus_driver.h> #include <rte_common.h> #include <rte_kvargs.h> -#include <rte_bus.h> #include <rte_bus_vdev.h> #include "test.h"
drivers/bus/auxiliary/auxiliary_common.c +1 -1
@@ -12,7 +12,7 @@#include <rte_errno.h> #include <rte_interrupts.h> #include <rte_log.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_per_lcore.h> #include <rte_memory.h> #include <rte_eal.h>
drivers/bus/auxiliary/auxiliary_params.c +1 -1
@@ -4,7 +4,7 @@#include <string.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_dev.h> #include <rte_errno.h> #include <rte_kvargs.h>
drivers/bus/auxiliary/private.h +1 -1
@@ -9,7 +9,7 @@#include <stdio.h> #include <sys/queue.h> -#include <rte_bus.h> +#include <bus_driver.h> #include "rte_bus_auxiliary.h"
drivers/bus/dpaa/dpaa_bus.c +2 -2
@@ -14,6 +14,8 @@#include <sys/types.h> #include <sys/eventfd.h> +#include <bus_driver.h> +#include <ethdev_driver.h> #include <rte_byteorder.h> #include <rte_common.h> #include <rte_interrupts.h>
@@ -26,10 +28,8 @@#include <rte_eal.h> #include <rte_alarm.h> #include <rte_ether.h> -#include <ethdev_driver.h> #include <rte_malloc.h> #include <rte_ring.h> -#include <rte_bus.h> #include <rte_mbuf_pool_ops.h> #include <rte_mbuf_dyn.h>
drivers/bus/fslmc/fslmc_bus.c +1 -1
@@ -9,7 +9,7 @@#include <stdbool.h> #include <rte_log.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_malloc.h> #include <rte_devargs.h> #include <rte_memcpy.h>
drivers/bus/fslmc/private.h +1 -1
@@ -5,7 +5,7 @@#ifndef __PRIVATE_H__#define __PRIVATE_H__ -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_fslmc.h>
drivers/bus/ifpga/ifpga_bus.c +1 -1
@@ -13,8 +13,8 @@#include <unistd.h> #include <fcntl.h> +#include <bus_driver.h> #include <rte_errno.h> -#include <rte_bus.h> #include <rte_per_lcore.h> #include <rte_memory.h> #include <rte_memzone.h>
drivers/bus/pci/linux/pci_vfio.c +1 -1
@@ -18,7 +18,7 @@#include <rte_malloc.h> #include <rte_vfio.h> #include <rte_eal.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_spinlock.h> #include <rte_tailq.h>
drivers/bus/pci/pci_common.c +1 -1
@@ -13,7 +13,7 @@#include <rte_errno.h> #include <rte_interrupts.h> #include <rte_log.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_pci.h> #include <rte_bus_pci.h> #include <rte_lcore.h>
drivers/bus/pci/pci_params.c +1 -1
@@ -4,7 +4,7 @@#include <sys/queue.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_bus_pci.h> #include <rte_dev.h> #include <rte_errno.h>
drivers/bus/pci/private.h +1 -1
@@ -8,7 +8,7 @@#include <stdbool.h> #include <stdio.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_os_shim.h> #include <rte_pci.h>
drivers/bus/vdev/vdev.c +1 -1
@@ -10,9 +10,9 @@#include <stdbool.h> #include <sys/queue.h> +#include <bus_driver.h> #include <rte_eal.h> #include <rte_dev.h> -#include <rte_bus.h> #include <rte_common.h> #include <rte_devargs.h> #include <rte_memory.h>
drivers/bus/vmbus/private.h +1 -1
@@ -9,7 +9,7 @@#include <stdbool.h> #include <sys/uio.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_log.h> #include <rte_eal_paging.h> #include <rte_vmbus_reg.h>
drivers/common/mlx5/mlx5_common_pci.c +1 -1
@@ -9,7 +9,7 @@#include <rte_errno.h> #include <rte_class.h> #include <rte_pci.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_bus_pci.h> #include "mlx5_common_log.h"
drivers/dma/idxd/idxd_bus.c +1 -1
@@ -8,7 +8,7 @@#include <sys/mman.h> #include <libgen.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_devargs.h> #include <rte_eal.h> #include <rte_log.h>
drivers/net/bonding/rte_eth_bond_args.c +1 -1
@@ -2,9 +2,9 @@* Copyright(c) 2010-2014 Intel Corporation */ +#include <bus_driver.h> #include <rte_devargs.h> #include <rte_pci.h> -#include <rte_bus.h> #include <rte_bus_pci.h> #include <rte_kvargs.h>
drivers/net/failsafe/failsafe.c +1 -1
@@ -11,7 +11,7 @@#include <ethdev_vdev.h> #include <rte_devargs.h> #include <rte_kvargs.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_bus_vdev.h> #include "failsafe_private.h"
drivers/net/failsafe/failsafe_eal.c +1 -1
@@ -3,7 +3,7 @@* Copyright 2017 Mellanox Technologies, Ltd */ -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_string_fns.h> #include <rte_malloc.h>
drivers/net/mlx5/linux/mlx5_os.c +1 -1
@@ -19,7 +19,7 @@#include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_pci.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_bus_pci.h> #include <rte_bus_auxiliary.h> #include <rte_common.h>
drivers/net/netvsc/hn_ethdev.c +1 -1
@@ -31,7 +31,7 @@#include <rte_memory.h> #include <rte_eal.h> #include <rte_dev.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_bus_vmbus.h> #include <rte_alarm.h>
drivers/net/vdev_netvsc/vdev_netvsc.c +1 -1
@@ -23,8 +23,8 @@#include <sys/socket.h> #include <unistd.h> +#include <bus_driver.h> #include <rte_alarm.h> -#include <rte_bus.h> #include <rte_bus_vdev.h> #include <rte_common.h> #include <rte_dev.h>
drivers/net/virtio/virtio_pci.c +1 -1
@@ -9,7 +9,7 @@#endif #include <rte_io.h> -#include <rte_bus.h> +#include <bus_driver.h> #include "virtio_pci.h" #include "virtio_logs.h"
drivers/raw/ioat/idxd_bus.c +1 -1
@@ -10,7 +10,7 @@#include <fcntl.h> #include <sys/mman.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_log.h> #include <rte_string_fns.h> #include "ioat_private.h"
lib/eal/common/eal_common_bus.c +1 -1
@@ -6,7 +6,7 @@#include <string.h> #include <sys/queue.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_debug.h> #include <rte_string_fns.h> #include <rte_errno.h>
lib/eal/common/eal_common_dev.c +1 -1
@@ -7,7 +7,7 @@#include <string.h> #include <sys/queue.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_class.h> #include <rte_dev.h> #include <rte_devargs.h>
lib/eal/common/eal_common_devargs.c +1 -1
@@ -10,7 +10,7 @@#include <string.h> #include <stdarg.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_class.h> #include <rte_dev.h> #include <rte_devargs.h>
lib/eal/common/hotplug_mp.c +1 -1
@@ -3,7 +3,7 @@*/ #include <string.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_eal.h> #include <rte_errno.h> #include <rte_alarm.h>
lib/eal/include/bus_driver.h new file +296 -0
296 lines not on this page · raw message
lib/eal/include/meson.build +4 -0
@@ -55,6 +55,10 @@ headers += files( 'rte_vfio.h', ) +driver_sdk_headers = files( + 'bus_driver.h', +) + # special case install the generic headers, since they go in a subdir generic_headers = files( 'generic/rte_atomic.h',
lib/eal/include/rte_bus.h +3 -272
295 lines not on this page · raw message
lib/eal/linux/eal_dev.c +1 -1
@@ -8,12 +8,12 @@#include <sys/socket.h> #include <linux/netlink.h> +#include <bus_driver.h> #include <rte_string_fns.h> #include <rte_log.h> #include <rte_dev.h> #include <rte_interrupts.h> #include <rte_alarm.h> -#include <rte_bus.h> #include <rte_spinlock.h> #include <rte_errno.h>
lib/eal/version.map +2 -2
@@ -13,9 +13,7 @@ DPDK_22 { rte_bus_find_by_name; rte_bus_get_iommu_class; rte_bus_probe; - rte_bus_register; rte_bus_scan; - rte_bus_unregister; rte_calloc; rte_calloc_socket; rte_cpu_get_flag_enabled;
@@ -432,6 +430,8 @@ EXPERIMENTAL { INTERNAL { global: + rte_bus_register; + rte_bus_unregister; rte_eal_get_baseaddr; rte_firmware_read; rte_intr_allow_others;
lib/ethdev/rte_ethdev.c +1 -1
@@ -11,7 +11,7 @@#include <string.h> #include <sys/queue.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_log.h> #include <rte_interrupts.h> #include <rte_memcpy.h>
lib/pcapng/rte_pcapng.c +1 -1
@@ -11,7 +11,7 @@#include <time.h> #include <unistd.h> -#include <rte_bus.h> +#include <bus_driver.h> #include <rte_common.h> #include <rte_cycles.h> #include <rte_dev.h>
Signature · 1 line
2.36.1
RFC v2 14/29 bbdev: mark driver header
In reply to David Marchandrte_bbdev_pmd.h is a driver only header.
--- lib/bbdev/meson.build | 5 ++--- 1 file changed, 2 insertions(+), 3 deletions(-)
lib/bbdev/meson.build +2 -3
@@ -8,7 +8,6 @@ if is_windows endif sources = files('rte_bbdev.c') -headers = files('rte_bbdev.h', - 'rte_bbdev_pmd.h', - 'rte_bbdev_op.h') +headers = files('rte_bbdev.h', 'rte_bbdev_op.h') +driver_sdk_headers = files('rte_bbdev_pmd.h') deps += ['mbuf']
Signature · 1 line
2.36.1
RFC v2 15/29 ethdev: mark some headers as driver only
In reply to David MarchandThose headers are for drivers as they include ethdev_driver.h, a driver-only header.
--- lib/ethdev/meson.build | 6 +++--- 1 file changed, 3 insertions(+), 3 deletions(-)
lib/ethdev/meson.build +3 -3
@@ -24,11 +24,8 @@ headers = files( 'rte_ethdev_trace_fp.h', 'rte_dev_info.h', 'rte_flow.h', - 'rte_flow_driver.h', 'rte_mtr.h', - 'rte_mtr_driver.h', 'rte_tm.h', - 'rte_tm_driver.h', ) indirect_headers += files(
@@ -40,6 +37,9 @@ driver_sdk_headers += files( 'ethdev_driver.h', 'ethdev_pci.h', 'ethdev_vdev.h', + 'rte_flow_driver.h', + 'rte_mtr_driver.h', + 'rte_tm_driver.h', ) deps += ['net', 'kvargs', 'meter', 'telemetry']
Signature · 1 line
2.36.1
RFC v2 16/29 rawdev: mark driver header
In reply to David Marchandrte_rawdev_pmd.h is a driver only header.
--- lib/rawdev/meson.build | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-)
lib/rawdev/meson.build +2 -1
@@ -8,6 +8,7 @@ if is_windows endif sources = files('rte_rawdev.c') -headers = files('rte_rawdev.h', 'rte_rawdev_pmd.h') +headers = files('rte_rawdev.h') +driver_sdk_headers = files('rte_rawdev_pmd.h') deps += ['telemetry']
Signature · 1 line
2.36.1
RFC v2 17/29 drivers: export drivers headers
In reply to David MarchandSame as for device classes, external DPDK users may need to include some bus headers for their out of tree drivers.
--- drivers/meson.build | 4 ++++ 1 file changed, 4 insertions(+)
drivers/meson.build +4 -0
@@ -89,6 +89,7 @@ foreach subpath:subdirs name = drv sources = [] headers = [] + driver_sdk_headers = [] # public headers included by drivers objs = [] cflags = default_cflags includes = [include_directories(drv_path)]
@@ -158,6 +159,9 @@ foreach subpath:subdirs dpdk_extra_ldflags += pkgconfig_extra_libs install_headers(headers) + if get_option('enable_driver_sdk') + install_headers(driver_sdk_headers) + endif # generate pmdinfo sources by building a temporary # lib and then running pmdinfogen on the contents of
Signature · 1 line
2.36.1
RFC v2 18/29 bus/auxiliary: make driver-only headers private
In reply to David MarchandThe auxiliary bus interface is for drivers only.
Mark as internal and move the header on the driver headers list.
---
drivers/bus/auxiliary/auxiliary_common.c | 1 -
drivers/bus/auxiliary/auxiliary_params.c | 1 -
...rte_bus_auxiliary.h => bus_auxiliary_driver.h} | 15 ++++++++-------
drivers/bus/auxiliary/linux/auxiliary.c | 1 -
drivers/bus/auxiliary/meson.build | 4 +---
drivers/bus/auxiliary/private.h | 2 +-
drivers/bus/auxiliary/version.map | 3 +--
drivers/common/mlx5/linux/mlx5_common_auxiliary.c | 2 +-
drivers/common/mlx5/linux/mlx5_common_os.c | 2 +-
drivers/common/mlx5/mlx5_common_private.h | 2 +-
drivers/net/mlx5/linux/mlx5_os.c | 2 +-
11 files changed, 15 insertions(+), 20 deletions(-)
rename drivers/bus/auxiliary/{rte_bus_auxiliary.h => bus_auxiliary_driver.h} (94%)drivers/bus/auxiliary/auxiliary_common.c +0 -1
@@ -23,7 +23,6 @@#include <rte_devargs.h> #include "private.h" -#include "rte_bus_auxiliary.h" static struct rte_devargs *auxiliary_devargs_lookup (const char *name)
drivers/bus/auxiliary/auxiliary_params.c +0 -1
@@ -10,7 +10,6 @@#include <rte_kvargs.h> #include "private.h" -#include "rte_bus_auxiliary.h" enum auxiliary_params {RTE_AUXILIARY_PARAM_NAME ,
drivers/bus/auxiliary/bus_auxiliary_driver.h renamed from drivers/bus/auxiliary/rte_bus_auxiliary.h +8 -7
@@ -22,6 +22,7 @@ extern "C" {#include <stdint.h> #include <inttypes.h> +#include <rte_compat.h> #include <rte_debug.h> #include <rte_interrupts.h> #include <rte_dev.h>
@@ -41,7 +42,7 @@ struct rte_auxiliary_device;* @return * Whether the driver can handle the auxiliary device. */ -typedef bool (rte_auxiliary_match_t )(const char *name); +typedef bool (rte_auxiliary_match_t )(const char *name);/** * Initialization function for the driver called during auxiliary probing.
@@ -54,8 +55,8 @@ typedef bool(rte_auxiliary_match_t)(const char *name);* - 0 On success. * - Negative value and rte_errno is set otherwise. */ -typedef int (rte_auxiliary_probe_t )(struct rte_auxiliary_driver *drv, -struct rte_auxiliary_device *dev); +typedef int (rte_auxiliary_probe_t )(struct rte_auxiliary_driver *drv, +struct rte_auxiliary_device *dev);/** * Uninitialization function for the driver called during hotplugging.
@@ -85,7 +86,7 @@ typedef int (rte_auxiliary_remove_t)(struct rte_auxiliary_device *dev);* - Negative value and rte_errno is set otherwise. */ typedef int (rte_auxiliary_dma_map_t )(struct rte_auxiliary_device *dev, -void *addr,uint64_t iova,size_t len); +void *addr,uint64_t iova,size_t len);/** * Driver-specific DMA un-mapping. After a successful call the device
@@ -104,7 +105,7 @@ typedef int (rte_auxiliary_dma_map_t)(struct rte_auxiliary_device *dev,* - Negative value and rte_errno is set otherwise. */ typedef int (rte_auxiliary_dma_unmap_t )(struct rte_auxiliary_device *dev, -void *addr,uint64_t iova,size_t len); +void *addr,uint64_t iova,size_t len);/** * A structure describing an auxiliary device.
@@ -157,7 +158,7 @@ struct rte_auxiliary_driver {* A pointer to a rte_auxiliary_driver structure describing the driver * to be registered. */ -__rte_experimental +__rte_internal void rte_auxiliary_register(struct rte_auxiliary_driver *driver);/** Helper for auxiliary device registration from driver instance */
@@ -179,7 +180,7 @@ void rte_auxiliary_register(struct rte_auxiliary_driver *driver);* A pointer to a rte_auxiliary_driver structure describing the driver * to be unregistered. */ -__rte_experimental +__rte_internal void rte_auxiliary_unregister(struct rte_auxiliary_driver *driver);#ifdef __cplusplus
drivers/bus/auxiliary/linux/auxiliary.c +0 -1
@@ -11,7 +11,6 @@#include <rte_memcpy.h> #include <eal_filesystem.h> -#include "../rte_bus_auxiliary.h" #include "../private.h" #define AUXILIARY_SYSFS_PATH "/sys/bus/auxiliary/devices"
drivers/bus/auxiliary/meson.build +1 -3
@@ -1,9 +1,7 @@ # SPDX-License-Identifier: BSD-3-Clause # Copyright (c) 2021 NVIDIA Corporation & Affiliates -headers = files( - 'rte_bus_auxiliary.h', -) +driver_sdk_headers += files('bus_auxiliary_driver.h') sources = files( 'auxiliary_common.c', 'auxiliary_params.c',
drivers/bus/auxiliary/private.h +1 -1
@@ -11,7 +11,7 @@#include <bus_driver.h> -#include "rte_bus_auxiliary.h" +#include "bus_auxiliary_driver.h" extern int auxiliary_bus_logtype;
drivers/bus/auxiliary/version.map +1 -2
@@ -1,7 +1,6 @@ -EXPERIMENTAL { +INTERNAL { global: - # added in 21.08 rte_auxiliary_register; rte_auxiliary_unregister;
drivers/common/mlx5/linux/mlx5_common_auxiliary.c +1 -1
@@ -8,7 +8,7 @@#include <rte_malloc.h> #include <rte_errno.h> -#include <rte_bus_auxiliary.h> +#include <bus_auxiliary_driver.h> #include <rte_common.h> #include "eal_filesystem.h"
drivers/common/mlx5/linux/mlx5_common_os.c +1 -1
@@ -16,7 +16,7 @@#include <rte_errno.h> #include <rte_string_fns.h> #include <rte_bus_pci.h> -#include <rte_bus_auxiliary.h> +#include <bus_auxiliary_driver.h> #include "mlx5_common.h" #include "mlx5_nl.h"
drivers/common/mlx5/mlx5_common_private.h +1 -1
@@ -6,7 +6,7 @@#define MLX5_COMMON_PRIVATE_H #include <rte_pci.h> -#include <rte_bus_auxiliary.h> +#include <bus_auxiliary_driver.h> #include "mlx5_common.h"
drivers/net/mlx5/linux/mlx5_os.c +1 -1
@@ -21,7 +21,7 @@#include <rte_pci.h> #include <bus_driver.h> #include <rte_bus_pci.h> -#include <rte_bus_auxiliary.h> +#include <bus_auxiliary_driver.h> #include <rte_common.h> #include <rte_kvargs.h> #include <rte_rwlock.h>
Signature · 1 line
2.36.1
RFC v2 19/29 bus/dpaa: make driver-only headers private
In reply to David MarchandThe dpaa bus interface is for drivers only.
Mark as internal and move the header on the driver headers list.
---
drivers/bus/dpaa/base/qbman/qman.c | 2 +-
drivers/bus/dpaa/{rte_dpaa_bus.h => bus_dpaa_driver.h} | 9 ++++++---
drivers/bus/dpaa/dpaa_bus.c | 2 +-
drivers/crypto/dpaa_sec/dpaa_sec.c | 2 +-
drivers/crypto/dpaa_sec/dpaa_sec_raw_dp.c | 2 +-
drivers/dma/dpaa/dpaa_qdma.c | 2 +-
drivers/event/dpaa/dpaa_eventdev.c | 2 +-
drivers/mempool/dpaa/dpaa_mempool.h | 2 +-
drivers/net/dpaa/dpaa_ethdev.c | 2 +-
drivers/net/dpaa/dpaa_rxtx.c | 2 +-
10 files changed, 15 insertions(+), 12 deletions(-)
rename drivers/bus/dpaa/{rte_dpaa_bus.h => bus_dpaa_driver.h} (97%)drivers/bus/dpaa/base/qbman/qman.c +1 -1
@@ -7,7 +7,7 @@#include "qman.h" #include <rte_branch_prediction.h> -#include <rte_dpaa_bus.h> +#include <bus_dpaa_driver.h> #include <rte_eventdev.h> #include <rte_byteorder.h>
drivers/bus/dpaa/bus_dpaa_driver.h renamed from drivers/bus/dpaa/rte_dpaa_bus.h +6 -3
@@ -3,9 +3,10 @@* Copyright 2017-2022 NXP * */ -#ifndef __RTE_DPAA_BUS_H__ -#define __RTE_DPAA_BUS_H__ +#ifndef BUS_DPAA_DRIVER_H +#define BUS_DPAA_DRIVER_H +#include <rte_compat.h> #include <rte_mbuf_dyn.h> #include <rte_mempool.h> #include <dpaax_iova_table.h>
@@ -152,6 +153,7 @@ extern struct dpaa_memseg_list rte_dpaa_memsegs;/* Either iterate over the list of internal memseg references or fallback to * EAL memseg based iova2virt. */ +__rte_internal static inline void *rte_dpaa_mem_ptov(phys_addr_t paddr) {struct dpaa_memseg *ms;
@@ -178,6 +180,7 @@ static inline void *rte_dpaa_mem_ptov(phys_addr_t paddr)return va; } +__rte_internal static inline rte_iova_trte_dpaa_mem_vtop (void *vaddr) {
@@ -249,4 +252,4 @@ struct fm_eth_port_cfg *dpaa_get_eth_port_cfg(int dev_id); }#endif -#endif /* __RTE_DPAA_BUS_H__ */ +#endif /* BUS_DPAA_DRIVER_H */
drivers/bus/dpaa/dpaa_bus.c +1 -1
@@ -34,7 +34,7 @@#include <rte_mbuf_dyn.h> #include <dpaa_of.h> -#include <rte_dpaa_bus.h> +#include <bus_dpaa_driver.h> #include <rte_dpaa_logs.h> #include <dpaax_iova_table.h>
drivers/crypto/dpaa_sec/dpaa_sec.c +1 -1
@@ -41,7 +41,7 @@#include <desc/pdcp.h> #include <desc/sdap.h> -#include <rte_dpaa_bus.h> +#include <bus_dpaa_driver.h> #include <dpaa_sec.h> #include <dpaa_sec_event.h> #include <dpaa_sec_log.h>
drivers/crypto/dpaa_sec/dpaa_sec_raw_dp.c +1 -1
@@ -15,7 +15,7 @@#include <desc/algo.h> #include <desc/ipsec.h> -#include <rte_dpaa_bus.h> +#include <bus_dpaa_driver.h> #include <dpaa_sec.h> #include <dpaa_sec_log.h>
drivers/dma/dpaa/dpaa_qdma.c +1 -1
@@ -2,7 +2,7 @@* Copyright 2021 NXP */ -#include <rte_dpaa_bus.h> +#include <bus_dpaa_driver.h> #include <rte_dmadev_pmd.h> #include "dpaa_qdma.h"
drivers/event/dpaa/dpaa_eventdev.c +1 -1
@@ -29,7 +29,7 @@#include <rte_event_eth_rx_adapter.h> #include <rte_event_eth_tx_adapter.h> #include <cryptodev_pmd.h> -#include <rte_dpaa_bus.h> +#include <bus_dpaa_driver.h> #include <rte_dpaa_logs.h> #include <rte_cycles.h> #include <rte_kvargs.h>
drivers/mempool/dpaa/dpaa_mempool.h +1 -1
@@ -14,7 +14,7 @@#include <rte_mempool.h> -#include <rte_dpaa_bus.h> +#include <bus_dpaa_driver.h> #include <rte_dpaa_logs.h> #include <fsl_usd.h>
drivers/net/dpaa/dpaa_ethdev.c +1 -1
@@ -33,7 +33,7 @@#include <rte_malloc.h> #include <rte_ring.h> -#include <rte_dpaa_bus.h> +#include <bus_dpaa_driver.h> #include <rte_dpaa_logs.h> #include <dpaa_mempool.h>
drivers/net/dpaa/dpaa_rxtx.c +1 -1
@@ -37,7 +37,7 @@#include "dpaa_ethdev.h" #include "dpaa_rxtx.h" -#include <rte_dpaa_bus.h> +#include <bus_dpaa_driver.h> #include <dpaa_mempool.h> #include <qman.h>
Signature · 1 line
2.36.1
RFC v2 20/29 bus/fslmc: make driver-only headers private
In reply to David MarchandThe fslmc bus interface is for drivers only.
Mark as internal and move the header on the driver headers list.
---
drivers/bus/fslmc/{rte_fslmc.h => bus_fslmc_driver.h} | 7 ++++---
drivers/bus/fslmc/fslmc_bus.c | 1 -
drivers/bus/fslmc/fslmc_vfio.c | 1 -
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 | 1 -
drivers/bus/fslmc/private.h | 2 +-
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c | 2 +-
drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c | 2 +-
drivers/dma/dpaa2/dpaa2_qdma.c | 2 +-
drivers/event/dpaa2/dpaa2_eventdev.c | 2 +-
drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 2 +-
drivers/event/dpaa2/dpaa2_hw_dpcon.c | 2 +-
drivers/net/dpaa2/dpaa2_ethdev.c | 2 +-
drivers/net/dpaa2/dpaa2_ethdev.h | 2 +-
drivers/net/dpaa2/dpaa2_mux.c | 2 +-
drivers/net/dpaa2/dpaa2_ptp.c | 2 +-
drivers/net/dpaa2/dpaa2_recycle.c | 2 +-
drivers/net/dpaa2/dpaa2_rxtx.c | 2 +-
20 files changed, 20 insertions(+), 22 deletions(-)
rename drivers/bus/fslmc/{rte_fslmc.h => bus_fslmc_driver.h} (98%)drivers/bus/fslmc/bus_fslmc_driver.h renamed from drivers/bus/fslmc/rte_fslmc.h +4 -3
@@ -4,8 +4,8 @@* */ -#ifndef _RTE_FSLMC_H_ -#define _RTE_FSLMC_H_ +#ifndef BUS_FSLMC_DRIVER_H +#define BUS_FSLMC_DRIVER_H /** * @file
@@ -26,6 +26,7 @@ extern "C" {#include <inttypes.h> #include <linux/vfio.h> +#include <rte_compat.h> #include <rte_debug.h> #include <rte_interrupts.h> #include <rte_dev.h>
@@ -209,4 +210,4 @@ RTE_PMD_EXPORT_NAME(nm, __COUNTER__) }#endif -#endif /* _RTE_FSLMC_H_ */ +#endif /* BUS_FSLMC_DRIVER_H */
drivers/bus/fslmc/fslmc_bus.c +0 -1
@@ -17,7 +17,6 @@#include <rte_mbuf_dyn.h> #include "private.h" -#include <rte_fslmc.h> #include <fslmc_vfio.h> #include "fslmc_logs.h"
drivers/bus/fslmc/fslmc_vfio.c +0 -1
@@ -32,7 +32,6 @@#include <rte_eal_memconfig.h> #include "private.h" -#include "rte_fslmc.h" #include "fslmc_vfio.h" #include "fslmc_logs.h" #include <mc/fsl_dpmng.h>
drivers/bus/fslmc/portal/dpaa2_hw_dpbp.c +1 -1
@@ -23,7 +23,7 @@#include <rte_mbuf_pool_ops.h> #include <fslmc_logs.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include <mc/fsl_dpbp.h> #include "portal/dpaa2_hw_pvt.h" #include "portal/dpaa2_hw_dpio.h"
drivers/bus/fslmc/portal/dpaa2_hw_dpci.c +1 -1
@@ -21,7 +21,7 @@#include <ethdev_driver.h> #include <fslmc_logs.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include <mc/fsl_dpci.h> #include "portal/dpaa2_hw_pvt.h" #include "portal/dpaa2_hw_dpio.h"
drivers/bus/fslmc/portal/dpaa2_hw_dpio.c +1 -1
@@ -33,7 +33,7 @@#include <rte_dev.h> #include <fslmc_logs.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include "dpaa2_hw_pvt.h" #include "dpaa2_hw_dpio.h" #include <mc/fsl_dpmng.h>
drivers/bus/fslmc/portal/dpaa2_hw_dprc.c +0 -1
@@ -14,7 +14,6 @@#include "private.h" #include <fslmc_logs.h> -#include <rte_fslmc.h> #include <mc/fsl_dprc.h> #include "portal/dpaa2_hw_pvt.h"
drivers/bus/fslmc/private.h +1 -1
@@ -7,7 +7,7 @@#include <bus_driver.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> /* * FSLMC bus
drivers/crypto/dpaa2_sec/dpaa2_sec_dpseci.c +1 -1
@@ -20,7 +20,7 @@#include <rte_dev.h> #include <cryptodev_pmd.h> #include <rte_common.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include <fslmc_vfio.h> #include <dpaa2_hw_pvt.h> #include <dpaa2_hw_dpio.h>
drivers/crypto/dpaa2_sec/dpaa2_sec_raw_dp.c +1 -1
@@ -3,7 +3,7 @@*/ #include <cryptodev_pmd.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include <fslmc_vfio.h> #include <dpaa2_hw_pvt.h> #include <dpaa2_hw_dpio.h>
drivers/dma/dpaa2/dpaa2_qdma.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_eal.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include <rte_dmadev.h> #include <rte_dmadev_pmd.h> #include <rte_kvargs.h>
drivers/event/dpaa2/dpaa2_eventdev.c +1 -1
@@ -16,7 +16,7 @@#include <rte_debug.h> #include <rte_dev.h> #include <rte_eal.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include <rte_lcore.h> #include <rte_log.h> #include <rte_malloc.h>
drivers/event/dpaa2/dpaa2_eventdev_selftest.c +1 -1
@@ -19,7 +19,7 @@#include <rte_random.h> #include <rte_bus_vdev.h> #include <rte_test.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include "dpaa2_eventdev.h" #include "dpaa2_eventdev_logs.h"
drivers/event/dpaa2/dpaa2_hw_dpcon.c +1 -1
@@ -20,7 +20,7 @@#include <rte_dev.h> #include <ethdev_driver.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include <mc/fsl_dpcon.h> #include <portal/dpaa2_hw_pvt.h> #include "dpaa2_eventdev.h"
drivers/net/dpaa2/dpaa2_ethdev.c +1 -1
@@ -16,7 +16,7 @@#include <rte_cycles.h> #include <rte_kvargs.h> #include <rte_dev.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include <rte_flow_driver.h> #include "rte_dpaa2_mempool.h"
drivers/net/dpaa2/dpaa2_ethdev.h +1 -1
@@ -11,7 +11,7 @@#include <rte_event_eth_rx_adapter.h> #include <rte_pmd_dpaa2.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include <dpaa2_hw_pvt.h> #include "dpaa2_tm.h"
drivers/net/dpaa2/dpaa2_mux.c +1 -1
@@ -16,7 +16,7 @@#include <rte_flow_driver.h> #include <rte_tailq.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include <fsl_dpdmux.h> #include <fsl_dpkg.h>
drivers/net/dpaa2/dpaa2_ptp.c +1 -1
@@ -16,7 +16,7 @@#include <rte_malloc.h> #include <rte_time.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include <fsl_dprtc.h> #include <fsl_dpkg.h>
drivers/net/dpaa2/dpaa2_recycle.c +1 -1
@@ -15,7 +15,7 @@#include <rte_cycles.h> #include <rte_kvargs.h> #include <rte_dev.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include <rte_flow_driver.h> #include "dpaa2_pmd_logs.h"
drivers/net/dpaa2/dpaa2_rxtx.c +1 -1
@@ -16,7 +16,7 @@#include <rte_dev.h> #include <rte_hexdump.h> -#include <rte_fslmc.h> +#include <bus_fslmc_driver.h> #include <fslmc_vfio.h> #include <dpaa2_hw_pvt.h> #include <dpaa2_hw_dpio.h>
Signature · 1 line
2.36.1
RFC v2 21/29 bus/ifpga: cleanup exported symbols
In reply to David MarchandRemove unused symbols (exposed only in an internal header which guarantees that no application out there relied on them).
Remove rte_ prefix and inline the rest to avoid having to expose them as global symbols for a relatively small added value.
--- drivers/bus/ifpga/ifpga_bus.c | 13 +++-- drivers/bus/ifpga/ifpga_common.c | 87 -------------------------------- drivers/bus/ifpga/ifpga_common.h | 54 ++++++++++++++++---- drivers/bus/ifpga/meson.build | 2 +- drivers/bus/ifpga/version.map | 2 - drivers/raw/ifpga/ifpga_rawdev.c | 2 +- 6 files changed, 53 insertions(+), 107 deletions(-) delete mode 100644 drivers/bus/ifpga/ifpga_common.c
drivers/bus/ifpga/ifpga_bus.c +6 -7
@@ -117,9 +117,9 @@ ifpga_scan_one(struct rte_rawdev *rawdev,if (rte_kvargs_count (kvlist,IFPGA_ARG_PORT ) ==1 ) {if (rte_kvargs_process (kvlist,IFPGA_ARG_PORT , - &rte_ifpga_get_integer32_arg, &afu_pr_conf.afu_id.port) <0 ) { -IFPGA_BUS_ERR ("error to parse %s" , -IFPGA_ARG_PORT ); + ifpga_get_integer32_arg, + &afu_pr_conf.afu_id.port) <0 ) { +IFPGA_BUS_ERR ("error to parse %s" ,IFPGA_ARG_PORT ); goto end; } }else {
@@ -130,9 +130,8 @@ ifpga_scan_one(struct rte_rawdev *rawdev,if (rte_kvargs_count (kvlist,IFPGA_AFU_BTS ) ==1 ) {if (rte_kvargs_process (kvlist,IFPGA_AFU_BTS , - &rte_ifpga_get_string_arg, &path) <0 ) { -IFPGA_BUS_ERR ("Failed to parse %s" , -IFPGA_AFU_BTS ); + ifpga_get_string_arg, &path) <0 ) { +IFPGA_BUS_ERR ("Failed to parse %s" ,IFPGA_AFU_BTS ); goto end; } afu_pr_conf.pr_enable =1 ;
@@ -228,7 +227,7 @@ ifpga_scan(void)if (rte_kvargs_count (kvlist,IFPGA_ARG_NAME ) ==1 ) {if (rte_kvargs_process (kvlist,IFPGA_ARG_NAME , - &rte_ifpga_get_string_arg, &name) <0 ) { + ifpga_get_string_arg, &name) <0 ) {IFPGA_BUS_ERR ("error to parse %s" ,IFPGA_ARG_NAME ); goto end;
drivers/bus/ifpga/ifpga_common.c deleted +0 -87
87 lines not on this page · raw message
drivers/bus/ifpga/ifpga_common.h +45 -9
59 lines not on this page · raw message
drivers/bus/ifpga/meson.build +1 -1
@@ -9,4 +9,4 @@ endif deps += ['pci', 'kvargs', 'rawdev'] headers = files('rte_bus_ifpga.h') -sources = files('ifpga_common.c', 'ifpga_bus.c') +sources = files('ifpga_bus.c')
drivers/bus/ifpga/version.map +0 -2
@@ -4,8 +4,6 @@ DPDK_22 { rte_ifpga_driver_register; rte_ifpga_driver_unregister; rte_ifpga_find_afu_by_name; - rte_ifpga_get_integer32_arg; - rte_ifpga_get_string_arg; local: *; };
drivers/raw/ifpga/ifpga_rawdev.c +1 -1
@@ -1752,7 +1752,7 @@ ifpga_vdev_parse_devargs(struct rte_devargs *devargs,if (rte_kvargs_count (kvlist,IFPGA_ARG_PORT ) ==1 ) {if (rte_kvargs_process (kvlist,IFPGA_ARG_PORT , - &rte_ifpga_get_integer32_arg, &port) <0 ) { + ifpga_get_integer32_arg, &port) <0 ) {IFPGA_RAWDEV_PMD_ERR ("error to parse %s" ,IFPGA_ARG_PORT ); goto end;
Signature · 1 line
2.36.1
RFC v2 22/29 bus/ifpga: make driver-only headers private
In reply to David MarchandThe ifpga bus interface is for drivers only.
Mark as internal and move the header on the driver headers list.
---
.../bus/ifpga/{rte_bus_ifpga.h => bus_ifpga_driver.h} | 11 ++++++++---
drivers/bus/ifpga/ifpga_bus.c | 4 ++--
drivers/bus/ifpga/ifpga_common.h | 2 +-
drivers/bus/ifpga/meson.build | 2 +-
drivers/bus/ifpga/version.map | 2 +-
drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +-
drivers/net/ipn3ke/ipn3ke_ethdev.h | 2 +-
drivers/net/ipn3ke/ipn3ke_flow.c | 2 +-
drivers/net/ipn3ke/ipn3ke_representor.c | 2 +-
drivers/net/ipn3ke/ipn3ke_tm.c | 2 +-
drivers/raw/ifpga/afu_pmd_core.h | 2 +-
drivers/raw/ifpga/afu_pmd_he_hssi.c | 2 +-
drivers/raw/ifpga/afu_pmd_he_lpbk.c | 2 +-
drivers/raw/ifpga/afu_pmd_he_mem.c | 2 +-
drivers/raw/ifpga/afu_pmd_n3000.c | 2 +-
drivers/raw/ifpga/ifpga_rawdev.c | 2 +-
16 files changed, 24 insertions(+), 19 deletions(-)
rename drivers/bus/ifpga/{rte_bus_ifpga.h => bus_ifpga_driver.h} (95%)drivers/bus/ifpga/bus_ifpga_driver.h renamed from drivers/bus/ifpga/rte_bus_ifpga.h +8 -3
@@ -2,8 +2,8 @@* Copyright(c) 2010-2018 Intel Corporation */ -#ifndef _RTE_BUS_IFPGA_H_ -#define _RTE_BUS_IFPGA_H_ +#ifndef BUS_IFPGA_DRIVER_H +#define BUS_IFPGA_DRIVER_H /** * @file
@@ -15,6 +15,7 @@extern "C" {#endif /* __cplusplus */ +#include <rte_compat.h> #include <rte_pci.h> #include <rte_interrupts.h> #include <rte_spinlock.h>
@@ -105,6 +106,7 @@ struct rte_afu_driver {const struct rte_afu_uuid *id_table;/**< AFU uuid within FPGA. */ }; +__rte_internal static inline const char *rte_ifpga_device_name (const struct rte_afu_device *afu) {
@@ -119,6 +121,7 @@ rte_ifpga_device_name(const struct rte_afu_device *afu)* @param name * A pointer to AFU name string. */ +__rte_internal struct rte_afu_device *rte_ifpga_find_afu_by_name (const char *name);
@@ -129,6 +132,7 @@ rte_ifpga_find_afu_by_name(const char *name);* A pointer to a rte_afu_driver structure describing the driver * to be registered. */ +__rte_internal void rte_ifpga_driver_register(struct rte_afu_driver *driver);/**
@@ -138,6 +142,7 @@ void rte_ifpga_driver_register(struct rte_afu_driver *driver);* A pointer to a rte_afu_driver structure describing the driver * to be unregistered. */ +__rte_internal void rte_ifpga_driver_unregister(struct rte_afu_driver *driver);#define RTE_PMD_REGISTER_AFU (nm, afudrv)\
@@ -157,4 +162,4 @@ static const char *afudrvinit_ ## nm ## _alias = RTE_STR(alias) }#endif /* __cplusplus */ -#endif /* _RTE_BUS_IFPGA_H_ */ +#endif /* BUS_IFPGA_DRIVER_H */
drivers/bus/ifpga/ifpga_bus.c +2 -2
@@ -28,7 +28,7 @@#include "rte_rawdev.h" #include "rte_rawdev_pmd.h" -#include "rte_bus_ifpga.h" +#include "bus_ifpga_driver.h" #include "ifpga_logs.h" #include "ifpga_common.h"
@@ -65,7 +65,7 @@ ifpga_find_afu_dev(const struct rte_rawdev *rdev, TAILQ_FOREACH(afu_dev, &ifpga_afu_dev_list, next) {if (afu_dev->rawdev == rdev && - !ifpga_afu_id_cmp (&afu_dev->id, afu_id)) + !ifpga_afu_id_cmp (&afu_dev->id, afu_id))return afu_dev; }return NULL ;
drivers/bus/ifpga/ifpga_common.h +1 -1
@@ -9,7 +9,7 @@#include <stdlib.h> #include <string.h> -#include <rte_bus_ifpga.h> +#include <bus_ifpga_driver.h> #include <rte_common.h> static inline int
drivers/bus/ifpga/meson.build +1 -1
@@ -8,5 +8,5 @@ if is_windows endif deps += ['pci', 'kvargs', 'rawdev'] -headers = files('rte_bus_ifpga.h') +driver_sdk_headers += files('bus_ifpga_driver.h') sources = files('ifpga_bus.c')
drivers/bus/ifpga/version.map +1 -1
@@ -1,4 +1,4 @@ -DPDK_22 { +INTERNAL { global: rte_ifpga_driver_register;
drivers/net/ipn3ke/ipn3ke_ethdev.c +1 -1
@@ -16,7 +16,7 @@#include <rte_io.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h> -#include <rte_bus_ifpga.h> +#include <bus_ifpga_driver.h> #include <ifpga_common.h> #include <ifpga_logs.h> #include <ifpga_rawdev.h>
drivers/net/ipn3ke/ipn3ke_ethdev.h +1 -1
@@ -24,7 +24,7 @@#include <rte_spinlock.h> #include <rte_cycles.h> -#include <rte_bus_ifpga.h> +#include <bus_ifpga_driver.h> #include <rte_tm_driver.h> #define IPN3KE_TM_SCRATCH_RW 0
drivers/net/ipn3ke/ipn3ke_flow.c +1 -1
@@ -20,7 +20,7 @@#include <rte_tailq.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h> -#include <rte_bus_ifpga.h> +#include <bus_ifpga_driver.h> #include <ifpga_common.h> #include <ifpga_logs.h> #include <ifpga_rawdev.h>
drivers/net/ipn3ke/ipn3ke_representor.c +1 -1
@@ -18,7 +18,7 @@#include <rte_io.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h> -#include <rte_bus_ifpga.h> +#include <bus_ifpga_driver.h> #include <ifpga_logs.h> #include "ipn3ke_rawdev_api.h"
drivers/net/ipn3ke/ipn3ke_tm.c +1 -1
@@ -19,7 +19,7 @@#include <rte_io.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h> -#include <rte_bus_ifpga.h> +#include <bus_ifpga_driver.h> #include <ifpga_logs.h> #include "ipn3ke_rawdev_api.h"
drivers/raw/ifpga/afu_pmd_core.h +1 -1
@@ -15,7 +15,7 @@ extern "C" {#include <rte_spinlock.h> #include <rte_cycles.h> -#include <rte_bus_ifpga.h> +#include <bus_ifpga_driver.h> #include <rte_rawdev.h> #include "ifpga_rawdev.h"
drivers/raw/ifpga/afu_pmd_he_hssi.c +1 -1
@@ -19,7 +19,7 @@#include <rte_io.h> #include <rte_vfio.h> #include <rte_bus_pci.h> -#include <rte_bus_ifpga.h> +#include <bus_ifpga_driver.h> #include <rte_rawdev.h> #include "afu_pmd_core.h"
drivers/raw/ifpga/afu_pmd_he_lpbk.c +1 -1
@@ -19,7 +19,7 @@#include <rte_io.h> #include <rte_vfio.h> #include <rte_bus_pci.h> -#include <rte_bus_ifpga.h> +#include <bus_ifpga_driver.h> #include <rte_rawdev.h> #include "afu_pmd_core.h"
drivers/raw/ifpga/afu_pmd_he_mem.c +1 -1
@@ -18,7 +18,7 @@#include <rte_io.h> #include <rte_vfio.h> #include <rte_bus_pci.h> -#include <rte_bus_ifpga.h> +#include <bus_ifpga_driver.h> #include <rte_rawdev.h> #include "afu_pmd_core.h"
drivers/raw/ifpga/afu_pmd_n3000.c +1 -1
@@ -19,7 +19,7 @@#include <rte_io.h> #include <rte_vfio.h> #include <rte_bus_pci.h> -#include <rte_bus_ifpga.h> +#include <bus_ifpga_driver.h> #include <rte_rawdev.h> #include "afu_pmd_core.h"
drivers/raw/ifpga/ifpga_rawdev.c +1 -1
@@ -35,7 +35,7 @@#include "base/ifpga_api.h" #include "rte_rawdev.h" #include "rte_rawdev_pmd.h" -#include "rte_bus_ifpga.h" +#include <bus_ifpga_driver.h> #include "ifpga_common.h" #include "ifpga_logs.h" #include "ifpga_rawdev.h"
Signature · 1 line
2.36.1
RFC v2 23/29 bus/pci: make driver-only headers private
In reply to David MarchandThe pci bus interface is for drivers only.
Mark as internal and move the header on the driver headers list.
--- app/test-pmd/testpmd.h | 2 +- app/test/virtual_pmd.c | 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/pci/bsd/pci.c | 1 - drivers/bus/pci/bus_pci_driver.h | 200 ++++++++++++++++++ drivers/bus/pci/meson.build | 1 + drivers/bus/pci/private.h | 1 + drivers/bus/pci/rte_bus_pci.h | 178 +--------------- drivers/bus/pci/version.map | 11 +- drivers/common/cnxk/roc_platform.h | 2 +- drivers/common/mlx5/linux/mlx5_common_os.c | 2 +- drivers/common/mlx5/linux/mlx5_common_os.h | 2 +- drivers/common/mlx5/mlx5_common.h | 2 +- drivers/common/mlx5/mlx5_common_pci.c | 2 +- drivers/common/mlx5/windows/mlx5_common_os.c | 2 +- drivers/common/qat/qat_device.h | 2 +- drivers/common/qat/qat_qp.c | 2 +- drivers/common/sfc_efx/sfc_efx.h | 2 +- drivers/compress/mlx5/mlx5_compress.c | 2 +- drivers/compress/octeontx/otx_zip.h | 2 +- drivers/compress/qat/qat_comp.c | 2 +- drivers/crypto/ccp/ccp_dev.h | 2 +- drivers/crypto/ccp/ccp_pci.h | 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/mlx5/mlx5_crypto.c | 2 +- drivers/crypto/nitrox/nitrox_device.h | 2 +- drivers/crypto/octeontx/otx_cryptodev.c | 2 +- drivers/crypto/octeontx/otx_cryptodev_ops.c | 2 +- drivers/crypto/qat/qat_sym.c | 2 +- drivers/crypto/virtio/virtio_cryptodev.c | 2 +- drivers/crypto/virtio/virtio_pci.h | 2 +- drivers/dma/cnxk/cnxk_dmadev.c | 2 +- drivers/dma/hisilicon/hisi_dmadev.c | 2 +- drivers/dma/idxd/idxd_pci.c | 2 +- drivers/dma/ioat/ioat_dmadev.c | 2 +- drivers/event/dlb2/pf/dlb2_main.h | 2 +- drivers/event/dlb2/pf/dlb2_pf.c | 2 +- drivers/event/octeontx/ssovf_probe.c | 2 +- drivers/event/octeontx/timvf_probe.c | 2 +- drivers/gpu/cuda/cuda.c | 2 +- drivers/mempool/cnxk/cnxk_mempool.c | 2 +- drivers/mempool/octeontx/octeontx_fpavf.c | 2 +- drivers/net/ark/ark_ethdev.c | 2 +- drivers/net/avp/avp_ethdev.c | 2 +- drivers/net/bnx2x/bnx2x.h | 2 +- drivers/net/bnxt/bnxt.h | 2 +- drivers/net/bonding/rte_eth_bond_args.c | 2 +- drivers/net/cxgbe/base/adapter.h | 2 +- drivers/net/cxgbe/cxgbe_ethdev.c | 2 +- drivers/net/e1000/em_ethdev.c | 2 +- drivers/net/e1000/em_rxtx.c | 2 +- drivers/net/e1000/igb_ethdev.c | 2 +- drivers/net/e1000/igb_pf.c | 2 +- drivers/net/ena/ena_ethdev.h | 2 +- drivers/net/enic/base/vnic_dev.h | 2 +- drivers/net/enic/enic_ethdev.c | 2 +- drivers/net/enic/enic_main.c | 2 +- drivers/net/enic/enic_vf_representor.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwdev.c | 2 +- drivers/net/hinic/base/hinic_pmd_hwif.c | 2 +- drivers/net/hinic/base/hinic_pmd_nicio.c | 2 +- drivers/net/hinic/hinic_pmd_ethdev.c | 2 +- drivers/net/hns3/hns3_common.c | 2 +- drivers/net/hns3/hns3_ethdev.c | 2 +- drivers/net/hns3/hns3_rxtx.c | 2 +- drivers/net/i40e/i40e_ethdev.c | 2 +- drivers/net/i40e/i40e_vf_representor.c | 2 +- drivers/net/igc/igc_ethdev.c | 2 +- drivers/net/ionic/ionic.h | 2 +- drivers/net/ionic/ionic_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_ethdev.c | 2 +- drivers/net/ipn3ke/ipn3ke_representor.c | 2 +- drivers/net/ipn3ke/ipn3ke_tm.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.c | 2 +- drivers/net/ixgbe/ixgbe_ethdev.h | 2 +- drivers/net/mlx4/mlx4_ethdev.c | 2 +- drivers/net/mlx5/linux/mlx5_ethdev_os.c | 2 +- drivers/net/mlx5/linux/mlx5_os.c | 2 +- drivers/net/mlx5/mlx5.c | 2 +- drivers/net/mlx5/mlx5_ethdev.c | 2 +- drivers/net/mlx5/mlx5_flow_dv.c | 2 +- drivers/net/mlx5/mlx5_txq.c | 2 +- drivers/net/netvsc/hn_vf.c | 2 +- drivers/net/ngbe/base/ngbe_osdep.h | 2 +- drivers/net/ngbe/ngbe_pf.c | 2 +- drivers/net/octeontx/base/octeontx_pkivf.c | 2 +- drivers/net/octeontx/base/octeontx_pkovf.c | 2 +- drivers/net/qede/base/bcm_osal.h | 2 +- drivers/net/sfc/sfc.h | 2 +- drivers/net/sfc/sfc_ethdev.c | 2 +- drivers/net/sfc/sfc_sriov.c | 2 +- drivers/net/thunderx/nicvf_ethdev.c | 2 +- drivers/net/txgbe/txgbe_ethdev.h | 2 +- drivers/net/txgbe/txgbe_flow.c | 2 +- drivers/net/txgbe/txgbe_pf.c | 2 +- drivers/net/virtio/virtio_pci.h | 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/cnxk_bphy/cnxk_bphy_cgx.c | 2 +- drivers/raw/cnxk_bphy/cnxk_bphy_irq.c | 2 +- drivers/raw/ifpga/afu_pmd_he_hssi.c | 2 +- drivers/raw/ifpga/afu_pmd_he_lpbk.c | 2 +- drivers/raw/ifpga/afu_pmd_he_mem.c | 2 +- drivers/raw/ifpga/afu_pmd_n3000.c | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 2 +- drivers/raw/ifpga/rte_pmd_ifpga.c | 2 +- drivers/raw/ioat/idxd_pci.c | 2 +- drivers/raw/ioat/ioat_rawdev.c | 2 +- drivers/raw/ntb/ntb.c | 2 +- drivers/raw/ntb/ntb_hw_intel.c | 2 +- drivers/regex/mlx5/mlx5_regex.c | 2 +- drivers/regex/mlx5/mlx5_regex_fastpath.c | 2 +- drivers/vdpa/ifc/base/ifcvf_osdep.h | 2 +- drivers/vdpa/ifc/ifcvf_vdpa.c | 2 +- drivers/vdpa/mlx5/mlx5_vdpa.c | 2 +- drivers/vdpa/sfc/sfc_vdpa.h | 2 +- lib/ethdev/ethdev_pci.h | 4 +- lib/eventdev/eventdev_pmd_pci.h | 2 +- 123 files changed, 329 insertions(+), 299 deletions(-) create mode 100644 drivers/bus/pci/bus_pci_driver.h
app/test-pmd/testpmd.h +1 -1
@@ -7,9 +7,9 @@#include <stdbool.h> +#include <bus_pci_driver.h> #include <rte_pci.h> #include <rte_bus.h> -#include <rte_bus_pci.h> #ifdef RTE_LIB_GRO #include <rte_gro.h> #endif
app/test/virtual_pmd.c +1 -1
@@ -6,7 +6,7 @@#include <rte_ethdev.h> #include <ethdev_driver.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_memory.h>
drivers/baseband/acc100/rte_acc100_pmd.c +1 -1
@@ -14,7 +14,7 @@#include <rte_branch_prediction.h> #include <rte_hexdump.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #ifdef RTE_BBDEV_OFFLOAD_COST #include <rte_cycles.h> #endif
drivers/baseband/fpga_5gnr_fec/rte_fpga_5gnr_fec.c +1 -1
@@ -11,7 +11,7 @@#include <rte_mempool.h> #include <rte_errno.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_byteorder.h> #ifdef RTE_BBDEV_OFFLOAD_COST #include <rte_cycles.h>
drivers/baseband/fpga_lte_fec/fpga_lte_fec.c +1 -1
@@ -11,7 +11,7 @@#include <rte_mempool.h> #include <rte_errno.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_byteorder.h> #ifdef RTE_BBDEV_OFFLOAD_COST #include <rte_cycles.h>
drivers/bus/pci/bsd/pci.c +0 -1
@@ -28,7 +28,6 @@#include <rte_interrupts.h> #include <rte_log.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_common.h> #include <rte_launch.h> #include <rte_memory.h>
drivers/bus/pci/bus_pci_driver.h new file +200 -0
200 lines not on this page · raw message
drivers/bus/pci/meson.build +1 -0
@@ -3,6 +3,7 @@ deps += ['pci'] headers = files('rte_bus_pci.h') +driver_sdk_headers = files('bus_pci_driver.h') sources = files('pci_common.c', 'pci_params.c') if is_linux
drivers/bus/pci/private.h +1 -0
@@ -9,6 +9,7 @@#include <stdio.h> #include <bus_driver.h> +#include <bus_pci_driver.h> #include <rte_os_shim.h> #include <rte_pci.h>
drivers/bus/pci/rte_bus_pci.h +1 -177
204 lines not on this page · raw message
drivers/bus/pci/version.map +8 -3
@@ -2,16 +2,13 @@ DPDK_22 { global: rte_pci_dump; - rte_pci_get_sysfs_path; rte_pci_ioport_map; rte_pci_ioport_read; rte_pci_ioport_unmap; rte_pci_ioport_write; rte_pci_map_device; rte_pci_read_config; - rte_pci_register; rte_pci_unmap_device; - rte_pci_unregister; rte_pci_write_config; local: *;
@@ -25,3 +22,11 @@ EXPERIMENTAL { # added in 21.08 rte_pci_set_bus_master; }; + +INTERNAL { + global: + + rte_pci_get_sysfs_path; + rte_pci_register; + rte_pci_unregister; +};
drivers/common/cnxk/roc_platform.h +1 -1
@@ -7,7 +7,7 @@#include <rte_alarm.h> #include <rte_bitmap.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_byteorder.h> #include <rte_common.h> #include <rte_cycles.h>
drivers/common/mlx5/linux/mlx5_common_os.c +1 -1
@@ -15,7 +15,7 @@#include <rte_errno.h> #include <rte_string_fns.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <bus_auxiliary_driver.h> #include "mlx5_common.h"
drivers/common/mlx5/linux/mlx5_common_os.h +1 -1
@@ -9,7 +9,7 @@#include <malloc.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_debug.h> #include <rte_atomic.h> #include <rte_log.h>
drivers/common/mlx5/mlx5_common.h +1 -1
@@ -8,7 +8,7 @@#include <stdio.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_debug.h> #include <rte_atomic.h> #include <rte_rwlock.h>
drivers/common/mlx5/mlx5_common_pci.c +1 -1
@@ -10,7 +10,7 @@#include <rte_class.h> #include <rte_pci.h> #include <bus_driver.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "mlx5_common_log.h" #include "mlx5_common_private.h"
drivers/common/mlx5/windows/mlx5_common_os.c +1 -1
@@ -7,7 +7,7 @@#include <stdio.h> #include <rte_mempool.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_malloc.h> #include <rte_errno.h>
drivers/common/qat/qat_device.h +1 -1
@@ -4,7 +4,7 @@#ifndef _QAT_DEVICE_H_#define _QAT_DEVICE_H_ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "qat_common.h" #include "qat_logs.h"
drivers/common/qat/qat_qp.c +1 -1
@@ -8,7 +8,7 @@#include <rte_malloc.h> #include <rte_memzone.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_atomic.h> #include <rte_prefetch.h>
drivers/common/sfc_efx/sfc_efx.h +1 -1
@@ -10,7 +10,7 @@#ifndef _SFC_EFX_H_#define _SFC_EFX_H_ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "efx.h" #include "efsys.h"
drivers/compress/mlx5/mlx5_compress.c +1 -1
@@ -5,7 +5,7 @@#include <rte_malloc.h> #include <rte_log.h> #include <rte_errno.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_spinlock.h> #include <rte_comp.h> #include <rte_compressdev.h>
drivers/compress/octeontx/otx_zip.h +1 -1
@@ -7,7 +7,7 @@#include <unistd.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_comp.h> #include <rte_compressdev.h> #include <rte_compressdev_pmd.h>
drivers/compress/qat/qat_comp.c +1 -1
@@ -6,7 +6,7 @@#include <rte_mbuf.h> #include <rte_hexdump.h> #include <rte_comp.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_byteorder.h> #include <rte_memcpy.h> #include <rte_common.h>
drivers/crypto/ccp/ccp_dev.h +1 -1
@@ -10,7 +10,7 @@#include <stdint.h> #include <string.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_atomic.h> #include <rte_byteorder.h> #include <rte_io.h>
drivers/crypto/ccp/ccp_pci.h +1 -1
@@ -7,7 +7,7 @@#include <stdint.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #define SYSFS_PCI_DEVICES "/sys/bus/pci/devices"#define PROC_MODULES "/proc/modules"
drivers/crypto/ccp/rte_ccp_pmd.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_string_fns.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_bus_vdev.h> #include <rte_common.h> #include <rte_cryptodev.h>
drivers/crypto/cnxk/cn10k_cryptodev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(C) 2021 Marvell. */ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_common.h> #include <rte_crypto.h> #include <rte_cryptodev.h>
drivers/crypto/cnxk/cn9k_cryptodev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(C) 2021 Marvell. */ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_common.h> #include <rte_crypto.h> #include <rte_cryptodev.h>
drivers/crypto/mlx5/mlx5_crypto.c +1 -1
@@ -7,7 +7,7 @@#include <rte_eal_paging.h> #include <rte_errno.h> #include <rte_log.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_memory.h> #include <mlx5_glue.h>
drivers/crypto/nitrox/nitrox_device.h +1 -1
@@ -5,7 +5,7 @@#ifndef _NITROX_DEVICE_H_#define _NITROX_DEVICE_H_ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_cryptodev.h> struct nitrox_sym_device ;
drivers/crypto/octeontx/otx_cryptodev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018 Cavium, Inc */ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_common.h> #include <cryptodev_pmd.h> #include <rte_log.h>
drivers/crypto/octeontx/otx_cryptodev_ops.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_alarm.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h> #include <rte_eventdev.h>
drivers/crypto/qat/qat_sym.c +1 -1
@@ -7,7 +7,7 @@#include <rte_mempool.h> #include <rte_mbuf.h> #include <rte_crypto_sym.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_byteorder.h> #include "qat_sym.h"
drivers/crypto/virtio/virtio_cryptodev.c +1 -1
@@ -7,7 +7,7 @@#include <rte_common.h> #include <rte_errno.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h> #include <rte_eal.h>
drivers/crypto/virtio/virtio_pci.h +1 -1
@@ -9,7 +9,7 @@#include <rte_eal_paging.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_cryptodev.h> #include "virtio_crypto.h"
drivers/dma/cnxk/cnxk_dmadev.c +1 -1
@@ -5,7 +5,7 @@#include <string.h> #include <unistd.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_common.h> #include <rte_eal.h> #include <rte_lcore.h>
drivers/dma/hisilicon/hisi_dmadev.c +1 -1
@@ -5,7 +5,7 @@#include <inttypes.h> #include <string.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_cycles.h> #include <rte_eal.h> #include <rte_io.h>
drivers/dma/idxd/idxd_pci.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2021 Intel Corporation */ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_devargs.h> #include <rte_dmadev_pmd.h> #include <rte_malloc.h>
drivers/dma/ioat/ioat_dmadev.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2021 Intel Corporation */ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_dmadev_pmd.h> #include <rte_malloc.h> #include <rte_prefetch.h>
drivers/event/dlb2/pf/dlb2_main.h +1 -1
@@ -9,7 +9,7 @@#include <rte_log.h> #include <rte_spinlock.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_eal_paging.h> #include "base/dlb2_hw_types.h"
drivers/event/dlb2/pf/dlb2_pf.c +1 -1
@@ -25,7 +25,7 @@#include <rte_cycles.h> #include <rte_io.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_eventdev.h> #include <eventdev_pmd.h> #include <eventdev_pmd_pci.h>
drivers/event/octeontx/ssovf_probe.c +1 -1
@@ -7,7 +7,7 @@#include <rte_eal.h> #include <rte_io.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "octeontx_mbox.h" #include "ssovf_evdev.h"
drivers/event/octeontx/timvf_probe.c +1 -1
@@ -5,7 +5,7 @@#include <rte_eal.h> #include <rte_io.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <octeontx_mbox.h>
drivers/gpu/cuda/cuda.c +1 -1
@@ -6,7 +6,7 @@#include <rte_malloc.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_byteorder.h> #include <rte_dev.h>
drivers/mempool/cnxk/cnxk_mempool.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_atomic.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_common.h> #include <rte_devargs.h> #include <rte_eal.h>
drivers/mempool/octeontx/octeontx_fpavf.c +1 -1
@@ -13,7 +13,7 @@#include <rte_atomic.h> #include <rte_eal.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_errno.h> #include <rte_memory.h> #include <rte_malloc.h>
drivers/net/ark/ark_ethdev.c +1 -1
@@ -6,7 +6,7 @@#include <sys/stat.h> #include <dlfcn.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <ethdev_pci.h> #include <rte_kvargs.h>
drivers/net/avp/avp_ethdev.c +1 -1
@@ -16,7 +16,7 @@#include <rte_atomic.h> #include <rte_branch_prediction.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_ether.h> #include <rte_common.h> #include <rte_cycles.h>
drivers/net/bnx2x/bnx2x.h +1 -1
@@ -16,7 +16,7 @@#include <rte_byteorder.h> #include <rte_spinlock.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_io.h> #include "bnx2x_osal.h"
drivers/net/bnxt/bnxt.h +1 -1
@@ -11,7 +11,7 @@#include <sys/queue.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <ethdev_driver.h> #include <rte_memory.h> #include <rte_lcore.h>
drivers/net/bonding/rte_eth_bond_args.c +1 -1
@@ -5,7 +5,7 @@#include <bus_driver.h> #include <rte_devargs.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_kvargs.h> #include "rte_eth_bond.h"
drivers/net/cxgbe/base/adapter.h +1 -1
@@ -8,7 +8,7 @@#ifndef __T4_ADAPTER_H__#define __T4_ADAPTER_H__ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_mbuf.h> #include <rte_io.h> #include <rte_rwlock.h>
drivers/net/cxgbe/cxgbe_ethdev.c +1 -1
@@ -20,7 +20,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_branch_prediction.h> #include <rte_memory.h> #include <rte_tailq.h>
drivers/net/e1000/em_ethdev.c +1 -1
@@ -13,7 +13,7 @@#include <rte_byteorder.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_ether.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
drivers/net/e1000/em_rxtx.c +1 -1
@@ -18,7 +18,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_memory.h> #include <rte_memcpy.h> #include <rte_memzone.h>
drivers/net/e1000/igb_ethdev.c +1 -1
@@ -15,7 +15,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_ether.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
drivers/net/e1000/igb_pf.c +1 -1
@@ -10,7 +10,7 @@#include <stdarg.h> #include <inttypes.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_interrupts.h> #include <rte_log.h> #include <rte_debug.h>
drivers/net/ena/ena_ethdev.h +1 -1
@@ -12,7 +12,7 @@#include <ethdev_pci.h> #include <rte_cycles.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_timer.h> #include <rte_dev.h> #include <rte_net.h>
drivers/net/enic/base/vnic_dev.h +1 -1
@@ -9,7 +9,7 @@#include <stdbool.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "enic_compat.h" #include "vnic_resource.h"
drivers/net/enic/enic_ethdev.c +1 -1
@@ -8,7 +8,7 @@#include <rte_dev.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_geneve.h>
drivers/net/enic/enic_main.c +1 -1
@@ -10,7 +10,7 @@#include <fcntl.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_memzone.h> #include <rte_malloc.h> #include <rte_mbuf.h>
drivers/net/enic/enic_vf_representor.c +1 -1
@@ -5,7 +5,7 @@#include <stdint.h> #include <stdio.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_common.h> #include <rte_dev.h> #include <ethdev_driver.h>
drivers/net/hinic/base/hinic_pmd_hwdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <ethdev_driver.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_hash.h> #include <rte_jhash.h>
drivers/net/hinic/base/hinic_pmd_hwif.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2017 Huawei Technologies Co., Ltd */ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "hinic_compat.h" #include "hinic_csr.h"
drivers/net/hinic/base/hinic_pmd_nicio.c +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(c) 2017 Huawei Technologies Co., Ltd */ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "hinic_compat.h" #include "hinic_pmd_hwdev.h"
drivers/net/hinic/hinic_pmd_ethdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <ethdev_pci.h> #include <rte_mbuf.h> #include <rte_malloc.h>
drivers/net/hns3/hns3_common.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_kvargs.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <ethdev_pci.h> #include <rte_pci.h>
drivers/net/hns3/hns3_ethdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_alarm.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <ethdev_pci.h> #include "hns3_ethdev.h"
drivers/net/hns3/hns3_rxtx.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018-2021 HiSilicon Limited. */ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_common.h> #include <rte_cycles.h> #include <rte_geneve.h>
drivers/net/i40e/i40e_ethdev.c +1 -1
@@ -15,7 +15,7 @@#include <rte_eal.h> #include <rte_string_fns.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_ether.h> #include <ethdev_driver.h> #include <ethdev_pci.h>
drivers/net/i40e/i40e_vf_representor.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018 Intel Corporation. */ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h>
drivers/net/igc/igc_ethdev.c +1 -1
@@ -7,7 +7,7 @@#include <rte_string_fns.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_malloc.h>
drivers/net/ionic/ionic.h +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <inttypes.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "ionic_dev.h" #include "ionic_if.h"
drivers/net/ionic/ionic_ethdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_ethdev.h> #include <ethdev_driver.h> #include <rte_malloc.h>
drivers/net/ipn3ke/ipn3ke_ethdev.c +1 -1
@@ -4,7 +4,7 @@#include <stdint.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h>
drivers/net/ipn3ke/ipn3ke_representor.c +1 -1
@@ -5,7 +5,7 @@#include <stdint.h> #include <unistd.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h>
drivers/net/ipn3ke/ipn3ke_tm.c +1 -1
@@ -6,7 +6,7 @@#include <stdlib.h> #include <string.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_ethdev.h> #include <rte_pci.h> #include <rte_malloc.h>
drivers/net/ixgbe/ixgbe_ethdev.c +1 -1
@@ -19,7 +19,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_branch_prediction.h> #include <rte_memory.h> #include <rte_kvargs.h>
drivers/net/ixgbe/ixgbe_ethdev.h +1 -1
@@ -20,7 +20,7 @@#include <rte_time.h> #include <rte_hash.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_tm_driver.h> /* need update link, bit flag */
drivers/net/mlx4/mlx4_ethdev.c +1 -1
@@ -32,7 +32,7 @@#pragma GCC diagnostic error "-Wpedantic"#endif -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_errno.h> #include <ethdev_driver.h> #include <rte_ether.h>
drivers/net/mlx5/linux/mlx5_ethdev_os.c +1 -1
@@ -25,7 +25,7 @@#include <time.h> #include <ethdev_driver.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_mbuf.h> #include <rte_common.h> #include <rte_interrupts.h>
drivers/net/mlx5/linux/mlx5_os.c +1 -1
@@ -20,7 +20,7 @@#include <ethdev_pci.h> #include <rte_pci.h> #include <bus_driver.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <bus_auxiliary_driver.h> #include <rte_common.h> #include <rte_kvargs.h>
drivers/net/mlx5/mlx5.c +1 -1
@@ -14,7 +14,7 @@#include <rte_malloc.h> #include <ethdev_driver.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_common.h> #include <rte_kvargs.h> #include <rte_rwlock.h>
drivers/net/mlx5/mlx5_ethdev.c +1 -1
@@ -11,7 +11,7 @@#include <errno.h> #include <ethdev_driver.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_mbuf.h> #include <rte_common.h> #include <rte_interrupts.h>
drivers/net/mlx5/mlx5_flow_dv.c +1 -1
@@ -15,7 +15,7 @@#include <rte_flow_driver.h> #include <rte_malloc.h> #include <rte_cycles.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_ip.h> #include <rte_gre.h> #include <rte_vxlan.h>
drivers/net/mlx5/mlx5_txq.c +1 -1
@@ -13,7 +13,7 @@#include <rte_mbuf.h> #include <rte_malloc.h> #include <ethdev_driver.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_common.h> #include <rte_eal_paging.h>
drivers/net/netvsc/hn_vf.c +1 -1
@@ -21,7 +21,7 @@#include <rte_memory.h> #include <rte_bus_vmbus.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_log.h> #include <rte_string_fns.h> #include <rte_alarm.h>
drivers/net/ngbe/base/ngbe_osdep.h +1 -1
@@ -19,7 +19,7 @@#include <rte_config.h> #include <rte_io.h> #include <rte_ether.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "../ngbe_logs.h"
drivers/net/ngbe/ngbe_pf.c +1 -1
@@ -6,7 +6,7 @@#include <rte_ether.h> #include <ethdev_driver.h> #include <rte_malloc.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "base/ngbe.h" #include "ngbe_ethdev.h"
drivers/net/octeontx/base/octeontx_pkivf.c +1 -1
@@ -5,7 +5,7 @@#include <string.h> #include <rte_eal.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "../octeontx_logs.h" #include "octeontx_io.h"
drivers/net/octeontx/base/octeontx_pkovf.c +1 -1
@@ -10,7 +10,7 @@#include <rte_cycles.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_spinlock.h> #include "../octeontx_logs.h"
drivers/net/qede/base/bcm_osal.h +1 -1
@@ -20,7 +20,7 @@#include <rte_ether.h> #include <rte_io.h> #include <rte_version.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> /* Forward declaration */ struct ecore_dev ;
drivers/net/sfc/sfc.h +1 -1
@@ -13,7 +13,7 @@#include <stdbool.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <ethdev_driver.h> #include <rte_kvargs.h> #include <rte_spinlock.h>
drivers/net/sfc/sfc_ethdev.c +1 -1
@@ -11,7 +11,7 @@#include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_errno.h> #include <rte_string_fns.h> #include <rte_ether.h>
drivers/net/sfc/sfc_sriov.c +1 -1
@@ -8,7 +8,7 @@*/ #include <rte_common.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "sfc.h" #include "sfc_log.h"
drivers/net/thunderx/nicvf_ethdev.c +1 -1
@@ -32,7 +32,7 @@#include <rte_malloc.h> #include <rte_random.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_tailq.h> #include <rte_devargs.h> #include <rte_kvargs.h>
drivers/net/txgbe/txgbe_ethdev.h +1 -1
@@ -20,7 +20,7 @@#include <rte_ethdev_core.h> #include <rte_hash.h> #include <rte_hash_crc.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_tm_driver.h> /* need update link, bit flag */
drivers/net/txgbe/txgbe_flow.c +1 -1
@@ -4,7 +4,7 @@*/ #include <sys/queue.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_malloc.h> #include <rte_flow.h> #include <rte_flow_driver.h>
drivers/net/txgbe/txgbe_pf.c +1 -1
@@ -20,7 +20,7 @@#include <rte_memcpy.h> #include <rte_malloc.h> #include <rte_random.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "base/txgbe.h" #include "txgbe_ethdev.h"
drivers/net/virtio/virtio_pci.h +1 -1
@@ -9,7 +9,7 @@#include <stdbool.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <ethdev_driver.h> #include "virtio.h"
drivers/net/virtio/virtio_pci_ethdev.c +1 -1
@@ -11,7 +11,7 @@#include <ethdev_driver.h> #include <ethdev_pci.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_errno.h> #include <rte_memory.h>
drivers/net/vmxnet3/vmxnet3_ethdev.c +1 -1
@@ -19,7 +19,7 @@#include <rte_log.h> #include <rte_debug.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_branch_prediction.h> #include <rte_memory.h> #include <rte_memzone.h>
drivers/raw/cnxk_bphy/cnxk_bphy.c +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2021 Marvell. */ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_common.h> #include <rte_dev.h> #include <rte_eal.h>
drivers/raw/cnxk_bphy/cnxk_bphy_cgx.c +1 -1
@@ -3,7 +3,7 @@*/ #include <string.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h>
drivers/raw/cnxk_bphy/cnxk_bphy_irq.c +1 -1
@@ -1,7 +1,7 @@/* SPDX-License-Identifier: BSD-3-Clause * Copyright(C) 2021 Marvell. */ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_pci.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h>
drivers/raw/ifpga/afu_pmd_he_hssi.c +1 -1
@@ -18,7 +18,7 @@#include <rte_memcpy.h> #include <rte_io.h> #include <rte_vfio.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <bus_ifpga_driver.h> #include <rte_rawdev.h>
drivers/raw/ifpga/afu_pmd_he_lpbk.c +1 -1
@@ -18,7 +18,7 @@#include <rte_memcpy.h> #include <rte_io.h> #include <rte_vfio.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <bus_ifpga_driver.h> #include <rte_rawdev.h>
drivers/raw/ifpga/afu_pmd_he_mem.c +1 -1
@@ -17,7 +17,7 @@#include <rte_memcpy.h> #include <rte_io.h> #include <rte_vfio.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <bus_ifpga_driver.h> #include <rte_rawdev.h>
drivers/raw/ifpga/afu_pmd_n3000.c +1 -1
@@ -18,7 +18,7 @@#include <rte_memcpy.h> #include <rte_io.h> #include <rte_vfio.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <bus_ifpga_driver.h> #include <rte_rawdev.h>
drivers/raw/ifpga/ifpga_rawdev.c +1 -1
@@ -16,7 +16,7 @@#include <rte_devargs.h> #include <rte_memcpy.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_kvargs.h> #include <rte_alarm.h> #include <rte_interrupts.h>
drivers/raw/ifpga/rte_pmd_ifpga.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h> #include "rte_pmd_ifpga.h"
drivers/raw/ioat/idxd_pci.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2020 Intel Corporation */ -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_memzone.h> #include <rte_devargs.h>
drivers/raw/ioat/ioat_rawdev.c +1 -1
@@ -3,7 +3,7 @@*/ #include <rte_cycles.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_memzone.h> #include <rte_string_fns.h> #include <rte_rawdev_pmd.h>
drivers/raw/ntb/ntb.c +1 -1
@@ -13,7 +13,7 @@#include <rte_log.h> #include <rte_pci.h> #include <rte_mbuf.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_memzone.h> #include <rte_memcpy.h> #include <rte_rawdev.h>
drivers/raw/ntb/ntb_hw_intel.c +1 -1
@@ -8,7 +8,7 @@#include <rte_io.h> #include <rte_eal.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h>
drivers/regex/mlx5/mlx5_regex.c +1 -1
@@ -9,7 +9,7 @@#include <rte_regexdev.h> #include <rte_regexdev_core.h> #include <rte_regexdev_driver.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <mlx5_common.h> #include <mlx5_common_mr.h>
drivers/regex/mlx5/mlx5_regex_fastpath.c +1 -1
@@ -10,7 +10,7 @@#include <rte_malloc.h> #include <rte_log.h> #include <rte_errno.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_pci.h> #include <rte_regexdev_driver.h> #include <rte_mbuf.h>
drivers/vdpa/ifc/base/ifcvf_osdep.h +1 -1
@@ -10,7 +10,7 @@#include <rte_cycles.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_log.h> #include <rte_io.h>
drivers/vdpa/ifc/ifcvf_vdpa.c +1 -1
@@ -14,7 +14,7 @@#include <rte_eal_paging.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_vhost.h> #include <rte_vdpa.h> #include <vdpa_driver.h>
drivers/vdpa/mlx5/mlx5_vdpa.c +1 -1
@@ -13,7 +13,7 @@#include <rte_log.h> #include <rte_errno.h> #include <rte_string_fns.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include <rte_eal_paging.h> #include <mlx5_glue.h>
drivers/vdpa/sfc/sfc_vdpa.h +1 -1
@@ -8,7 +8,7 @@#include <stdint.h> #include <sys/queue.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "sfc_efx.h" #include "sfc_efx_mcdi.h"
lib/ethdev/ethdev_pci.h +2 -2
@@ -10,12 +10,12 @@extern "C" {#endif +#include <bus_pci_driver.h> +#include <ethdev_driver.h> #include <rte_common.h> #include <rte_malloc.h> #include <rte_pci.h> -#include <rte_bus_pci.h> #include <rte_config.h> -#include <ethdev_driver.h> /** * Copy pci device info to the Ethernet device data.
lib/eventdev/eventdev_pmd_pci.h +1 -1
@@ -23,7 +23,7 @@ extern "C" {#include <rte_eal.h> #include <rte_lcore.h> #include <rte_pci.h> -#include <rte_bus_pci.h> +#include <bus_pci_driver.h> #include "eventdev_pmd.h"
Signature · 1 line
2.36.1
RFC v2 24/29 bus/vdev: make driver-only headers private
In reply to David MarchandThe vdev bus interface is for drivers only.
Mark as internal and move the header on the driver headers list.
--- app/test/test_vdev.c | 2 +- drivers/baseband/la12xx/bbdev_la12xx.c | 2 +- drivers/baseband/null/bbdev_null.c | 2 +- .../baseband/turbo_sw/bbdev_turbo_software.c | 2 +- drivers/bus/vdev/bus_vdev_driver.h | 151 ++++++++++++++++++ drivers/bus/vdev/meson.build | 1 + drivers/bus/vdev/rte_bus_vdev.h | 131 --------------- drivers/bus/vdev/vdev.c | 2 +- drivers/bus/vdev/version.map | 9 +- drivers/compress/isal/isal_compress_pmd.c | 2 +- drivers/compress/zlib/zlib_pmd.c | 2 +- drivers/crypto/armv8/rte_armv8_pmd.c | 2 +- drivers/crypto/bcmfs/bcmfs_device.h | 2 +- drivers/crypto/caam_jr/caam_jr.c | 2 +- drivers/crypto/ccp/rte_ccp_pmd.c | 2 +- drivers/crypto/ipsec_mb/ipsec_mb_private.c | 2 +- drivers/crypto/ipsec_mb/ipsec_mb_private.h | 2 +- drivers/crypto/ipsec_mb/pmd_kasumi.c | 2 +- drivers/crypto/mvsam/rte_mrvl_pmd.c | 2 +- drivers/crypto/null/null_crypto_pmd.c | 2 +- drivers/crypto/openssl/rte_openssl_pmd.c | 2 +- drivers/crypto/scheduler/scheduler_pmd.c | 2 +- drivers/dma/skeleton/skeleton_dmadev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev.c | 2 +- drivers/event/dpaa2/dpaa2_eventdev_selftest.c | 2 +- drivers/event/octeontx/ssovf_evdev.c | 2 +- drivers/event/octeontx/ssovf_evdev_selftest.c | 2 +- drivers/event/opdl/opdl_evdev.c | 2 +- drivers/event/opdl/opdl_evdev_init.c | 2 +- drivers/event/opdl/opdl_test.c | 2 +- drivers/event/skeleton/skeleton_eventdev.c | 2 +- drivers/event/sw/sw_evdev.c | 2 +- drivers/event/sw/sw_evdev_selftest.c | 2 +- drivers/net/af_packet/rte_eth_af_packet.c | 2 +- drivers/net/af_xdp/rte_eth_af_xdp.c | 2 +- drivers/net/bonding/rte_eth_bond_api.c | 2 +- drivers/net/bonding/rte_eth_bond_pmd.c | 2 +- drivers/net/failsafe/failsafe.c | 2 +- drivers/net/ipn3ke/ipn3ke_ethdev.h | 2 +- drivers/net/kni/rte_eth_kni.c | 2 +- drivers/net/memif/memif_socket.c | 2 +- drivers/net/memif/rte_eth_memif.c | 2 +- drivers/net/mvneta/mvneta_ethdev.c | 2 +- drivers/net/mvpp2/mrvl_ethdev.c | 2 +- drivers/net/null/rte_eth_null.c | 2 +- drivers/net/octeontx/octeontx_ethdev.c | 2 +- drivers/net/pcap/pcap_ethdev.c | 2 +- drivers/net/pfe/pfe_ethdev.c | 2 +- drivers/net/ring/rte_eth_ring.c | 2 +- drivers/net/softnic/rte_eth_softnic.c | 2 +- drivers/net/tap/rte_eth_tap.c | 2 +- drivers/net/vdev_netvsc/vdev_netvsc.c | 2 +- drivers/net/vhost/rte_eth_vhost.c | 2 +- drivers/net/virtio/virtio_user_ethdev.c | 2 +- drivers/raw/cnxk_gpio/cnxk_gpio.c | 2 +- drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c | 2 +- drivers/raw/ifpga/ifpga_rawdev.c | 2 +- drivers/raw/skeleton/skeleton_rawdev.c | 2 +- drivers/raw/skeleton/skeleton_rawdev_test.c | 2 +- lib/ethdev/ethdev_vdev.h | 2 +- lib/eventdev/eventdev_pmd_vdev.h | 2 +- 61 files changed, 216 insertions(+), 190 deletions(-) create mode 100644 drivers/bus/vdev/bus_vdev_driver.h
app/test/test_vdev.c +1 -1
@@ -7,9 +7,9 @@#include <string.h> #include <bus_driver.h> +#include <bus_vdev_driver.h> #include <rte_common.h> #include <rte_kvargs.h> -#include <rte_bus_vdev.h> #include "test.h"
drivers/baseband/la12xx/bbdev_la12xx.c +1 -1
@@ -10,7 +10,7 @@#include <dirent.h> #include <rte_common.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_malloc.h> #include <rte_ring.h> #include <rte_kvargs.h>
drivers/baseband/null/bbdev_null.c +1 -1
@@ -5,7 +5,7 @@#include <string.h> #include <rte_common.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_malloc.h> #include <rte_ring.h> #include <rte_kvargs.h>
drivers/baseband/turbo_sw/bbdev_turbo_software.c +1 -1
@@ -5,7 +5,7 @@#include <string.h> #include <rte_common.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_malloc.h> #include <rte_ring.h> #include <rte_kvargs.h>
drivers/bus/vdev/bus_vdev_driver.h new file +151 -0
151 lines not on this page · raw message
drivers/bus/vdev/meson.build +1 -0
@@ -6,5 +6,6 @@ sources = files( 'vdev_params.c', ) headers = files('rte_bus_vdev.h') +driver_sdk_headers = files('bus_vdev_driver.h') deps += ['kvargs']
drivers/bus/vdev/rte_bus_vdev.h +0 -131
137 lines not on this page · raw message
drivers/bus/vdev/vdev.c +1 -1
@@ -11,6 +11,7 @@#include <sys/queue.h> #include <bus_driver.h> +#include <bus_vdev_driver.h> #include <rte_eal.h> #include <rte_dev.h> #include <rte_common.h>
@@ -21,7 +22,6 @@#include <rte_string_fns.h> #include <rte_errno.h> -#include "rte_bus_vdev.h" #include "vdev_logs.h" #include "vdev_private.h"
drivers/bus/vdev/version.map +7 -2
@@ -3,10 +3,15 @@ DPDK_22 { rte_vdev_add_custom_scan; rte_vdev_init; - rte_vdev_register; rte_vdev_remove_custom_scan; rte_vdev_uninit; - rte_vdev_unregister; local: *; }; + +INTERNAL { + global: + + rte_vdev_register; + rte_vdev_unregister; +};
drivers/compress/isal/isal_compress_pmd.c +1 -1
@@ -3,7 +3,7 @@*/ #include <isa-l.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_common.h> #include <rte_cpuflags.h> #include <rte_malloc.h>
drivers/compress/zlib/zlib_pmd.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2018 Cavium Networks */ -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_common.h> #include "zlib_pmd_private.h"
drivers/crypto/armv8/rte_armv8_pmd.c +1 -1
@@ -8,7 +8,7 @@#include <rte_hexdump.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_malloc.h> #include <rte_cpuflags.h>
drivers/crypto/bcmfs/bcmfs_device.h +1 -1
@@ -9,7 +9,7 @@#include <sys/queue.h> #include <rte_spinlock.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include "bcmfs_logs.h" #include "bcmfs_qp.h"
drivers/crypto/caam_jr/caam_jr.c +1 -1
@@ -12,7 +12,7 @@#include <cryptodev_pmd.h> #include <rte_crypto.h> #include <rte_cryptodev.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_malloc.h> #include <rte_security_driver.h> #include <rte_hexdump.h>
drivers/crypto/ccp/rte_ccp_pmd.c +1 -1
@@ -4,7 +4,7 @@#include <rte_string_fns.h> #include <bus_pci_driver.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_common.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h>
drivers/crypto/ipsec_mb/ipsec_mb_private.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2021 Intel Corporation */ -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_common.h> #include <rte_cryptodev.h>
drivers/crypto/ipsec_mb/ipsec_mb_private.h +1 -1
@@ -7,7 +7,7 @@#include <intel-ipsec-mb.h> #include <cryptodev_pmd.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #if defined(RTE_LIB_SECURITY )#define IPSEC_MB_DOCSIS_SEC_ENABLED 1
drivers/crypto/ipsec_mb/pmd_kasumi.c +1 -1
@@ -2,7 +2,7 @@* Copyright(c) 2016-2021 Intel Corporation */ -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_common.h> #include <rte_cpuflags.h> #include <rte_cryptodev.h>
drivers/crypto/mvsam/rte_mrvl_pmd.c +1 -1
@@ -9,7 +9,7 @@#include <rte_cryptodev.h> #include <cryptodev_pmd.h> #include <rte_security_driver.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_malloc.h> #include <rte_cpuflags.h> #include <rte_kvargs.h>
drivers/crypto/null/null_crypto_pmd.c +1 -1
@@ -4,7 +4,7 @@#include <rte_common.h> #include <cryptodev_pmd.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_malloc.h> #include "null_crypto_pmd_private.h"
drivers/crypto/openssl/rte_openssl_pmd.c +1 -1
@@ -6,7 +6,7 @@#include <rte_hexdump.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_malloc.h> #include <rte_cpuflags.h>
drivers/crypto/scheduler/scheduler_pmd.c +1 -1
@@ -5,7 +5,7 @@#include <rte_hexdump.h> #include <rte_cryptodev.h> #include <cryptodev_pmd.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_malloc.h> #include <rte_cpuflags.h> #include <rte_reorder.h>
drivers/dma/skeleton/skeleton_dmadev.c +1 -1
@@ -4,7 +4,7 @@#include <inttypes.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_cycles.h> #include <rte_eal.h> #include <rte_kvargs.h>
drivers/event/dpaa2/dpaa2_eventdev.c +1 -1
@@ -23,7 +23,7 @@#include <rte_memcpy.h> #include <rte_memory.h> #include <rte_pci.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <ethdev_driver.h> #include <cryptodev_pmd.h> #include <rte_event_eth_rx_adapter.h>
drivers/event/dpaa2/dpaa2_eventdev_selftest.c +1 -1
@@ -17,7 +17,7 @@#include <rte_lcore.h> #include <rte_per_lcore.h> #include <rte_random.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_test.h> #include <bus_fslmc_driver.h>
drivers/event/octeontx/ssovf_evdev.c +1 -1
@@ -16,7 +16,7 @@#include <rte_log.h> #include <rte_malloc.h> #include <rte_memory.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include "ssovf_evdev.h" #include "timvf_evdev.h"
drivers/event/octeontx/ssovf_evdev_selftest.c +1 -1
@@ -17,7 +17,7 @@#include <rte_lcore.h> #include <rte_per_lcore.h> #include <rte_random.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_test.h> #include "ssovf_evdev.h"
drivers/event/opdl/opdl_evdev.c +1 -1
@@ -5,7 +5,7 @@#include <inttypes.h> #include <string.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_lcore.h> #include <rte_memzone.h> #include <rte_kvargs.h>
drivers/event/opdl/opdl_evdev_init.c +1 -1
@@ -5,7 +5,7 @@#include <inttypes.h> #include <string.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_errno.h> #include <rte_cycles.h> #include <rte_memzone.h>
drivers/event/opdl/opdl_test.c +1 -1
@@ -19,7 +19,7 @@#include <rte_ethdev.h> #include <rte_cycles.h> #include <rte_eventdev.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_pause.h> #include "opdl_evdev.h"
drivers/event/skeleton/skeleton_eventdev.c +1 -1
@@ -18,7 +18,7 @@#include <rte_malloc.h> #include <rte_memory.h> #include <rte_lcore.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include "skeleton_eventdev.h"
drivers/event/sw/sw_evdev.c +1 -1
@@ -5,7 +5,7 @@#include <inttypes.h> #include <string.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_kvargs.h> #include <rte_ring.h> #include <rte_errno.h>
drivers/event/sw/sw_evdev_selftest.c +1 -1
@@ -21,7 +21,7 @@#include <rte_pause.h> #include <rte_service.h> #include <rte_service_component.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include "sw_evdev.h"
drivers/net/af_packet/rte_eth_af_packet.c +1 -1
@@ -12,7 +12,7 @@#include <ethdev_vdev.h> #include <rte_malloc.h> #include <rte_kvargs.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <errno.h> #include <linux/if_ether.h>
drivers/net/af_xdp/rte_eth_af_xdp.c +1 -1
@@ -20,7 +20,7 @@#include <ethdev_driver.h> #include <ethdev_vdev.h> #include <rte_kvargs.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_string_fns.h> #include <rte_branch_prediction.h> #include <rte_common.h>
drivers/net/bonding/rte_eth_bond_api.c +1 -1
@@ -8,7 +8,7 @@#include <rte_malloc.h> #include <ethdev_driver.h> #include <rte_tcp.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_kvargs.h> #include "rte_eth_bond.h"
drivers/net/bonding/rte_eth_bond_pmd.c +1 -1
@@ -15,7 +15,7 @@#include <rte_ip_frag.h> #include <rte_devargs.h> #include <rte_kvargs.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_alarm.h> #include <rte_cycles.h> #include <rte_string_fns.h>
drivers/net/failsafe/failsafe.c +1 -1
@@ -12,7 +12,7 @@#include <rte_devargs.h> #include <rte_kvargs.h> #include <bus_driver.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include "failsafe_private.h"
drivers/net/ipn3ke/ipn3ke_ethdev.h +1 -1
@@ -19,7 +19,7 @@#include <ethdev_vdev.h> #include <rte_malloc.h> #include <rte_memcpy.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_kvargs.h> #include <rte_spinlock.h>
drivers/net/kni/rte_eth_kni.c +1 -1
@@ -12,7 +12,7 @@#include <rte_kni.h> #include <rte_kvargs.h> #include <rte_malloc.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> /* Only single queue supported */ #define KNI_MAX_QUEUE_PER_PORT 1
drivers/net/memif/memif_socket.c +1 -1
@@ -17,7 +17,7 @@#include <ethdev_vdev.h> #include <rte_malloc.h> #include <rte_kvargs.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_hash.h> #include <rte_jhash.h> #include <rte_string_fns.h>
drivers/net/memif/rte_eth_memif.c +1 -1
@@ -21,7 +21,7 @@#include <ethdev_vdev.h> #include <rte_malloc.h> #include <rte_kvargs.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_string_fns.h> #include <rte_errno.h> #include <rte_memory.h>
drivers/net/mvneta/mvneta_ethdev.c +1 -1
@@ -7,7 +7,7 @@#include <rte_string_fns.h> #include <ethdev_driver.h> #include <rte_kvargs.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <stdio.h> #include <fcntl.h>
drivers/net/mvpp2/mrvl_ethdev.c +1 -1
@@ -9,7 +9,7 @@#include <rte_kvargs.h> #include <rte_log.h> #include <rte_malloc.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <fcntl.h> #include <linux/ethtool.h>
drivers/net/null/rte_eth_null.c +1 -1
@@ -8,7 +8,7 @@#include <ethdev_vdev.h> #include <rte_malloc.h> #include <rte_memcpy.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_kvargs.h> #include <rte_spinlock.h>
drivers/net/octeontx/octeontx_ethdev.c +1 -1
@@ -12,7 +12,7 @@#include <eventdev_pmd.h> #include <rte_alarm.h> #include <rte_branch_prediction.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_cycles.h> #include <rte_debug.h> #include <rte_dev.h>
drivers/net/pcap/pcap_ethdev.c +1 -1
@@ -15,7 +15,7 @@#include <rte_malloc.h> #include <rte_mbuf.h> #include <rte_mbuf_dyn.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_os_shim.h> #include "pcap_osdep.h"
drivers/net/pfe/pfe_ethdev.c +1 -1
@@ -6,7 +6,7 @@#include <sys/epoll.h> #include <rte_kvargs.h> #include <ethdev_vdev.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_ether.h> #include <dpaa_of.h>
drivers/net/ring/rte_eth_ring.c +1 -1
@@ -8,7 +8,7 @@#include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_string_fns.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_kvargs.h> #include <rte_errno.h>
drivers/net/softnic/rte_eth_softnic.c +1 -1
@@ -9,7 +9,7 @@#include <ethdev_driver.h> #include <ethdev_vdev.h> #include <rte_malloc.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_kvargs.h> #include <rte_errno.h> #include <rte_ring.h>
drivers/net/tap/rte_eth_tap.c +1 -1
@@ -10,7 +10,7 @@#include <ethdev_driver.h> #include <ethdev_vdev.h> #include <rte_malloc.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_kvargs.h> #include <rte_net.h> #include <rte_debug.h>
drivers/net/vdev_netvsc/vdev_netvsc.c +1 -1
@@ -25,7 +25,7 @@#include <bus_driver.h> #include <rte_alarm.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_common.h> #include <rte_dev.h> #include <rte_errno.h>
drivers/net/vhost/rte_eth_vhost.c +1 -1
@@ -13,7 +13,7 @@#include <rte_malloc.h> #include <rte_memcpy.h> #include <rte_net.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_kvargs.h> #include <rte_vhost.h> #include <rte_spinlock.h>
drivers/net/virtio/virtio_user_ethdev.c +1 -1
@@ -14,7 +14,7 @@#include <rte_malloc.h> #include <rte_kvargs.h> #include <ethdev_vdev.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_alarm.h> #include <rte_cycles.h>
drivers/raw/cnxk_gpio/cnxk_gpio.c +1 -1
@@ -6,7 +6,7 @@#include <string.h> #include <sys/stat.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_eal.h> #include <rte_kvargs.h> #include <rte_lcore.h>
drivers/raw/dpaa2_cmdif/dpaa2_cmdif.c +1 -1
@@ -6,7 +6,7 @@#include <errno.h> #include <stdint.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_atomic.h> #include <rte_interrupts.h> #include <rte_branch_prediction.h>
drivers/raw/ifpga/ifpga_rawdev.c +1 -1
@@ -26,7 +26,7 @@#include <rte_memzone.h> #include <rte_eal.h> #include <rte_common.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_string_fns.h> #include <rte_pmd_i40e.h>
drivers/raw/skeleton/skeleton_rawdev.c +1 -1
@@ -21,7 +21,7 @@#include <rte_memory.h> #include <rte_memcpy.h> #include <rte_lcore.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_rawdev.h> #include <rte_rawdev_pmd.h>
drivers/raw/skeleton/skeleton_rawdev_test.c +1 -1
@@ -8,7 +8,7 @@#include <rte_memcpy.h> #include <rte_dev.h> #include <rte_rawdev.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <rte_test.h> /* Using relative path as skeleton_rawdev is not part of exported headers */
lib/ethdev/ethdev_vdev.h +1 -1
@@ -12,7 +12,7 @@ extern "C" {#include <rte_config.h> #include <rte_malloc.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include <ethdev_driver.h> /**
lib/eventdev/eventdev_pmd_vdev.h +1 -1
@@ -22,7 +22,7 @@ extern "C" {#include <rte_config.h> #include <rte_debug.h> #include <rte_eal.h> -#include <rte_bus_vdev.h> +#include <bus_vdev_driver.h> #include "eventdev_pmd.h"
Signature · 1 line
2.36.1
RFC v2 25/29 bus/vmbus: make driver-only headers private
In reply to David MarchandThe vmbus bus interface is for drivers only.
Mark as internal and move the header on the driver headers list.
--- drivers/bus/vmbus/bus_vmbus_driver.h | 106 +++++++++++++++++++++++++++ drivers/bus/vmbus/meson.build | 1 + drivers/bus/vmbus/private.h | 2 +- drivers/bus/vmbus/rte_bus_vmbus.h | 83 --------------------- drivers/bus/vmbus/version.map | 9 ++- 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/netvsc/hn_vf.c | 2 +- 10 files changed, 120 insertions(+), 91 deletions(-) create mode 100644 drivers/bus/vmbus/bus_vmbus_driver.h
drivers/bus/vmbus/bus_vmbus_driver.h new file +106 -0
@@ -0,0 +1,106 @@ +/* SPDX-License-Identifier: BSD-3-Clause +* Copyright (c) 2018, Microsoft Corporation. +* All Rights Reserved. +*/ + +#ifndef BUS_VMBUS_DRIVER_H +#define BUS_VMBUS_DRIVER_H + +#ifdef __cplusplus +extern "C" { +#endif + +#include <rte_bus_vmbus.h> +#include <rte_compat.h> +#include <rte_dev.h> + +struct vmbus_channel ; +struct vmbus_mon_page ; + +/** Maximum number of VMBUS resources. */ +enum hv_uio_map { +HV_TXRX_RING_MAP =0 , +HV_INT_PAGE_MAP , +HV_MON_PAGE_MAP , +HV_RECV_BUF_MAP , +HV_SEND_BUF_MAP +}; +#define VMBUS_MAX_RESOURCE 5 + +/** +* A structure describing a VMBUS device. +*/ +struct rte_vmbus_device { +RTE_TAILQ_ENTRY (rte_vmbus_device) next;/**< Next probed VMBUS device */ +const struct rte_vmbus_driver *driver;/**< Associated driver */ +struct rte_device device;/**< Inherit core device */ +rte_uuid_t device_id;/**< VMBUS device id */ +rte_uuid_t class_id;/**< VMBUS device type */ +uint32_t relid;/**< id for primary */ +uint8_t monitor_id;/**< monitor page */ +int uio_num;/**< UIO device number */ +uint32_t *int_page;/**< VMBUS interrupt page */ +struct vmbus_channel *primary;/**< VMBUS primary channel */ +struct vmbus_mon_page *monitor_page;/**< VMBUS monitor page */ + +struct rte_intr_handle *intr_handle;/**< Interrupt handle */ +struct rte_mem_resource resource[VMBUS_MAX_RESOURCE ]; +}; + +/** +* Initialization function for the driver called during VMBUS probing. +*/ +typedef int (vmbus_probe_t )(struct rte_vmbus_driver *, +struct rte_vmbus_device *); + +/** +* Initialization function for the driver called during hot plugging. +*/ +typedef int (vmbus_remove_t )(struct rte_vmbus_device *); + +/** +* A structure describing a VMBUS driver. +*/ +struct rte_vmbus_driver { +RTE_TAILQ_ENTRY (rte_vmbus_driver) next;/**< Next in list. */ +struct rte_driver driver; +vmbus_probe_t *probe;/**< Device Probe function. */ +vmbus_remove_t *remove;/**< Device Remove function. */ + +const rte_uuid_t *id_table;/**< ID table. */ +}; + +/** +* Register a VMBUS driver. +* +* @param driver +* A pointer to a rte_vmbus_driver structure describing the driver +* to be registered. +*/ +__rte_internal +void rte_vmbus_register(struct rte_vmbus_driver *driver); + +/** +* Unregister a VMBUS driver. +* +* @param driver +* A pointer to a rte_vmbus_driver structure describing the driver +* to be unregistered. +*/ +__rte_internal +void rte_vmbus_unregister(struct rte_vmbus_driver *driver); + +/** Helper for VMBUS device registration from driver instance */ +#define RTE_PMD_REGISTER_VMBUS (nm, vmbus_drv) \ + RTE_INIT(vmbusinitfn_ ##nm) \ + { \ + (vmbus_drv).driver.name = RTE_STR(nm); \ + rte_vmbus_register(&vmbus_drv); \ + } \ + RTE_PMD_EXPORT_NAME(nm, __COUNTER__) + +#ifdef __cplusplus +} +#endif + +#endif /* BUS_VMBUS_DRIVER_H */
drivers/bus/vmbus/meson.build +1 -0
@@ -8,6 +8,7 @@ endif headers = files('rte_bus_vmbus.h','rte_vmbus_reg.h') +driver_sdk_headers = files('bus_vmbus_driver.h') sources = files( 'vmbus_bufring.c',
drivers/bus/vmbus/private.h +1 -1
@@ -10,10 +10,10 @@#include <sys/uio.h> #include <bus_driver.h> +#include <bus_vmbus_driver.h> #include <rte_log.h> #include <rte_eal_paging.h> #include <rte_vmbus_reg.h> -#include <rte_bus_vmbus.h> /** * Structure describing the VM bus
drivers/bus/vmbus/rte_bus_vmbus.h +0 -83
107 lines not on this page · raw message
drivers/bus/vmbus/version.map +7 -2
@@ -16,13 +16,18 @@ DPDK_22 { rte_vmbus_map_device; rte_vmbus_max_channels; rte_vmbus_probe; - rte_vmbus_register; rte_vmbus_scan; rte_vmbus_set_latency; rte_vmbus_sub_channel_index; rte_vmbus_subchan_open; rte_vmbus_unmap_device; - rte_vmbus_unregister; local: *; }; + +INTERNAL { + global: + + rte_vmbus_register; + rte_vmbus_unregister; +};
drivers/net/netvsc/hn_ethdev.c +1 -1
@@ -32,7 +32,7 @@#include <rte_eal.h> #include <rte_dev.h> #include <bus_driver.h> -#include <rte_bus_vmbus.h> +#include <bus_vmbus_driver.h> #include <rte_alarm.h> #include "hn_logs.h"
drivers/net/netvsc/hn_nvs.c +1 -1
@@ -29,7 +29,7 @@#include <rte_memory.h> #include <rte_eal.h> #include <rte_dev.h> -#include <rte_bus_vmbus.h> +#include <bus_vmbus_driver.h> #include "hn_logs.h" #include "hn_var.h"
drivers/net/netvsc/hn_rndis.c +1 -1
@@ -27,7 +27,7 @@#include <rte_memory.h> #include <rte_eal.h> #include <rte_dev.h> -#include <rte_bus_vmbus.h> +#include <bus_vmbus_driver.h> #include "hn_logs.h" #include "hn_var.h"
drivers/net/netvsc/hn_rxtx.c +1 -1
@@ -27,7 +27,7 @@#include <rte_eal.h> #include <rte_dev.h> #include <rte_net.h> -#include <rte_bus_vmbus.h> +#include <bus_vmbus_driver.h> #include <rte_spinlock.h> #include "hn_logs.h"
drivers/net/netvsc/hn_vf.c +1 -1
@@ -19,7 +19,7 @@#include <ethdev_driver.h> #include <rte_lcore.h> #include <rte_memory.h> -#include <rte_bus_vmbus.h> +#include <bus_vmbus_driver.h> #include <rte_pci.h> #include <bus_pci_driver.h> #include <rte_log.h>
Signature · 1 line
2.36.1
RFC v2 26/29 dev: introduce driver name
In reply to David MarchandAdd a helper to get a rte_driver object name. This will be used externally.
Internal users may still dereference a rte_driver object.
--- app/test-pmd/config.c | 2 +- lib/eal/common/eal_common_dev.c | 6 ++++++ lib/eal/include/rte_dev.h | 13 +++++++++++++ lib/eal/version.map | 1 + lib/ethdev/rte_ethdev.h | 2 +- 5 files changed, 22 insertions(+), 2 deletions(-)
app/test-pmd/config.c +1 -1
@@ -654,7 +654,7 @@ device_infos_display(const char *identifier)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" , dev->driver->name); +printf ("\nDriver name: %s" ,rte_driver_name (dev->driver));printf ("\nDevargs: %s" , dev->devargs ? dev->devargs->args :"" );printf ("\nConnect to socket: %d" , dev->numa_node);
lib/eal/common/eal_common_dev.c +6 -0
@@ -19,6 +19,12 @@#include "eal_private.h" #include "hotplug_mp.h" +const char * +rte_driver_name (const struct rte_driver *driver) +{ +return driver->name; +} +/** * The device event callback description. *
lib/eal/include/rte_dev.h +13 -0
@@ -62,6 +62,19 @@ struct rte_driver {const char *alias;/**< Driver alias. */ }; +/** +* @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); +/* * Internal identifier length * Sufficiently large to allow for UUID or PCI address
lib/eal/version.map +1 -0
@@ -425,6 +425,7 @@ EXPERIMENTAL { # added in 22.11 rte_bus_name; + rte_driver_name; }; 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 = dev->device->driver->name +* driver_name = rte_driver_name(dev->device->driver) * 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.36.1
RFC v2 27/29 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.
--- 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/ifpga/bus_ifpga_driver.h | 1 + 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 | 11 ++------ 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 +- 114 files changed, 143 insertions(+), 114 deletions(-) create mode 100644 lib/eal/include/dev_driver.h
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
@@ -22,10 +22,10 @@ extern "C" {#include <stdint.h> #include <inttypes.h> +#include <dev_driver.h> #include <rte_compat.h> #include <rte_debug.h> #include <rte_interrupts.h> -#include <rte_dev.h> #include <rte_kvargs.h> #define RTE_BUS_AUXILIARY_NAME "auxiliary"
drivers/bus/dpaa/bus_dpaa_driver.h +2 -0
@@ -6,9 +6,11 @@#ifndef BUS_DPAA_DRIVER_H #define BUS_DPAA_DRIVER_H +#include <dev_driver.h> #include <rte_compat.h> #include <rte_mbuf_dyn.h> #include <rte_mempool.h> +#include <dpaax_iova_table.h> #include <dpaa_of.h>
drivers/bus/fslmc/bus_fslmc_driver.h +1 -1
@@ -26,10 +26,10 @@ extern "C" {#include <inttypes.h> #include <linux/vfio.h> +#include <dev_driver.h> #include <rte_compat.h> #include <rte_debug.h> #include <rte_interrupts.h> -#include <rte_dev.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/ifpga/bus_ifpga_driver.h +1 -0
@@ -15,6 +15,7 @@extern "C" {#endif /* __cplusplus */ +#include <dev_driver.h> #include <rte_compat.h> #include <rte_pci.h> #include <rte_interrupts.h>
drivers/bus/pci/bus_pci_driver.h +1 -1
@@ -10,8 +10,8 @@extern "C" {#endif +#include <dev_driver.h> #include <rte_bus_pci.h> -#include <rte_dev.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
@@ -9,9 +9,9 @@ extern "C" { #endif +#include <dev_driver.h> #include <rte_bus_vdev.h> #include <rte_compat.h> -#include <rte_dev.h> #include <rte_devargs.h> struct rte_vdev_device {
drivers/bus/vdev/vdev.c +1 -1
@@ -13,7 +13,7 @@#include <bus_driver.h> #include <bus_vdev_driver.h> #include <rte_eal.h> -#include <rte_dev.h> +#include <dev_driver.h> #include <rte_common.h> #include <rte_devargs.h> #include <rte_memory.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
@@ -10,9 +10,9 @@extern "C" {#endif +#include <dev_driver.h> #include <rte_bus_vmbus.h> #include <rte_compat.h> -#include <rte_dev.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 <rte_alarm.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
@@ -9,7 +9,7 @@#include <rte_common.h> #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
@@ -8,8 +8,8 @@#include <sys/queue.h> #include <bus_driver.h> +#include <dev_driver.h> #include <rte_class.h> -#include <rte_dev.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 -9
@@ -23,6 +23,8 @@ extern "C" {#include <rte_compat.h> #include <rte_log.h> +struct rte_driver ; +/** * The device event type. */
@@ -53,15 +55,6 @@ 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. */ -}; -/** * @warning * @b EXPERIMENTAL: this API may change without prior notice
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
@@ -10,7 +10,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
@@ -6,7 +6,7 @@#include <rte_common.h> #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.36.1