net/bonding: use local prefix namespace
[dpdk.git] / lib / librte_eal / linuxapp / eal / eal_pci_init.h
index 6a960d1..99d7a2e 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
@@ -72,7 +74,17 @@ void pci_uio_ioport_write(struct rte_pci_ioport *p,
                          const void *data, size_t len, off_t offset);
 int pci_uio_ioport_unmap(struct rte_pci_ioport *p);
 
-#ifdef VFIO_PRESENT
+#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,
@@ -88,8 +100,11 @@ void pci_vfio_ioport_write(struct rte_pci_ioport *p,
                           const void *data, size_t len, off_t offset);
 int pci_vfio_ioport_unmap(struct rte_pci_ioport *p);
 
-/* map VFIO resource prototype */
+/* map/unmap VFIO resource prototype */
 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