@@ -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>
@@ -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>
@@ -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.
*/
@@ -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;
@@ -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;
@@ -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 */
@@ -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"
@@ -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"
@@ -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>
new file mode 100644
@@ -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__ */
@@ -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.
*
@@ -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)
@@ -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)
@@ -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;
@@ -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) */
@@ -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"
@@ -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>
@@ -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", \
@@ -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
@@ -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>
@@ -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"
@@ -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>
@@ -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>
@@ -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>
@@ -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>
@@ -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>