From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-wr0-f195.google.com (mail-wr0-f195.google.com [209.85.128.195]) by dpdk.org (Postfix) with ESMTP id C338E1B2B0 for ; Mon, 30 Oct 2017 17:37:12 +0100 (CET) Received: by mail-wr0-f195.google.com with SMTP id g90so13254048wrd.6 for ; Mon, 30 Oct 2017 09:37:12 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=6wind-com.20150623.gappssmtp.com; s=20150623; h=from:to:cc:subject:date:message-id:in-reply-to:references; bh=NEI+lXdXN5ftZqxIY5mT3FnFmPJZdtZ5nZT4AtJutBc=; b=lk06Tz5btQdsFzlPRcSR37u6TOLENfZbcN6fMaUowyxg2/kp1H5otdwvygv+QjlQQf Pr4AVpx2gjcxeoaNed0muSCj6I7ojMoegpSrw00PaJdF7nm2vU7dVdazK+SNwFl+Alax VsJGU1Wl5gxyvUABZpsp+6w0zG/uEZwllm4zkeO8qSsOGqWJORTkvkEz1xADmm2vQ8p9 pSRLj4VkznMsIRBTxBOt7cgKgsfX1ujw29G/qseSHIGSGASaunjr08tNk7DlJsU8BMGf tWFHGuUSZecPWdzh9OuOK3M8GwNTXN745eBjn01ADH8xY81nCgc+kfz0eu0R0PfRS/7K yq4g== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=NEI+lXdXN5ftZqxIY5mT3FnFmPJZdtZ5nZT4AtJutBc=; b=eTeQtomJ03HDar2xot5XxChZ1eEsi+N31Gd3dSFTdsbU2YgZAP25fUesU+XlG2qRVh ezuerS2rAGE1kWX35zp/SyjjIL0vO2ynYrO4Ds4Isp0Uf2w64+9lEszCOvu1bSzA/Y0C HRxfzzb+Y+iEzfa8+V1uZ6589/xVlYOdvai3hA6V5bHfhUPhOX/PWXMQwJEfFyAICHoW txj3sj3eTml/I0povgOSDXDlNCyymD8Z88a+9Hxpud9o7kmh84BTsbemSF+zUd2QFoUc X12SC98Y8BymekuvTGVoxCe2ab7muLGQdyDhDd3134FRwa3MkVWI9Qg8Pw/4OMarCsHg WRxw== X-Gm-Message-State: AMCzsaUpMMMxrx2yx6+SXeNdzZ1LCM3uw9tkRVFaEWgUJfPYzbeJ3oMS w4XkffDa6Ak0M7Ij5J5m6sJUAQFu X-Google-Smtp-Source: ABhQp+T2dY3//nuhxJfsqjDLIGoD6pJKHG3aEhffv+dI8XrOZXqAeupW+KQQ+nEYz3g7Gyh85tlcrQ== X-Received: by 10.223.184.36 with SMTP id h33mr8713368wrf.38.1509381431862; Mon, 30 Oct 2017 09:37:11 -0700 (PDT) Received: from bidouze.dev.6wind.com (host.78.145.23.62.rev.coltfrance.com. [62.23.145.78]) by smtp.gmail.com with ESMTPSA id 68sm3562196wmh.2.2017.10.30.09.37.10 (version=TLS1_2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Mon, 30 Oct 2017 09:37:10 -0700 (PDT) From: Gaetan Rivet To: dev@dpdk.org Cc: Jerin Jacob , Gaetan Rivet Date: Mon, 30 Oct 2017 17:36:52 +0100 Message-Id: <8492fe4cf1a8d6f15d389c9148e4942f1d060a40.1509381300.git.gaetan.rivet@6wind.com> X-Mailer: git-send-email 2.1.4 In-Reply-To: <3195804eda227dde6bb6d80122b2af25e071e1c1.1509367736.git.gaetan.rivet@6wind.com> References: <3195804eda227dde6bb6d80122b2af25e071e1c1.1509367736.git.gaetan.rivet@6wind.com> Subject: [dpdk-dev] [PATCH v3 1/2] bus/pci: fix vfio mode X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Mon, 30 Oct 2017 16:37:13 -0000 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. v3: - Fix build by include eal_vfio.h in pci_init.h and pci.c as well. drivers/bus/pci/linux/pci.c | 1 + drivers/bus/pci/linux/pci_init.h | 4 +++- drivers/bus/pci/linux/pci_vfio.c | 3 ++- 3 files changed, 6 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..3290cee 100644 --- a/drivers/bus/pci/linux/pci_init.h +++ b/drivers/bus/pci/linux/pci_init.h @@ -38,6 +38,8 @@ #include +#include "eal_vfio.h" + /** IO resource type: */ #define IORESOURCE_IO 0x00000100 #define IORESOURCE_MEM 0x00000200 @@ -74,7 +76,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..38d3792 100644 --- a/drivers/bus/pci/linux/pci_vfio.c +++ b/drivers/bus/pci/linux/pci_vfio.c @@ -48,6 +48,7 @@ #include #include "eal_filesystem.h" +#include "eal_vfio.h" #include "pci_init.h" #include "private.h" @@ -62,7 +63,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