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 5CEFBA3168 for ; Wed, 16 Oct 2019 13:26:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 68F8D1E936; Wed, 16 Oct 2019 13:26:09 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 5A2221E934 for ; Wed, 16 Oct 2019 13:26:08 +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 x9GBOOqQ029034; Wed, 16 Oct 2019 04:26:07 -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=gUqk7+OIUsHWzHpkTwYaIxFwzD25Yu9pnbRuRMElQ0E=; b=lxC/yQlpeC/7hfNvzFD4dg4ohpbPjAU+/X8mZPITIBxk4ACFYdsqfEz+Uj8xizPaoXM7 OzSYKNOZz+2eVweBc84zChlR30z0/beN97JnFUWXCOPSAkLk2CL92vl9IO0blbk/Sbap 1sxvCRriiockoH2QQTTmzZCCAlC3oynKPoFBjD6hKvegm8GOsaH5RFo+x9ce38TouXrb yNG42j6mYddVKUXvTgh9ooshMkvAKJLDsY1mhxSOzmUXBU6iKeQ0iCAmIgqMUi3PEh7r V+/YZap2g5aGhiRQjnj9TdmxDbpO61OpaS7JJ3vac2zE7q6VK972cAZisDFW80s1Vate fQ== Received: from sc-exch04.marvell.com ([199.233.58.184]) by mx0b-0016f401.pphosted.com with ESMTP id 2vkebp68j1-2 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 16 Oct 2019 04:26:06 -0700 Received: from SC-EXCH04.marvell.com (10.93.176.84) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 16 Oct 2019 04:26:05 -0700 Received: from NAM04-BN3-obe.outbound.protection.outlook.com (104.47.46.54) by SC-EXCH04.marvell.com (10.93.176.84) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 16 Oct 2019 04:26:05 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=TqnV1mlVmlH+Gw+zkxmj3qVLPKrSVd9uht8ONAjidRjyXHDfVCS2ZTjdtSu3+Yb4gsHNYjAVhZrh8BeqeStAEmMOmd/iCUBtSBDV0RMuPe9FhmG3m/pf7Q5LIkjrl8369GeEDrtEV8NW521wCyX49E0fhALJ8wAojs9zz2OZK2LGkmApvWGNKk0KwOUpLlgw/1Bzyj/9FGQcxynKxOlirD5C332EkBMtUTMkZ4TWyVwd6bZFrD78Z5qIMcbZB9Cdd/jEgzQonOv4VRHNayHTnVHGgxJlDzLZHIJ3hW5fNbStQJnUKJeZO9REIDDK7l/D09Pz0jTDzXFyB7yZH2mFgA== 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=gUqk7+OIUsHWzHpkTwYaIxFwzD25Yu9pnbRuRMElQ0E=; b=PKju5NRBhAZv9z9mAK4Vx7Fzceb+Lov6HhEy45uRCPOIv8MgRtqGJEl9PWD9G2282AXLtcePbr0Bxk2yJv4C/K9Gq0RBlJU768deqcUE/A0MCpvq+BgMieKDBS5CjwtkG9dLIHFC/VgejwaqgXvOxBxTSi6x1i+wy6Q1h3P29+dhmd6DJG5tuqXUdBUGNFCuR3J3cfBmfM/6blGAyBrJTfM/yY9zhg5w7Ed7MHnA3wMpKwVYr/kCx05RrCjL7XWmMpavWDxtAw8hHMV8pQBo293U1mDrwJiy6yzdeWlRATN5ofkNxpGa1yp7rU75gDLnZkHV7BDoK/xerwtq7nnhXA== 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=gUqk7+OIUsHWzHpkTwYaIxFwzD25Yu9pnbRuRMElQ0E=; b=PZUM5txjRXgr6DaNPa22cN5Ko+hfJkEg8ovMJN6yDE5OFUtTEljx/xss3+QHLmqfpM43+Z9AvFcLDsXQfKUkhO+dpXtEvOasfzmwQf/+UHzaAjSa9Moejut9dXXv4oSAQdtMjwqkagjKRUtYrapicXjMarpOlN00yZXPaiHFfr4= Received: from MWHPR18MB1645.namprd18.prod.outlook.com (10.173.241.137) by MWHPR18MB1423.namprd18.prod.outlook.com (10.175.4.21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.2347.16; Wed, 16 Oct 2019 11:26:03 +0000 Received: from MWHPR18MB1645.namprd18.prod.outlook.com ([fe80::b4fd:71ce:2bc4:7afb]) by MWHPR18MB1645.namprd18.prod.outlook.com ([fe80::b4fd:71ce:2bc4:7afb%3]) with mapi id 15.20.2347.023; Wed, 16 Oct 2019 11:26:02 +0000 From: Vamsi Krishna Attunuru To: Stephen Hemminger , "Yigit, Ferruh" CC: "dev@dpdk.org" , "thomas@monjalon.net" , Jerin Jacob Kollanukkaran , "olivier.matz@6wind.com" , "ferruh.yigit@intel.com" , "anatoly.burakov@intel.com" , "arybchenko@solarflare.com" , Kiran Kumar Kokkilagadda Thread-Topic: [EXT] Re: [dpdk-dev] [PATCH v10 4/5] kni: add IOVA=VA support in KNI module Thread-Index: AQHVU/nAFbT0g8FKgU+Tsc8qDUNcOadcNogAgAAA0ICAAUXIEA== Date: Wed, 16 Oct 2019 11:26:02 +0000 Message-ID: References: <20190729121313.30639-2-vattunuru@marvell.com> <20190816061252.17214-1-vattunuru@marvell.com> <20190816061252.17214-5-vattunuru@marvell.com> <20191015084603.3b0f141f@hermes.lan> In-Reply-To: <20191015084603.3b0f141f@hermes.lan> Accept-Language: en-US Content-Language: en-US X-MS-Has-Attach: X-MS-TNEF-Correlator: x-originating-ip: [14.140.231.66] x-ms-publictraffictype: Email x-ms-office365-filtering-correlation-id: 82658ed8-023b-445b-b2db-08d7522ba08b x-ms-traffictypediagnostic: MWHPR18MB1423: x-ms-exchange-transport-forked: True x-microsoft-antispam-prvs: x-ms-oob-tlc-oobclassifiers: OLM:7691; x-forefront-prvs: 0192E812EC x-forefront-antispam-report: SFV:NSPM; SFS:(10009020)(4636009)(366004)(346002)(136003)(396003)(39860400002)(376002)(189003)(199004)(13464003)(7696005)(9686003)(26005)(7736002)(186003)(33656002)(99286004)(8936002)(54906003)(25786009)(6506007)(2906002)(76176011)(229853002)(53546011)(55016002)(6436002)(55236004)(102836004)(4326008)(71200400001)(81166006)(107886003)(11346002)(256004)(8676002)(478600001)(81156014)(74316002)(66556008)(446003)(305945005)(71190400001)(52536014)(66446008)(110136005)(64756008)(316002)(76116006)(66066001)(86362001)(5660300002)(14454004)(6116002)(66476007)(3846002)(476003)(486006)(66946007)(6246003); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR18MB1423; H:MWHPR18MB1645.namprd18.prod.outlook.com; FPR:; SPF:None; LANG:en; PTR:InfoNoRecords; MX:1; A:1; received-spf: None (protection.outlook.com: marvell.com does not designate permitted sender hosts) x-ms-exchange-senderadcheck: 1 x-microsoft-antispam: BCL:0; x-microsoft-antispam-message-info: mgTnOmEFbwCuNKgdME5t0DOFe9QDkQPIUh1UF+6XG/6GvRV61weCriy5jGv0qq8Vznu3lTiwGsuuTlihmeuOCcm8qRuzxLY0U598iHu4ofEkAIDNr+GPtJufQLrkW5Dg3QI61psNvnZaWFbUb1h50vOnQEaafxy8Y/KVh7v4XbaF4RqN1ZxyM57pU2NRVoYMn7ZpsriQcc27HBqazM5FWeLLPX/8C2LwcxwcpGakJ12GEoWj6AMacfzgkPoNz2rai7VdBVX6+5rdT282kVGnV9eFPnjrARg0D7ky31xzw2i0UuRhj6wvJPZi5XHFaVBQzRyvDUKgMVFhaS9DWqaxbAT/QhAb2mMFeqknV5ULRBF+H2B0htH6+e+3eYHvW2X/zLsgnZeRzrToseHbbnmGYZKvRK6Rz4FeI3P3DeDjCrA= Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 82658ed8-023b-445b-b2db-08d7522ba08b X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Oct 2019 11:26:02.4776 (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: xu/Iawutjzyr+Qq0RKTxVdDIILp/8MK6IH6yClwtkJbYgIKyPUo0gpPWWyz4cInHkLdXh2xXDzq7LwhMHFIJWQ== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR18MB1423 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-16_04:2019-10-16,2019-10-16 signatures=0 Subject: Re: [dpdk-dev] [EXT] Re: [PATCH v10 4/5] kni: add IOVA=VA support in KNI module 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: Stephen Hemminger > Sent: Tuesday, October 15, 2019 9:16 PM > To: Yigit, Ferruh > Cc: Vamsi Krishna Attunuru ; dev@dpdk.org; > thomas@monjalon.net; Jerin Jacob Kollanukkaran ; > olivier.matz@6wind.com; ferruh.yigit@intel.com; anatoly.burakov@intel.com= ; > arybchenko@solarflare.com; Kiran Kumar Kokkilagadda > > Subject: [EXT] Re: [dpdk-dev] [PATCH v10 4/5] kni: add IOVA=3DVA support = in KNI > module >=20 > External Email >=20 > ---------------------------------------------------------------------- > On Tue, 15 Oct 2019 16:43:08 +0100 > "Yigit, Ferruh" wrote: >=20 > > On 8/16/2019 7:12 AM, vattunuru@marvell.com wrote: > > > From: Kiran Kumar K > > > > > > Patch adds support for kernel module to work in IOVA =3D VA mode, the > > > idea is to get physical address from IOVA address using > > > iommu_iova_to_phys API and later use phys_to_virt API to convert the > > > physical address to kernel virtual address. > > > > > > When compared with IOVA =3D PA mode, there is no performance drop wit= h > > > this approach. > > > > > > This approach does not work with the kernel versions less than 4.4.0 > > > because of API compatibility issues. > > > > > > Patch also updates these support details in KNI documentation. > > > > > > Signed-off-by: Kiran Kumar K > > > Signed-off-by: Vamsi Attunuru > > > > <...> > > > > > @@ -348,15 +351,65 @@ kni_ioctl_create(struct net *net, uint32_t > ioctl_num, > > > strncpy(kni->name, dev_info.name, RTE_KNI_NAMESIZE); > > > > > > /* Translate user space info into kernel space info */ > > > - kni->tx_q =3D phys_to_virt(dev_info.tx_phys); > > > - kni->rx_q =3D phys_to_virt(dev_info.rx_phys); > > > - kni->alloc_q =3D phys_to_virt(dev_info.alloc_phys); > > > - kni->free_q =3D phys_to_virt(dev_info.free_phys); > > > - > > > - kni->req_q =3D phys_to_virt(dev_info.req_phys); > > > - kni->resp_q =3D phys_to_virt(dev_info.resp_phys); > > > - kni->sync_va =3D dev_info.sync_va; > > > - kni->sync_kva =3D phys_to_virt(dev_info.sync_phys); > > > + if (dev_info.iova_mode) { > > > +#ifdef HAVE_IOVA_AS_VA_SUPPORT > > > + pci =3D pci_get_device(dev_info.vendor_id, > > > + dev_info.device_id, NULL); > > > + if (pci =3D=3D NULL) { > > > + pr_err("pci dev does not exist\n"); > > > + return -ENODEV; > > > + } > > > > If there is no PCI device KNI should still work. >=20 > Right now it is possible to use KNI with netvsc PMD on Hyper-V/Azure. > With this patch that won't be possible. Hi Ferruh, Stephen, These can be fixed by forcing iommu_mode as PA when vdevs are used for KNI usecase. rte_bus_get_iommu_class(void) { enum rte_iova_mode mode =3D RTE_IOVA_DC; + struct rte_devargs *devargs =3D NULL; bool buses_want_va =3D false; bool buses_want_pa =3D false; struct rte_bus *bus; + if (rte_eal_check_module("rte_kni") =3D=3D 1) { + RTE_EAL_DEVARGS_FOREACH("vdev", devargs) { + return RTE_IOVA_PA; + } + } + TAILQ_FOREACH(bus, &rte_bus_list, next) { enum rte_iova_mode bus_iova_mode; I think this will solve various use cases/combinations like PA or VA mode, = pdev or vdev used for KNI. Existing use cases would not be affected by these patch series with above f= ix.