summaryrefslogtreecommitdiff
diff options
context:
space:
mode:
authorSujith Sankar <ssujith@cisco.com>2014-11-27 22:44:40 +0530
committerThomas Monjalon <thomas.monjalon@6wind.com>2014-11-27 21:20:42 +0100
commit80083092aa44a0582d8705656a280f3aa7e53817 (patch)
treee099dc699c30e0ecf8d022c73f73e794b560da48
parentf97ae91fcbea16975fde288e1ca5d838c4015df4 (diff)
downloaddpdk-80083092aa44a0582d8705656a280f3aa7e53817.zip
dpdk-80083092aa44a0582d8705656a280f3aa7e53817.tar.gz
dpdk-80083092aa44a0582d8705656a280f3aa7e53817.tar.xz
enic: fix vfio inclusion
Inclusion of vfio.h was giving compilation errors if kernel version is less than 3.6.0 and if RTE_EAL_VFIO was in config. Removed inclusion of vfio.h and replaced RTE_EAL_VFIO with VFIO_PRESENT. Reported-by: Pawel Wodkowski <pawelx.wodkowski@intel.com> Signed-off-by: Sujith Sankar <ssujith@cisco.com> Acked-by: Thomas Monjalon <thomas.monjalon@6wind.com>
-rw-r--r--lib/librte_pmd_enic/enic_main.c13
1 files changed, 5 insertions, 8 deletions
diff --git a/lib/librte_pmd_enic/enic_main.c b/lib/librte_pmd_enic/enic_main.c
index 4b857bb..f6f00d3 100644
--- a/lib/librte_pmd_enic/enic_main.c
+++ b/lib/librte_pmd_enic/enic_main.c
@@ -39,9 +39,6 @@
#include <sys/mman.h>
#include <fcntl.h>
#include <libgen.h>
-#ifdef RTE_EAL_VFIO
-#include <linux/vfio.h>
-#endif
#include <rte_pci.h>
#include <rte_memzone.h>
@@ -631,7 +628,7 @@ int enic_enable(struct enic *enic)
vnic_dev_enable_wait(enic->vdev);
-#ifndef RTE_EAL_VFIO
+#ifndef VFIO_PRESENT
/* Register and enable error interrupt */
rte_intr_callback_register(&(enic->pdev->intr_handle),
enic_intr_handler, (void *)enic->rte_dev);
@@ -995,7 +992,7 @@ int enic_setup_finish(struct enic *enic)
return 0;
}
-#ifdef RTE_EAL_VFIO
+#ifdef VFIO_PRESENT
static void enic_eventfd_init(struct enic *enic)
{
enic->eventfd = enic->pdev->intr_handle.fd;
@@ -1033,7 +1030,7 @@ int enic_get_link_status(struct enic *enic)
}
-#ifdef RTE_EAL_VFIO
+#ifdef VFIO_PRESENT
static int enic_create_err_intr_thread(struct enic *enic)
{
pthread_attr_t intr_attr;
@@ -1111,7 +1108,7 @@ static void enic_dev_deinit(struct enic *enic)
if (eth_dev->data->mac_addrs)
rte_free(eth_dev->data->mac_addrs);
-#ifdef RTE_EAL_VFIO
+#ifdef VFIO_PRESENT
enic_clear_intr_mode(enic);
#endif
}
@@ -1167,7 +1164,7 @@ static int enic_dev_init(struct enic *enic)
*/
enic_get_res_counts(enic);
-#ifdef RTE_EAL_VFIO
+#ifdef VFIO_PRESENT
/* Set interrupt mode based on resource counts and system
* capabilities
*/