From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from dpdk.org (dpdk.org [92.243.14.124]) by inbox.dpdk.org (Postfix) with ESMTP id 91072A10DA for ; Sat, 3 Aug 2019 20:22:17 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id AFF391BF1B; Sat, 3 Aug 2019 20:22:16 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 01EE31BF15 for ; Sat, 3 Aug 2019 20:22:14 +0200 (CEST) Received: from pps.filterd (m0045851.ppops.net [127.0.0.1]) by mx0b-0016f401.pphosted.com (8.16.0.42/8.16.0.42) with SMTP id x73ILAbh014653; Sat, 3 Aug 2019 11:22:14 -0700 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.com; h=from : to : cc : subject : date : message-id : references : in-reply-to : content-type : content-transfer-encoding : mime-version; s=pfpt0818; bh=6ODmFSczIpKKOgjg4Ks1iCQExelGBhraFfE/o5Mhcb4=; b=MUWOPj8ReIQRRFj9T2tuaFV21ODIwHO523v6q2DamC9MZ7siAo5A6fjJOqdllkCbq6mz 2I/oDRCCASUptr3hVARh7kMoHKEcsHBsZl+my2HbzTENZ8mpRCfOckSLwoKwBlmdQcUb TfLA6EveXbCQnN9iiQ7dK/7YH0fsSXG7kVAaSbahB84vIhbJFJisF7f1DHuibNt70QbB Yjfwa6t+CPIJ6I4C10pdwAPAeLB7dU+m4vtXkbJdMB45GHhdjbVDxo6YtxC+ptIvdBEz MrFEoBROoP1V/fFfsDvYDoeFAA2lfJDTN+UnM/yOSCDcKEqxPCwvHhE7OpkPeum4pBJ7 0A== Received: from sc-exch02.marvell.com ([199.233.58.182]) by mx0b-0016f401.pphosted.com with ESMTP id 2u59skgr80-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Sat, 03 Aug 2019 11:22:13 -0700 Received: from SC-EXCH02.marvell.com (10.93.176.82) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Sat, 3 Aug 2019 11:22:12 -0700 Received: from NAM02-SN1-obe.outbound.protection.outlook.com (104.47.36.57) by SC-EXCH02.marvell.com (10.93.176.82) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Sat, 3 Aug 2019 11:22:12 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=ZnEK6zz4WN67drqesOvIJV9oaqwoKxATkZsIa37hzs3lgRWHu6XWOtbxJhLKFs+aF/Sjca5flh7ffNvESjYh08EEBDJp8gquICN254FsnUoEVIESQ+t9liFYuXZbA6Wn1RFjR3Ote3PTs0myxKEXC+3Lcyg6dimtcPRa9V5L1U1vAjwH6vgkhaV6FkRc2L0Jw+ChYsPr0aJR4tg//QRiQI4WBTHe4NaA6anlUjvnUwXz9+ZnrlmtNEe/UvtVzqr64MF1u4LkECZ5eNQXa4RVwViqDlrTq7yXkWapQadepE7l7dvAzrwtq3PayqqQYCr9KIeznfGVqm01nVIsLwS/Ag== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector9901; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6ODmFSczIpKKOgjg4Ks1iCQExelGBhraFfE/o5Mhcb4=; b=UvBtxMZ53ArfpsZzJZFvaTOUQRPEJvnIi31J8uURNSfQY+lOf2n+EZMdMaaWmYTtrAKk9RnnbNYFj8VcCxqMw25hawycxDCsQ2fzTTYyW0dYAlc4L15O0P+1rar/GqezQ2I5FBfT/EZK4jICTn+RNJLKR+1rx/ZHaeW5c99vNq/AwKzjjl96JokSh7AYKOFLyyeLhLrSQOseHNABtxDwTfIl8h61U2gA5W4H4GanGLUDSZ5FOwGprTHvc204T5xoQZ9aIzcQFzg7bD13UCnEmtv6fwpc0iCPEq/mAkiHFCKdgknoNRevhLH9uBBNYzAujnqgUvJK9xAq+ySVkSExmQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1;spf=pass smtp.mailfrom=marvell.com;dmarc=pass action=none header.from=marvell.com;dkim=pass header.d=marvell.com;arc=none DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=marvell.onmicrosoft.com; s=selector2-marvell-onmicrosoft-com; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=6ODmFSczIpKKOgjg4Ks1iCQExelGBhraFfE/o5Mhcb4=; b=htnWNAuegXvaQ+RqmuMQNHWKB4mDviO/rTm+jl2lBY6rRwsmdJCKW21JdSATi/jTQOnBFbOXgKc9eXq8Q8wLSST97FgkYK9Ik3jantcqQ6vmKajmRcbvFwoV8ZzpuMZbGoU6fu7K/4VpD2yxOjNi+L3vQJEp3pRwHMXwQr31Lks= Received: from BYAPR18MB2424.namprd18.prod.outlook.com (20.179.91.149) by BYAPR18MB2663.namprd18.prod.outlook.com (20.179.94.86) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2136.16; Sat, 3 Aug 2019 18:22:10 +0000 Received: from BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::5877:72b7:40cf:2013]) by BYAPR18MB2424.namprd18.prod.outlook.com ([fe80::5877:72b7:40cf:2013%3]) with mapi id 15.20.2136.010; Sat, 3 Aug 2019 18:22:09 +0000 From: Jerin Jacob Kollanukkaran To: David Marchand , "dev@dpdk.org" CC: "anatoly.burakov@intel.com" , "tyos@jp.ibm.com" , "drc@linux.vnet.ibm.com" Thread-Topic: [dpdk-dev] [PATCH] bus/pci: always check IOMMU capabilities Thread-Index: AQHVSRseu72C6BxbME6Y17gX0OEYP6bpvXqg Date: Sat, 3 Aug 2019 18:22:09 +0000 Message-ID: References: <1564740872-27225-1-git-send-email-david.marchand@redhat.com> In-Reply-To: <1564740872-27225-1-git-send-email-david.marchand@redhat.com> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [171.61.87.186] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 71411dd8-903d-482a-0adf-08d7183f7fa7 x-microsoft-antispam: BCL:0; PCL:0; RULEID:(2390118)(7020095)(4652040)(8989299)(5600148)(711020)(4605104)(1401327)(4534185)(4627221)(201703031133081)(201702281549075)(8990200)(2017052603328)(7193020); SRVR:BYAPR18MB2663; x-ms-traffictypediagnostic: BYAPR18MB2663: x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0118CD8765 x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(396003)(136003)(376002)(366004)(346002)(39850400004)(199004)(189003)(13464003)(71190400001)(66476007)(74316002)(486006)(2501003)(66066001)(476003)(14454004)(7736002)(86362001)(256004)(4326008)(99286004)(7696005)(316002)(11346002)(446003)(6246003)(71200400001)(54906003)(53936002)(110136005)(81156014)(305945005)(6436002)(2906002)(26005)(52536014)(68736007)(25786009)(81166006)(186003)(8676002)(9686003)(55016002)(6506007)(53546011)(229853002)(66446008)(8936002)(102836004)(66946007)(66556008)(64756008)(76116006)(6116002)(3846002)(5660300002)(33656002)(478600001)(76176011); DIR:OUT; SFP:1101; SCL:1; SRVR:BYAPR18MB2663; H:BYAPR18MB2424.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; A:1; MX:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam-message-info: G1mLgO+0aXe3dTdniBxDibdOOQZpZyZRmh5B4M/SeTZ62IHB+oNz5zussU2lh7smrwVOiUB7t1jMOXyj5cUC2pBSQaE6SFHZ/WqFatTLXx/4JnooVpPfHLsSG0k8IVparN0AONCpzFTtffRvq+BkhR1+3Qh48w7TZwwsmuCPxtPi15SSYuh/8+dCvgsuzKctHbBVkgqUOv+JAK8hvskBazgUlNAP+LDWqyd4pvJMWaeqro1T98IcOQe2cOkEXzkKdeAUjfUWmFZ657UL4DFydNzoo2Vp5Aj9W066OQeBco+wUyo7ZxPapfUxcFA2FX6pzbuSQCPng4qgyjruwOcWHriEwor6W9cXFkiebJDb8PvDB8QyMfhM4ZMFQ/QJHbivFYCMe2LSJv7/XMGCRAxTLnPu7V4JdJ0sAEwKPOa7At4= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 71411dd8-903d-482a-0adf-08d7183f7fa7 X-MS-Exchange-CrossTenant-originalarrivaltime: 03 Aug 2019 18:22:09.8235 (UTC) X-MS-Exchange-CrossTenant-fromentityheader: Hosted X-MS-Exchange-CrossTenant-id: 70e1fb47-1155-421d-87fc-2e58f638b6e0 X-MS-Exchange-CrossTenant-mailboxtype: HOSTED X-MS-Exchange-CrossTenant-userprincipalname: jerinj@marvell.com X-MS-Exchange-Transport-CrossTenantHeadersStamped: BYAPR18MB2663 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:5.22.84,1.0.8 definitions=2019-08-03_09:2019-07-31,2019-08-03 signatures=0 Subject: Re: [dpdk-dev] [PATCH] bus/pci: always check IOMMU capabilities 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: , Errors-To: dev-bounces@dpdk.org Sender: "dev" > -----Original Message----- > From: dev On Behalf Of David Marchand > Sent: Friday, August 2, 2019 3:45 PM > To: dev@dpdk.org > Cc: anatoly.burakov@intel.com; tyos@jp.ibm.com; drc@linux.vnet.ibm.com > Subject: [dpdk-dev] [PATCH] bus/pci: always check IOMMU capabilities >=20 > IOMMU capabilities won't change and must be checked even if no PCI device > seem to be supported yet when EAL initialised. >=20 > This is to accommodate with SPDK that registers its drivers after > rte_eal_init(), especially on PPC platform where the IOMMU does not > support VA. >=20 > Fixes: 703458e19c16 ("bus/pci: consider only usable devices for IOVA mode= ") >=20 > Signed-off-by: David Marchand > --- > drivers/bus/pci/bsd/pci.c | 6 ++++++ > drivers/bus/pci/linux/pci.c | 25 ++++++------------------- > drivers/bus/pci/pci_common.c | 16 +++++++++++++++- > drivers/bus/pci/private.h | 5 ++++- > 4 files changed, 31 insertions(+), 21 deletions(-) >=20 > diff --git a/drivers/bus/pci/pci_common.c b/drivers/bus/pci/pci_common.c > index 9794552..8d1d6ab 100644 > --- a/drivers/bus/pci/pci_common.c > +++ b/drivers/bus/pci/pci_common.c > @@ -616,8 +616,16 @@ rte_pci_get_iommu_class(void) > const struct rte_pci_driver *drv; > bool devices_want_va =3D false; > bool devices_want_pa =3D false; > + static int iommu_no_va =3D -1; I think, "static" is not required in this context of rte_pci_get_iommu_clas= s() function. Not a big deal, Trying to avoid unnecessary global variable here. Either way, Acked-by: Jerin Jacob Tested-by: Jerin Jacob =20 > FOREACH_DEVICE_ON_PCIBUS(dev) { > + /* > + * We can check this only once, because the IOMMU > hardware is > + * the same for all of them. > + */ > + if (iommu_no_va =3D=3D -1) > + iommu_no_va =3D > pci_device_iommu_support_va(dev) > + ? 0 : 1; > if (pci_ignore_device(dev)) > continue; > if (dev->kdrv =3D=3D RTE_KDRV_UNKNOWN || > @@ -643,7 +651,13 @@ rte_pci_get_iommu_class(void) > devices_want_va =3D true; > } > }