New upstream version 17.11-rc3
[deb_dpdk.git] / drivers / bus / pci / linux / pci_init.h
similarity index 90%
rename from lib/librte_eal/linuxapp/eal/eal_pci_init.h
rename to drivers/bus/pci/linux/pci_init.h
index ae2980d..f342c47 100644 (file)
@@ -34,7 +34,9 @@
 #ifndef EAL_PCI_INIT_H_
 #define EAL_PCI_INIT_H_
 
-#include "eal_vfio.h"
+#include <linux/version.h>
+
+#include <rte_vfio.h>
 
 /** IO resource type: */
 #define IORESOURCE_IO         0x00000100
@@ -74,6 +76,16 @@ int pci_uio_ioport_unmap(struct rte_pci_ioport *p);
 
 #ifdef VFIO_PRESENT
 
+#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);
@@ -92,6 +104,8 @@ int pci_vfio_ioport_unmap(struct rte_pci_ioport *p);
 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_ */