eal: remove useless bus API includes
Subsystems (4)
PATCH 1/1 eal: remove useless bus API includes
The file rte_bus.h was included in too many files.
The enum rte_iova_mode is moved from rte_bus.h to rte_eal.h because it is not specific to the bus layer.
It allows to clean-up more includes of rte_bus.h.
Some indirect includes had to be added in few files to compensate.
--- app/test-compress-perf/comp_perf_options.h | 2 ++ drivers/bus/dpaa/dpaa_bus.c | 1 - drivers/bus/fslmc/fslmc_bus.c | 1 - drivers/bus/fslmc/fslmc_vfio.c | 1 - drivers/bus/ifpga/ifpga_common.c | 1 - drivers/bus/ifpga/rte_bus_ifpga.h | 1 - drivers/bus/pci/linux/pci.c | 1 - drivers/bus/pci/pci_common.c | 1 - drivers/bus/vdev/vdev_params.c | 1 - drivers/bus/vmbus/linux/vmbus_uio.c | 1 - drivers/bus/vmbus/rte_bus_vmbus.h | 1 + drivers/bus/vmbus/vmbus_bufring.c | 1 - drivers/bus/vmbus/vmbus_channel.c | 1 - drivers/bus/vmbus/vmbus_common.c | 1 - drivers/bus/vmbus/vmbus_common_uio.c | 1 - drivers/crypto/virtio/virtio_pci.c | 1 - drivers/net/failsafe/failsafe.c | 1 + drivers/net/failsafe/failsafe_eal.c | 1 + drivers/net/mlx4/mlx4_ethdev.c | 1 + drivers/raw/ifpga/ifpga_rawdev.c | 1 - drivers/raw/octeontx2_dma/otx2_dpi_rawdev.c | 1 - drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c | 1 - drivers/raw/octeontx2_ep/otx2_ep_rawdev.c | 1 - examples/multi_process/hotplug_mp/commands.c | 1 + lib/librte_bbdev/rte_bbdev.h | 1 - lib/librte_eal/common/hotplug_mp.c | 1 + lib/librte_eal/common/hotplug_mp.h | 1 - lib/librte_eal/include/rte_bus.h | 14 -------------- lib/librte_eal/include/rte_devargs.h | 3 ++- lib/librte_eal/include/rte_eal.h | 15 ++++++++++++++- lib/librte_eal/include/rte_lcore.h | 4 ++++ lib/librte_ethdev/rte_ethdev.c | 1 + lib/librte_pci/rte_pci.c | 1 - lib/librte_vhost/vhost_user.c | 1 + 34 files changed, 30 insertions(+), 37 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/dpaa/dpaa_bus.c +0 -1
@@ -30,7 +30,6 @@#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 +0 -1
@@ -9,7 +9,6 @@#include <stdbool.h> #include <rte_log.h> -#include <rte_bus.h> #include <rte_malloc.h> #include <rte_devargs.h> #include <rte_memcpy.h>
drivers/bus/fslmc/fslmc_vfio.c +0 -1
@@ -29,7 +29,6 @@#include <rte_cycles.h> #include <rte_kvargs.h> #include <rte_dev.h> -#include <rte_bus.h> #include <rte_eal_memconfig.h> #include "rte_fslmc.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/pci/linux/pci.c +0 -1
@@ -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>
drivers/bus/pci/pci_common.c +0 -1
@@ -13,7 +13,6 @@#include <rte_errno.h> #include <rte_interrupts.h> #include <rte_log.h> -#include <rte_bus.h> #include <rte_pci.h> #include <rte_bus_pci.h> #include <rte_per_lcore.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
@@ -12,7 +12,6 @@#include <sys/mman.h> #include <rte_log.h> -#include <rte_bus.h> #include <rte_memory.h> #include <rte_common.h> #include <rte_malloc.h>
drivers/bus/vmbus/rte_bus_vmbus.h +1 -0
@@ -28,6 +28,7 @@ extern "C" {#include <rte_uuid.h> #include <rte_debug.h> #include <rte_interrupts.h> +#include <rte_bus.h> #include <rte_dev.h> #include <rte_vmbus_reg.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.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/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/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
@@ -5,6 +5,7 @@#include <rte_string_fns.h> #include <rte_malloc.h> +#include <rte_bus.h> #include "failsafe_private.h"
drivers/net/mlx4/mlx4_ethdev.c +1 -0
@@ -32,6 +32,7 @@#pragma GCC diagnostic error "-Wpedantic"#endif +#include <rte_eal.h> #include <rte_bus_pci.h> #include <rte_errno.h> #include <ethdev_driver.h>
drivers/raw/ifpga/ifpga_rawdev.c +0 -1
@@ -11,7 +11,6 @@#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>
drivers/raw/octeontx2_dma/otx2_dpi_rawdev.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>
drivers/raw/octeontx2_ep/otx2_ep_enqdeq.c +0 -1
@@ -7,7 +7,6 @@#include <dirent.h> #include <fcntl.h> -#include <rte_bus.h> #include <rte_bus_pci.h> #include <rte_eal.h> #include <rte_lcore.h>
drivers/raw/octeontx2_ep/otx2_ep_rawdev.c +0 -1
@@ -4,7 +4,6 @@#include <string.h> #include <unistd.h> -#include <rte_bus.h> #include <rte_bus_pci.h> #include <rte_eal.h> #include <rte_lcore.h>
examples/multi_process/hotplug_mp/commands.c +1 -0
@@ -8,6 +8,7 @@#include <cmdline_parse_num.h> #include <cmdline_parse_string.h> #include <cmdline.h> +#include <rte_bus.h> #include <rte_ethdev.h> /**********************************************************/
lib/librte_bbdev/rte_bbdev.h +0 -1
@@ -33,7 +33,6 @@ extern "C" {#include <string.h> #include <rte_compat.h> -#include <rte_bus.h> #include <rte_cpuflags.h> #include <rte_memory.h>
lib/librte_eal/common/hotplug_mp.c +1 -0
@@ -8,6 +8,7 @@#include <rte_alarm.h> #include <rte_string_fns.h> #include <rte_devargs.h> +#include <rte_bus.h> #include "hotplug_mp.h" #include "eal_private.h"
lib/librte_eal/common/hotplug_mp.h +0 -1
@@ -6,7 +6,6 @@#define _HOTPLUG_MP_H_#include "rte_dev.h" -#include "rte_bus.h" #define EAL_DEV_MP_ACTION_REQUEST "eal_dev_mp_request"#define EAL_DEV_MP_ACTION_RESPONSE "eal_dev_mp_response"
lib/librte_eal/include/rte_bus.h +0 -14
@@ -28,20 +28,6 @@ extern "C" {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/librte_eal/include/rte_devargs.h +2 -1
@@ -22,8 +22,9 @@ extern "C" {#include <stdio.h> #include <sys/queue.h> +#include <rte_compat.h> -#include <rte_bus.h> +#include <rte_dev.h> /** * Type of generic device
lib/librte_eal/include/rte_eal.h +14 -1
@@ -18,7 +18,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>
@@ -32,6 +31,20 @@ extern "C" {/* Maximum thread_name length. */ #define RTE_MAX_THREAD_NAME_LEN 16 +/** +* 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 */ +}; +/** * The type of process in a linux, multi-process setup */
lib/librte_eal/include/rte_lcore.h +4 -0
@@ -11,7 +11,11 @@* API for lcore and socket manipulation * */ + +#include <stdio.h> +#include <rte_config.h> +#include <rte_common.h> #include <rte_per_lcore.h> #include <rte_eal.h> #include <rte_launch.h>
lib/librte_ethdev/rte_ethdev.c +1 -0
@@ -35,6 +35,7 @@#include <rte_spinlock.h> #include <rte_string_fns.h> #include <rte_kvargs.h> +#include <rte_bus.h> #include <rte_class.h> #include <rte_ether.h> #include <rte_telemetry.h>
lib/librte_pci/rte_pci.c +0 -1
@@ -13,7 +13,6 @@#include <rte_errno.h> #include <rte_interrupts.h> #include <rte_log.h> -#include <rte_bus.h> #include <rte_eal_paging.h> #include <rte_per_lcore.h> #include <rte_memory.h>
lib/librte_vhost/vhost_user.c +1 -0
@@ -44,6 +44,7 @@#include <rte_common.h> #include <rte_malloc.h> +#include <rte_dev.h> #include <rte_log.h> #include "iotlb.h"
Signature · 1 line
2.31.1
Quoted 8 lines · Thomas Monjalon
The file
rte_bus.hwas included in too many files.The enum
rte_iova_modeis moved fromrte_bus.htorte_eal.hbecause it is not specific to the bus layer.
It allows to clean-up more includes ofrte_bus.h.Some indirect includes had to be added in few files to compensate.
mingw compilation is broken.windows/eal.c needs rte_bus.h.
Quoted 12 lines
lib/librte_eal/include/rte_bus.h +0
-4@@ -28,20 +28,6 @@ extern "C" {TAILQ_HEAD (rte_bus_list, rte_bus); -/** -* IOVA mapping mode. -* -* IOVA mapping mode is iommu programming mode of a device.
lib/librte_eal/include/rte_bus.h extern "C" { · line 44
Quoted 10 lines
lib/librte_eal/include/rte_bus.h +0
-10-* 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 */ -}; -
Since you move rte_iova_mode to eal.h, but rte_bus.h still uses this enum, I would expect a #include <rte_eal.h> earlier in this same file.
check_includes does not catch this, so there is a path that leads to rte_eal.h inclusion, but I prefer an explicit include.
Quoted 3 lines
lib/librte_eal/include/rte_bus.h +0
-0/** * Bus specific scan for devices attached on the bus. * For each bus object, the scan would be responsible for finding devices and
Signature · 1 line
David Marchand