From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jerin Jacob Subject: Re: [PATCH] pci/linux: use RTE_IOVA_VA whenever possible Date: Thu, 11 Oct 2018 10:47:12 +0000 Message-ID: <20181011104702.GA18152@jerin> References: <20180907145340.79670-1-dariusz.stojaczyk@intel.com> <93d12b45-d0a9-ab28-5ead-c3424067a062@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable Cc: Alejandro Lucero , "dariusz.stojaczyk@intel.com" , dev , "Shukla, Santosh" , Hemant Agrawal , Maxime Coquelin , "chas3@att.com" To: "Burakov, Anatoly" Return-path: Received: from NAM05-CO1-obe.outbound.protection.outlook.com (mail-eopbgr720052.outbound.protection.outlook.com [40.107.72.52]) by dpdk.org (Postfix) with ESMTP id D8C251B4E0 for ; Thu, 11 Oct 2018 12:47:14 +0200 (CEST) In-Reply-To: <93d12b45-d0a9-ab28-5ead-c3424067a062@intel.com> Content-Language: en-US Content-ID: <3CB39A4567E21F478FD4FA5C9F57C8B1@namprd07.prod.outlook.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" -----Original Message----- > Date: Thu, 11 Oct 2018 11:26:05 +0100 > From: "Burakov, Anatoly" > To: Alejandro Lucero , > dariusz.stojaczyk@intel.com > CC: dev , Santosh Shukla , > Hemant Agrawal , Jerin Jacob > , Maxime Coquelin > , chas3@att.com > Subject: Re: [dpdk-dev] [PATCH] pci/linux: use RTE_IOVA_VA whenever possi= ble > User-Agent: Mozilla/5.0 (Windows NT 10.0; WOW64; rv:52.0) Gecko/20100101 > Thunderbird/52.9.1 >=20 >=20 > On 11-Oct-18 11:00 AM, Alejandro Lucero wrote: > > On Fri, Sep 7, 2018 at 3:55 PM Darek Stojaczyk > > wrote: > >=20 > > > 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. > > >=20 > > > 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. > > >=20 > >=20 > > This is the opposite. Just one device not being able to use IOVA VA mak= es > > all to use IOVA PA. > >=20 > >=20 > > >=20 > > > 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. > > >=20 > > > Signed-off-by: Darek Stojaczyk > > > --- > > > drivers/bus/pci/linux/pci.c | 11 +++++------ > > > 1 file changed, 5 insertions(+), 6 deletions(-) > > >=20 > > > 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 =3D NULL; > > > struct rte_pci_driver *drv =3D NULL; > > > @@ -635,7 +635,7 @@ rte_pci_get_iommu_class(void) > > > { > > > bool is_bound; > > > bool is_vfio_noiommu_enabled =3D true; > > > - bool has_iova_va; > > > + bool want_iova_va; > > > bool is_bound_uio; > > > bool iommu_no_va; > > >=20 > > > @@ -643,7 +643,7 @@ rte_pci_get_iommu_class(void) > > > if (!is_bound) > > > return RTE_IOVA_DC; > > >=20 > > > - has_iova_va =3D pci_one_device_has_iova_va(); > > > + want_iova_va =3D pci_one_device_want_iova_va(); > > > is_bound_uio =3D pci_one_device_bound_uio(); > > > iommu_no_va =3D !pci_devices_iommu_support_va(); > > > #ifdef VFIO_PRESENT > > > @@ -651,11 +651,10 @@ rte_pci_get_iommu_class(void) > > > true : false; > > > #endif > > >=20 > > > - 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; > > >=20 > >=20 > > This is wrong. A device not able to work with IOVA VA will fail. > >=20 > >=20 > > >=20 > > > - 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 > > >=20 > > >=20 > >=20 >=20 > For these cases, i think the explicit IOVA mode on command line should > work better. If the device has not reported IOVA as VA capability, it is > to be assumed unsupported. Yes. >=20 > -- > Thanks, > Anatoly