On Wed, Apr 14, 2021 at 7:45 PM Thomas Monjalon <thomas@monjalon.net> wrote:
>
> 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.
mingw compilation is broken.
windows/eal.c needs rte_bus.h.
> diff --git a/lib/librte_eal/include/rte_bus.h b/lib/librte_eal/include/rte_bus.h
> index ebacc7adc3..f59a025955 100644
> --- a/lib/librte_eal/include/rte_bus.h
> +++ b/lib/librte_eal/include/rte_bus.h
> @@ -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 */
> -};
> -
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.
> /**
> * Bus specific scan for devices attached on the bus.
> * For each bus object, the scan would be responsible for finding devices and
@@ -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
@@ -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>
@@ -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>
@@ -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"
@@ -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>
@@ -15,7 +15,6 @@
extern "C" {
#endif /* __cplusplus */
-#include <rte_bus.h>
#include <rte_pci.h>
#include <rte_interrupts.h>
#include <rte_spinlock.h>
@@ -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>
@@ -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>
@@ -5,7 +5,6 @@
#include <string.h>
#include <rte_dev.h>
-#include <rte_bus.h>
#include <rte_kvargs.h>
#include <rte_errno.h>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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"
@@ -10,7 +10,6 @@
#endif
#include <rte_io.h>
-#include <rte_bus.h>
#include "virtio_pci.h"
#include "virtqueue.h"
@@ -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"
@@ -5,6 +5,7 @@
#include <rte_string_fns.h>
#include <rte_malloc.h>
+#include <rte_bus.h>
#include "failsafe_private.h"
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>
/**********************************************************/
@@ -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>
@@ -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"
@@ -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"
@@ -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
@@ -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
@@ -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
*/
@@ -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>
@@ -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>
@@ -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>
@@ -44,6 +44,7 @@
#include <rte_common.h>
#include <rte_malloc.h>
+#include <rte_dev.h>
#include <rte_log.h>
#include "iotlb.h"