These symbols are only relevant to PCI operations.
Move them to a private PCI-related header, allowing to remove the
dependency of the PCI subsystem upon private eal_vfio.h.
Signed-off-by: Gaetan Rivet <gaetan.rivet@6wind.com>
#ifndef EAL_PCI_INIT_H_
#define EAL_PCI_INIT_H_
+#include <linux/version.h>
+
#include <rte_vfio.h>
/** IO resource type: */
#ifdef RTE_EAL_VFIO
+#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
+#define RTE_PCI_MSIX_TABLE_BIR 0x7
+#define RTE_PCI_MSIX_TABLE_OFFSET 0xfffffff8
+#define RTE_PCI_MSIX_FLAGS_QSIZE 0x07ff
+#else
+#define RTE_PCI_MSIX_TABLE_BIR PCI_MSIX_TABLE_BIR
+#define RTE_PCI_MSIX_TABLE_OFFSET PCI_MSIX_TABLE_OFFSET
+#define RTE_PCI_MSIX_FLAGS_QSIZE PCI_MSIX_FLAGS_QSIZE
+#endif
+
/* access config space */
int pci_vfio_read_config(const struct rte_intr_handle *intr_handle,
void *buf, size_t len, off_t offs);
int pci_vfio_map_resource(struct rte_pci_device *dev);
int pci_vfio_unmap_resource(struct rte_pci_device *dev);
+int pci_vfio_is_enabled(void);
+
#endif
#endif /* EAL_PCI_INIT_H_ */
#include "eal_filesystem.h"
#include "eal_pci_init.h"
-#include "eal_vfio.h"
#include "eal_private.h"
/**
* This file is only compiled if CONFIG_RTE_EAL_VFIO is set to "y".
*/
-#ifdef VFIO_PRESENT
+#ifdef RTE_EAL_VFIO
#define PAGE_SIZE (sysconf(_SC_PAGESIZE))
#define PAGE_MASK (~(PAGE_SIZE - 1))
#if LINUX_VERSION_CODE >= KERNEL_VERSION(3, 6, 0)
#include <linux/vfio.h>
-#if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0)
-#define RTE_PCI_MSIX_TABLE_BIR 0x7
-#define RTE_PCI_MSIX_TABLE_OFFSET 0xfffffff8
-#define RTE_PCI_MSIX_FLAGS_QSIZE 0x07ff
-#else
-#define RTE_PCI_MSIX_TABLE_BIR PCI_MSIX_TABLE_BIR
-#define RTE_PCI_MSIX_TABLE_OFFSET PCI_MSIX_TABLE_OFFSET
-#define RTE_PCI_MSIX_FLAGS_QSIZE PCI_MSIX_FLAGS_QSIZE
-#endif
-
#define RTE_VFIO_TYPE1 VFIO_TYPE1_IOMMU
#ifndef VFIO_SPAPR_TCE_v2_IOMMU
int
clear_group(int vfio_group_fd);
-int pci_vfio_is_enabled(void);
-
int vfio_mp_sync_setup(void);
#define SOCKET_REQ_CONTAINER 0x100