From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mail-ed1-f65.google.com (mail-ed1-f65.google.com [209.85.208.65]) by dpdk.org (Postfix) with ESMTP id 546B31B1EF for ; Thu, 11 Oct 2018 12:00:19 +0200 (CEST) Received: by mail-ed1-f65.google.com with SMTP id r1-v6so7681968edd.7 for ; Thu, 11 Oct 2018 03:00:19 -0700 (PDT) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=netronome-com.20150623.gappssmtp.com; s=20150623; h=mime-version:references:in-reply-to:from:date:message-id:subject:to :cc; bh=r7iDKUT+3WUZRl/wcgRm7PmsMd1QgfbM/Wx8WDAMIIQ=; b=bGvH092DiN54bJQzbKKFFBwANuHO4uboCIJmBoAOT1ki7yR7HekgFLt8aMwu+ly9Ij Wp8ZhpBqlKBkFJAg0WKxFnRqyOVqzQDks0+9olKrvt2KK76oYiVmVDZS5YKK3QWq5ZD2 MBBO2K2kksrnpLlXhT4BhH/GJ5JQS9QRjSg61KlPoiM0afaeSQUZr+Vpo0QdAO7v0llP Chrx+iSaNFmDR+i5q+paU7Vu2t1673g360EBqYR16HCDgakPOJ5x4w2hxJp6ea1Sy7LA 2IbIW+rX3VrT1ehTXN6wyrUuUZSWRWAQPYJK56lI9xlvv0ZhBlTD+Iz5Q/kpsoDJmX1R 3+3A== X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20161025; h=x-gm-message-state:mime-version:references:in-reply-to:from:date :message-id:subject:to:cc; bh=r7iDKUT+3WUZRl/wcgRm7PmsMd1QgfbM/Wx8WDAMIIQ=; b=KwWT3N1MxNvjwCEAknXHWhfvxaMcRBG/8kfw32lkDR0FmtmK2D9hGJFVjqJZhK//ex Ss2WeY59iuTFyG2n2SkyogoWxgcNXGLL2vCeWlzybyCz8WXT/rx6GANUN/oyo5cg9G84 olNk1+aK0rIIzB9sIlJIdiRhplu51764EcPAxGdafUvp+VmMyw11WfY2arTztbkmxllb Q0mcySfPkArA3+5oLptD8bPh2afU2eBCxMzCZrVRIzG9tuMTI8tOp3QMU6E/OVhW0jA+ paG5nucPnCqNnFYtaxTZc2r5atKHFpduy5qbRcZhF3jhTN/f63LEtswaPcV08xQVax8n /wuQ== X-Gm-Message-State: ABuFfoj4L3b5nSjeYXj63xftcPMOoQ5Dc6VDx5Kva9NlfBlbJ2PupFv3 t2OhfMDwwWVlnzHmQSFaWKx/xVyi9V/n8th9vN6R4g== X-Google-Smtp-Source: ACcGV61HcNR1OTkxN4E8NinndhJHvoeYSvI3Sj162fI6oNiC4L9FcuZIEYoXXPWQY/u/5t8Pl5699G/5HBAXmf7D+GQ= X-Received: by 2002:a50:a564:: with SMTP id z33-v6mr1701660edb.166.1539252018989; Thu, 11 Oct 2018 03:00:18 -0700 (PDT) MIME-Version: 1.0 References: <20180907145340.79670-1-dariusz.stojaczyk@intel.com> In-Reply-To: <20180907145340.79670-1-dariusz.stojaczyk@intel.com> From: Alejandro Lucero Date: Thu, 11 Oct 2018 11:00:07 +0100 Message-ID: To: dariusz.stojaczyk@intel.com Cc: dev , Santosh Shukla , Hemant Agrawal , Jerin Jacob , Maxime Coquelin , "Burakov, Anatoly" , chas3@att.com Content-Type: text/plain; charset="UTF-8" X-Content-Filtered-By: Mailman/MimeDel 2.1.15 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 10:00:19 -0000 On Fri, Sep 7, 2018 at 3:55 PM Darek Stojaczyk wrote: > 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 is the opposite. Just one device not being able to use IOVA VA makes all to use IOVA PA. > > 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; > This is wrong. A device not able to work with IOVA VA will fail. > > - 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"); > -- > 2.17.1 > >