From mboxrd@z Thu Jan 1 00:00:00 1970 From: Gaetan Rivet Subject: [PATCH v2 1/2] bus/pci: fix vfio mode Date: Mon, 30 Oct 2017 13:55:52 +0100 Message-ID: <3195804eda227dde6bb6d80122b2af25e071e1c1.1509367736.git.gaetan.rivet@6wind.com> References: <20171028062053.6615-1-jerin.jacob@caviumnetworks.com> Cc: Jerin Jacob , Gaetan Rivet To: dev@dpdk.org Return-path: Received: from mail-wm0-f65.google.com (mail-wm0-f65.google.com [74.125.82.65]) by dpdk.org (Postfix) with ESMTP id 0084E1B214 for ; Mon, 30 Oct 2017 13:56:13 +0100 (CET) Received: by mail-wm0-f65.google.com with SMTP id b9so16264391wmh.0 for ; Mon, 30 Oct 2017 05:56:13 -0700 (PDT) In-Reply-To: <20171028062053.6615-1-jerin.jacob@caviumnetworks.com> List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" From: Jerin Jacob Revert back to using VFIO_PRESENT as a marker to enable compilation of VFIO-related segments. Fixes: 279b581c897d ("vfio: expose functions") Signed-off-by: Jerin Jacob Signed-off-by: Gaetan Rivet --- In addition to simply re-defining VFIO_PRESENT, the previous #ifdef removed in favor of RTE_EAL_VFIO must be switched back as well. Not doing so would break compilation on kernels prior to 3.6. Additionally, the following patch adds a warning for users. This fix is left as-is, instead of a more involved solution like Ferruh's. The reasoning behind it is that it should be made abundantly clear that the VFIO_PRESENT symbol is defined in eal_vfio.h and eal_vfio.h only, that it is a private EAL symbol that is currently bleeding out of the EAL. It should be visible when those private symbols will be removed from libs external to the EAL. drivers/bus/pci/linux/pci.c | 1 + drivers/bus/pci/linux/pci_init.h | 2 +- drivers/bus/pci/linux/pci_vfio.c | 2 +- 3 files changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c index cdf8106..d0ce020 100644 --- a/drivers/bus/pci/linux/pci.c +++ b/drivers/bus/pci/linux/pci.c @@ -46,6 +46,7 @@ #include "eal_private.h" #include "eal_filesystem.h" +#include "eal_vfio.h" #include "private.h" #include "pci_init.h" diff --git a/drivers/bus/pci/linux/pci_init.h b/drivers/bus/pci/linux/pci_init.h index 99d7a2e..f342c47 100644 --- a/drivers/bus/pci/linux/pci_init.h +++ b/drivers/bus/pci/linux/pci_init.h @@ -74,7 +74,7 @@ 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 RTE_EAL_VFIO +#ifdef VFIO_PRESENT #if LINUX_VERSION_CODE < KERNEL_VERSION(3, 10, 0) #define RTE_PCI_MSIX_TABLE_BIR 0x7 diff --git a/drivers/bus/pci/linux/pci_vfio.c b/drivers/bus/pci/linux/pci_vfio.c index 360eed3..13d52a8 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -62,7 +62,7 @@ * This file is only compiled if CONFIG_RTE_EAL_VFIO is set to "y". */ -#ifdef RTE_EAL_VFIO +#ifdef VFIO_PRESENT #define PAGE_SIZE (sysconf(_SC_PAGESIZE)) #define PAGE_MASK (~(PAGE_SIZE - 1)) -- 2.1.4