From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-pa0-f43.google.com (mail-pa0-f43.google.com [209.85.220.43]) by dpdk.org (Postfix) with ESMTP id 580ED58EF for ; Fri, 10 Jul 2015 10:34:59 +0200 (CEST) Received: by pacgz10 with SMTP id gz10so91660806pac.3 for ; Fri, 10 Jul 2015 01:34:58 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:message-id:date:from:user-agent:mime-version:to :cc:subject:references:in-reply-to:content-type :content-transfer-encoding; bh=QjmSdTYmjJSEIhQjzUpvmibbfhny3K34ZRGtG5NQ+RU=; b=fBwaV/xOV3V/63I8xia7OTMP28l4+QiYNN1FCR7P7H1XGNNITTsgDPD1iAEBkvZKg2 ichF8DNS86pGF10cmYOF4Kog/OWGq5u8Y+8DRibECKJBAS9uQi1iTHKxe/m+WaZg0tpP l//dbBXgGC8ttPm/aqcdqHTETHeWd2mY/7udgyel9VVy/8LRIebbvk3cQp32XkDU4vQ9 xmIH3R7m8AKTBO88aPJIXXKu/lGjLD7EBAJsvFjQzRLA+kySaR9C6/P0V6D+h9COKAay gCQksDvBYpz6VhztKLov3BdTb/ZdtbdpUhJUGXjXTaFVskqkKxO53L3KYDFPoASoGNlO o3Bw== X-Gm-Message-State: ALoCoQmVBH9pdcur4Cl/njAKSzu0vscRCNs2ZkqSvYQxVkechPWVsd8dMRnKJuLJRmrIhDyxRBc+ X-Received: by 10.70.55.1 with SMTP id n1mr39328408pdp.21.1436517298734; Fri, 10 Jul 2015 01:34:58 -0700 (PDT) Received: from [163.138.142.176] ([163.138.142.176]) by smtp.googlemail.com with ESMTPSA id vz2sm8263208pbc.71.2015.07.10.01.34.56 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-GCM-SHA256 bits=128/128); Fri, 10 Jul 2015 01:34:58 -0700 (PDT) Message-ID: <559F83AE.4050409@igel.co.jp> Date: Fri, 10 Jul 2015 17:34:54 +0900 From: Tetsuya Mukawa User-Agent: Mozilla/5.0 (Windows NT 6.1; WOW64; rv:31.0) Gecko/20100101 Thunderbird/31.7.0 MIME-Version: 1.0 To: Michael Qiu , dev@dpdk.org References: <1436514439-4893-1-git-send-email-michael.qiu@intel.com> In-Reply-To: <1436514439-4893-1-git-send-email-michael.qiu@intel.com> Content-Type: text/plain; charset=iso-2022-jp Content-Transfer-Encoding: 7bit Subject: Re: [dpdk-dev] [PATCH] BugFix: VFIO never works X-BeenThere: dev@dpdk.org X-Mailman-Version: 2.1.15 Precedence: list List-Id: patches and discussions about DPDK List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Fri, 10 Jul 2015 08:34:59 -0000 On 2015/07/10 16:47, Michael Qiu wrote: > Commit 35b3313e322b ("pci: merge mapping functions for linux and bsd") > > introduced a bug that all vfio will be > blocked. > > Root cause is that VFIO_PRESENT is unaccessable in eal > common level. > > This patch is to fix this. > > Signed-off-by: Michael Qiu > --- > lib/librte_eal/common/eal_common_pci.c | 2 -- > lib/librte_eal/common/eal_private.h | 3 +++ > lib/librte_eal/linuxapp/eal/eal_pci_vfio.c | 10 ++++++++++ > 3 files changed, 13 insertions(+), 2 deletions(-) > > diff --git a/lib/librte_eal/common/eal_common_pci.c b/lib/librte_eal/common/eal_common_pci.c > index 3805aed..f3dc697 100644 > --- a/lib/librte_eal/common/eal_common_pci.c > +++ b/lib/librte_eal/common/eal_common_pci.c > @@ -146,10 +146,8 @@ pci_map_device(struct rte_pci_device *dev) > /* try mapping the NIC resources using VFIO if it exists */ > switch (dev->kdrv) { > case RTE_KDRV_VFIO: > -#ifdef VFIO_PRESENT > if (pci_vfio_is_enabled()) > ret = pci_vfio_map_resource(dev); > -#endif > break; > case RTE_KDRV_IGB_UIO: > case RTE_KDRV_UIO_GENERIC: > diff --git a/lib/librte_eal/common/eal_private.h b/lib/librte_eal/common/eal_private.h > index e16bb68..10995c3 100644 > --- a/lib/librte_eal/common/eal_private.h > +++ b/lib/librte_eal/common/eal_private.h > @@ -174,6 +174,9 @@ int pci_unbind_kernel_driver(struct rte_pci_device *dev); > */ > int pci_uio_map_resource(struct rte_pci_device *dev); > > +int pci_vfio_is_enabled(void); > + > +int pci_vfio_map_resource(struct rte_pci_device *dev); > /** > * Unmap the PCI resource of a PCI device > * > diff --git a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > index 426953a..3b5da34 100644 > --- a/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > +++ b/lib/librte_eal/linuxapp/eal/eal_pci_vfio.c > @@ -909,4 +909,14 @@ pci_vfio_is_enabled(void) > { > return vfio_cfg.vfio_enabled; > } > +#else > +int pci_vfio_is_enabled(void) > +{ > + return 0; > +} > + > +int pci_vfio_map_resource(__rte_unused struct rte_pci_device *dev) > +{ > + return -1; > +} > #endif Tested-by: Tetsuya Mukawa Acked-by: Tetsuya Mukawa Hi Michael, Thanks, I haven't checked it with vfio. I've make sure the patch works fine with vfio and pci_uio_generic. Regards, Tetsuya