From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out3-smtp.messagingengine.com (out3-smtp.messagingengine.com [66.111.4.27]) by dpdk.org (Postfix) with ESMTP id 250BE1B1EF for ; Thu, 11 Oct 2018 11:48:48 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id A74E021F32; Thu, 11 Oct 2018 05:48:47 -0400 (EDT) Received: from mailfrontend2 ([10.202.2.163]) by compute1.internal (MEProxy); Thu, 11 Oct 2018 05:48:47 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=7kDu/1cisOwrvCZJ68h6nOxN/gYcKrE5+R5nkRwkhso=; b=C9RJRJfRIWtC 3UxjTvTJ4YbgMOolQa3zSeSGQP/07McFfaE2eDg1s6cCf9FOuvgIOOSgCgLA7rjl e6zlBErQj2nM9u9ImDDXSvfWg879ePTN/ofTRZ0sCTJNUnW3lRwaB4ZamquAmrGa TXEwkBvHdy/A+7f2DbZ8h/laPM9u0E4= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm1; bh=7kDu/1cisOwrvCZJ68h6nOxN/gYcKrE5+R5nkRwkh so=; b=t1hC+W+qNalnrsJSGTXx6ejt80vU/fEk180JUP1wFcKCE9Jr8yVwj3BfI jQcNfk1PcYQPEHOb4JdBlYfcf6/5tl4aTZq5d9KthzrgUPygNfQ93O7JvB4ji+TU /ctfxZHMNovmYF0T7Bfqchms8xlr547i0zg2S7cH/HBLq54GzOIMOu0barrjdRgp eu7pnUhTogFDEvG19hVPECncStqg971yGp+1eNxN4MDyhcILE8o2CBjmVCj+kBg6 MpzqSxkUbaIX+NPgCKS2yctSiZINxPv/4ms26rsBlBBtoJEau9xYc6tLFcsfT0HD cbO6+vth+CcBs8h0G9xvrdIJ7j/ow== X-ME-Sender: X-ME-Proxy: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 237DF102A0; Thu, 11 Oct 2018 05:48:45 -0400 (EDT) From: Thomas Monjalon To: dev@dpdk.org Cc: Darek Stojaczyk , Santosh Shukla , Hemant Agrawal , Jerin Jacob , Maxime Coquelin , Anatoly Burakov , Chas Williams , gaetan.rivet@6wind.com, stephen@networkplumber.org, ferruh.yigit@intel.com, arybchenko@solarflare.com Date: Thu, 11 Oct 2018 11:48:44 +0200 Message-ID: <7239766.tk8ES4I1iR@xps> In-Reply-To: <20180907145340.79670-1-dariusz.stojaczyk@intel.com> References: <20180907145340.79670-1-dariusz.stojaczyk@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH] pci/linux: use RTE_IOVA_VA whenever possible 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: Thu, 11 Oct 2018 09:48:48 -0000 Someone to review this patch please? 07/09/2018 16:53, Darek Stojaczyk: > This allows DPDK to use RTE_IOVA_VA with VFIO/UIO-bound PCI > devices present on the system, but not attached to any > rte_pci_driver at the time of init. > > So far we used RTE_IOVA_VA whenever there was at least one > device attached to a driver with an RTE_PCI_DRV_IOVA_AS_VA flag, > meaning that other drivers which didn't explicitly report such > flag could have been forced to work in RTE_IOVA_VA as well. > > This patch makes the RTE_PCI_DRV_IOVA_AS_VA explicitly a hint. > If it's set, but RTE_IOVA_VA cannot be used, then EAL will print > a proper warning. > > Signed-off-by: Darek Stojaczyk > --- > drivers/bus/pci/linux/pci.c | 11 +++++------ > 1 file changed, 5 insertions(+), 6 deletions(-) > > diff --git a/drivers/bus/pci/linux/pci.c b/drivers/bus/pci/linux/pci.c > index 04648ac93..961e24024 100644 > --- a/drivers/bus/pci/linux/pci.c > +++ b/drivers/bus/pci/linux/pci.c > @@ -534,7 +534,7 @@ pci_one_device_bound_uio(void) > * Any one of the device has iova as va > */ > static inline int > -pci_one_device_has_iova_va(void) > +pci_one_device_want_iova_va(void) > { > struct rte_pci_device *dev = NULL; > struct rte_pci_driver *drv = NULL; > @@ -635,7 +635,7 @@ rte_pci_get_iommu_class(void) > { > bool is_bound; > bool is_vfio_noiommu_enabled = true; > - bool has_iova_va; > + bool want_iova_va; > bool is_bound_uio; > bool iommu_no_va; > > @@ -643,7 +643,7 @@ rte_pci_get_iommu_class(void) > if (!is_bound) > return RTE_IOVA_DC; > > - has_iova_va = pci_one_device_has_iova_va(); > + want_iova_va = pci_one_device_want_iova_va(); > is_bound_uio = pci_one_device_bound_uio(); > iommu_no_va = !pci_devices_iommu_support_va(); > #ifdef VFIO_PRESENT > @@ -651,11 +651,10 @@ rte_pci_get_iommu_class(void) > true : false; > #endif > > - if (has_iova_va && !is_bound_uio && !is_vfio_noiommu_enabled && > - !iommu_no_va) > + if (!is_bound_uio && !is_vfio_noiommu_enabled && !iommu_no_va) > return RTE_IOVA_VA; > > - if (has_iova_va) { > + if (want_iova_va) { > RTE_LOG(WARNING, EAL, "Some devices want iova as va but pa will be used because.. "); > if (is_vfio_noiommu_enabled) > RTE_LOG(WARNING, EAL, "vfio-noiommu mode configured\n"); >