From mboxrd@z Thu Jan 1 00:00:00 1970 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) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=CAVIUMNETWORKS.onmicrosoft.com; s=selector1-cavium-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=ufLaBVUzpz/lzCFgNl5aLJF9x3A/iRFrIWmvsJ3DYOQ=; b=JthBMzBqKO0L0sMaQj/FxGRKzRw6hjDeDnndQrzh9oVk5fBnpdPjlyycRQqf5fbIboIOwqKK0n27QdYMZbBn8HLKscUI3EtQH+WMhnCg8bF/iKTKPi8Srs4+0owFSO01Ux/FgVxea5uc13BYIHdO6U/i8i0JEF5iQCcbbQ/3tRU= Received: from BYAPR07MB4997.namprd07.prod.outlook.com (52.135.238.214) by BYAPR07MB4935.namprd07.prod.outlook.com (52.135.237.96) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.1207.28; Thu, 11 Oct 2018 10:47:12 +0000 Received: from BYAPR07MB4997.namprd07.prod.outlook.com ([fe80::c5c:4d86:b353:175a]) by BYAPR07MB4997.namprd07.prod.outlook.com ([fe80::c5c:4d86:b353:175a%4]) with mapi id 15.20.1207.024; Thu, 11 Oct 2018 10:47:12 +0000 From: Jerin Jacob To: "Burakov, Anatoly" CC: Alejandro Lucero , "dariusz.stojaczyk@intel.com" , dev , "Shukla, Santosh" , Hemant Agrawal , Maxime Coquelin , "chas3@att.com" Thread-Topic: [dpdk-dev] [PATCH] pci/linux: use RTE_IOVA_VA whenever possible Thread-Index: AQHURrrZKw/2BM8r8k6Szerj62OXr6UaBOqAgAAHQoCAAAXcAA== 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> In-Reply-To: <93d12b45-d0a9-ab28-5ead-c3424067a062@intel.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [111.93.218.67] x-clientproxiedby: BYAPR02CA0057.namprd02.prod.outlook.com (2603:10b6:a03:54::34) To BYAPR07MB4997.namprd07.prod.outlook.com (2603:10b6:a03:5b::22) x-ms-exchange-messagesentrepresentingtype: 1 x-ms-publictraffictype: Email x-microsoft-exchange-diagnostics: 1; BYAPR07MB4935; 6:t0Umvgok9dnGnmu5lcDMHUZZpjVHxi/ydtUblqgFIQYb+kYg0QrLGIupTvpsDhcNS7BfzMcJXlFbV/nd185w7pL7qWp8A5Ivftjq2XZbszocEtYMQNeJKDxwwJxjaQgZdt6u7DI4GYhr/I1oUE5V38ZVKnkDK11uRk5lE3L0drxAx6AI1mok+KZWKM5xuDorchNoUQru589icKRx2+L4I9LKtifHMAVRwrGPkhUNFQRTqHQHPbpRTBt7jIOqWs0oRElIwFQFVc8PpmxAYaPknhvjUaka7mJf9KOjivyEL1p1FcKbAnPfZO3sEJ5yrng46xzsdUNdxs2tHdOCvaO87ruo/wA/7S7Sa14hNvzxuE/t9fgs+tiJJukJtqpUv6yKfKMzbCVFeH9nwx5yUUdoAYH3BAmrl1ecQdH0E0M+ezVNLXWuurxipujWqTL68QshCxxtBCHYHl9TlYhBGPFi2g==; 5:HvZQkXYL5DQQ5C0Aofb+xUlu7nxJwGYyT2VQty+A3YT2hFSh2uTtAFrltRFVoeajiCY/JqDSlDYCoxgxqA4+MAsDZ3lpSFAaJec7KDnA9o9Z9pNdT+tLhanx63zW5mrzsf0Gs/XSWnDe2jL4Ixx+Hkunsm2WouZTwstahLrzv+A=; 7:L/J8Qbi9We78dMNKZ87dyiU7e7RMg6XvILDG1PSnB21XTiPqEMr2Zs0Pvv1OKVZ9Wi/IwX5dhdndFRRwbrs68FpZJDlgOd/e0u3XwkpL0E15Y5X8WjOxGUi9IcDv9WZ+Oyj18gVsX7s4PEidiV4UmA/OHnl9T6McPdgnxz1UN12lHgjc0srCscEwuend7zfXXI/Y0OB32FG8a7fzF/r5ZileEgbohaZ2+z2/2Xt3Fph1H8Q/4+KSWomWfB5Mn/T6 x-ms-office365-filtering-correlation-id: e8d14251-ff8d-45a3-e7da-08d62f66e646 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(7020095)(4652040)(8989299)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(5600074)(711020)(2017052603328)(7153060)(7193020); SRVR:BYAPR07MB4935; x-ms-traffictypediagnostic: BYAPR07MB4935: authentication-results: spf=none (sender IP is ) smtp.mailfrom=Jerin.JacobKollanukkaran@cavium.com; x-microsoft-antispam-prvs: x-exchange-antispam-report-test: UriScan:(228905959029699)(97927398514766)(185117386973197); x-ms-exchange-senderadcheck: 1 x-exchange-antispam-report-cfa-test: BCL:0; PCL:0; RULEID:(8211001083)(6040522)(2401047)(8121501046)(5005006)(3002001)(3231355)(944501410)(52105095)(10201501046)(93006095)(149066)(150057)(6041310)(201703131423095)(201702281528075)(20161123555045)(201703061421075)(201703061406153)(20161123564045)(20161123560045)(20161123558120)(20161123562045)(201708071742011)(7699051)(76991055); SRVR:BYAPR07MB4935; BCL:0; PCL:0; RULEID:; SRVR:BYAPR07MB4935; x-forefront-prvs: 08220FA8D6 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(7916004)(346002)(136003)(376002)(396003)(366004)(39860400002)(199004)(189003)(13464003)(33656002)(53936002)(14444005)(5024004)(33716001)(256004)(68736007)(8936002)(229853002)(4326008)(9686003)(6512007)(386003)(8676002)(6506007)(105586002)(71190400001)(71200400001)(66066001)(39060400002)(53546011)(3846002)(7736002)(316002)(1076002)(2906002)(25786009)(81166006)(6246003)(81156014)(106356001)(6116002)(486006)(5660300001)(476003)(11346002)(446003)(42882007)(102836004)(186003)(26005)(33896004)(2900100001)(305945005)(54906003)(5250100002)(97736004)(52116002)(6916009)(72206003)(6436002)(478600001)(99286004)(6486002)(14454004)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR07MB4935; H:BYAPR07MB4997.namprd07.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: cavium.com does not designate permitted sender hosts) x-microsoft-antispam-message-info: KLIH7rULHtUf3Al4wNh+5qKeMqvlwzLhkkJnHna0EiddL8CgBoQCjs1MAe+oYhO1yRPhaMjHbbS0uuGzukvmo9lkur8bOLjNitvDRtYlZDLllRYjYbTv6xDDC+13NQe6Airi3TH3R+4xqyzHq8+caKc+SibkW8dnAPiEeoHYPmVC0P0YFEdbZx5M62N+H1K2waKhE4BKQ8KYvNY2NxrO7Mz1S+65KxruSsIMtmlg19/lcAvCY4n71eAJorlDJQqawoM37WJWCcar7QIBw5wA5TowKNZoHO1tFzv7cMQvQAWVxyrYDr1ACHIS4COsypzEsP8EMXDaCjLzrzWrzdLps07c8RIKie10l9hfVud211s= spamdiagnosticoutput: 1:99 spamdiagnosticmetadata: NSPM Content-Type: text/plain; charset="us-ascii" Content-ID: <3CB39A4567E21F478FD4FA5C9F57C8B1@namprd07.prod.outlook.com> Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-OriginatorOrg: caviumnetworks.com X-MS-Exchange-CrossTenant-Network-Message-Id: e8d14251-ff8d-45a3-e7da-08d62f66e646 X-MS-Exchange-CrossTenant-originalarrivaltime: 11 Oct 2018 10:47:12.3111 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 711e4ccf-2e9b-4bcf-a551-4094005b6194 X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR07MB4935 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:47:15 -0000 -----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