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 082D9A3168 for ; Wed, 16 Oct 2019 16:37:49 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id 612B91E883; Wed, 16 Oct 2019 16:37:48 +0200 (CEST) Received: from mx0b-0016f401.pphosted.com (mx0b-0016f401.pphosted.com [67.231.156.173]) by dpdk.org (Postfix) with ESMTP id 308011E87C for ; Wed, 16 Oct 2019 16:37:47 +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 x9GEZh21003850; Wed, 16 Oct 2019 07:37:46 -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=YomR6izUVw8DFyeZfQqNw8ymSbZ2sZ45GnO7AIxo2/A=; b=Ch7fNy4+snw2l9KrL+/LUgdMjwpau9Xn5YQ8krohPv5tBwnrlC3xxYaLuVGtJKCEGgcA mUqI9A8lYLCfa5c2Qdn1JlcDW2bhmS697Y5cgl80TtYTQhXimbghxk9RcfRooWhOIMmH IMMVbQaacZnntoKCYR/Kzc2cF3Fw7Xzee8Gr1/VJABINSS0sFH77son/4KuFHQBqC1bS nxwkSYlBHeFXOrmg0Z7XAvF6KdETZ+XdP5zhctY5XIBiKuTAtFlO/wyqHANL9lW+Das+ dwZLVNk/vtCqD5imYpMeLh/wtsfRqV1BjROqbv4UnbwGyJHqghVrVmGXrxLdtDw2qgy3 Lg== Received: from sc-exch03.marvell.com ([199.233.58.183]) by mx0b-0016f401.pphosted.com with ESMTP id 2vkebp6xj3-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-SHA384 bits=256 verify=NOT); Wed, 16 Oct 2019 07:37:45 -0700 Received: from SC-EXCH03.marvell.com (10.93.176.83) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3; Wed, 16 Oct 2019 07:37:44 -0700 Received: from NAM03-DM3-obe.outbound.protection.outlook.com (104.47.41.50) by SC-EXCH03.marvell.com (10.93.176.83) with Microsoft SMTP Server (TLS) id 15.0.1367.3 via Frontend Transport; Wed, 16 Oct 2019 07:37:44 -0700 ARC-Seal: i=1; a=rsa-sha256; s=arcselector9901; d=microsoft.com; cv=none; b=bAhri1ObWsBkzbEnBw4Dli39q5NNzDF/1GL7zfX8O/E/g7wTabQA1isdsu/gleSG0yafULCpsoxWgyJdfJshoFkhdYYQ/vokeDEmNKhaal8AthfOuHGtjwB27Po7PNN19TrGD4FvBpNZ3NNzrogWdtW0halhCH9ju93/vaNxFhgUrjneRDXe+X8uH0okyRMndzn3eqs0zhDsfnHfNaKbC3Qoxk3U+BDsFolt/xg2Fz5Toj9nnPpB8QmoS+PkKR3nJdw4Pf5Uj7T4uMggyRb0dcmHqU+knDQs9Nm2BWZz+MsQdo9kTajW+0mLIHxR2gC82yQp2ilt9/YfkMgsnsNsdQ== 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=YomR6izUVw8DFyeZfQqNw8ymSbZ2sZ45GnO7AIxo2/A=; b=HocpvxRxoKDgiS5hHBs+nzMpL4SoDz3JjJ86owaYjRBHfEERxp+bgBb0cdO/HlGFgxq6EzQA1w8E2Tig2NJ4b6Bv9EKNtlG7EI7YdsG0bonKPq1MOASjck/duiNxsGFMueFeXIF82Tw1bimpRwHZw6Q8wazjRuqCXK9IEaWBoxF16IRtX8s3ksjB43av88Ha3k7tNucQQXyxpJFDoVtPuLglmALGGnKTtc1qLZYn9NycrcjgyLSF7q6Qf3tpXzrRVJBaQLlPxuWXr8vpous4BKhhkClSA4aoz+EYtCayWkQBCla3dUZj7BGVwXiyuA5SAdmtvzCnz6SEST8hp972og== 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=YomR6izUVw8DFyeZfQqNw8ymSbZ2sZ45GnO7AIxo2/A=; b=Q/ahqNFBiDa23+HhALULgdV609VT1ZM03Jl7osSyO+wn/Bz40UHCQ4Vcs43bc0l3YKtiN6xlQEGVmpEt21fmc7nCUgvBwvs9PQNBlipw7BWecLQX8zIYeDZfJSaPd+yIAljUC1GvurJ3az2J+p7lqdoDri14b7Ocey7vmJ0v2gA= Received: from MWHPR18MB1645.namprd18.prod.outlook.com (10.173.241.137) by MWHPR18MB1246.namprd18.prod.outlook.com (10.175.6.149) 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 14:37:42 +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 14:37:41 +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+Tsc8qDUNcOadcNogAgAAA0ICAAUXIEIAAN3lg Date: Wed, 16 Oct 2019 14:37:41 +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: 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: 4e9d16de-ea99-430f-67ab-08d7524666aa x-ms-traffictypediagnostic: MWHPR18MB1246: x-ms-exchange-purlcount: 1 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)(396003)(376002)(366004)(346002)(136003)(39860400002)(189003)(199004)(13464003)(107886003)(4326008)(305945005)(446003)(6246003)(478600001)(966005)(229853002)(7736002)(55016002)(3846002)(9686003)(6116002)(6306002)(74316002)(81166006)(8936002)(2940100002)(86362001)(6436002)(8676002)(81156014)(486006)(11346002)(256004)(71190400001)(71200400001)(476003)(2906002)(102836004)(7696005)(66556008)(64756008)(76116006)(66476007)(54906003)(52536014)(99286004)(5660300002)(66446008)(33656002)(66946007)(316002)(25786009)(66066001)(14454004)(76176011)(110136005)(26005)(53546011)(186003)(6506007)(55236004); DIR:OUT; SFP:1101; SCL:1; SRVR:MWHPR18MB1246; 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: zgheKEJ6a7HKVaaYqGtUZHTXn4S8kfu5UGf+QnppmnU382Qku8beQRaKuo6lt3ToOkEAgzZP57pKNvnmBhdTdQcKvjQcfRjOWi/8Wzy9ez8sKrNrYBABo+HoroM7HLqAR1B51LkMAkzm3u3hHBf7TbPbjeEhhc6p0Ksqp+0T5Oq4dqHDfXHjCaucGaY/FPt7kObN2TPUFEAvdWLwyiSLiztg4x0srMISwpT8JPwBLtqwI1NRR4kIG+9qZEm8se6gpH379UXcsJLuepATEYg77m2pD3o+9CXuiUv4Utb3fU+r3hiDVi7bWlsv70q567maxIizZsZ14JrI0DPDgTOdCTEzysaCTd/K116Ab2PzLK64TFi0SxJBu/EqBVlwsva36+TJfCBJHlxaNbxScKbMbMWu7/bimfxG4xAmgADyINuncEfBRu7jXB9dnh5AirV2kJZtFYF4vCHlZN9/LBki/A== Content-Type: text/plain; charset="us-ascii" Content-Transfer-Encoding: quoted-printable MIME-Version: 1.0 X-MS-Exchange-CrossTenant-Network-Message-Id: 4e9d16de-ea99-430f-67ab-08d7524666aa X-MS-Exchange-CrossTenant-originalarrivaltime: 16 Oct 2019 14:37:41.7657 (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: bT/Z3aHR8qQFZYZ5jlXAO0PWJIThI7ZHJLCBTbBrnuOWKfalGNWo3I99lyeVAiU8lZ/19ymmlTuybMl5TlD1Xg== X-MS-Exchange-Transport-CrossTenantHeadersStamped: MWHPR18MB1246 X-OriginatorOrg: marvell.com X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:6.0.95,1.0.8 definitions=2019-10-16_06: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: Vamsi Krishna Attunuru > Sent: Wednesday, October 16, 2019 4:56 PM > 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 > Subject: RE: [EXT] Re: [dpdk-dev] [PATCH v10 4/5] kni: add IOVA=3DVA supp= ort in > KNI module >=20 >=20 >=20 > > -----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 suppor= t > > in KNI module > > > > External Email > > > > ---------------------------------------------------------------------- > > On Tue, 15 Oct 2019 16:43:08 +0100 > > "Yigit, Ferruh" wrote: > > > > > 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 > > > > with 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. > > > > Right now it is possible to use KNI with netvsc PMD on Hyper-V/Azure. > > With this patch that won't be possible. >=20 > Hi Ferruh, Stephen, >=20 > These can be fixed by forcing iommu_mode as PA when vdevs are used for KN= I > usecase. >=20 > 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; >=20 > + 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; >=20 > 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= fix. Hi Ferruh, Stephen, Pushed a patch for above mentioned fix. Fix is moved to vdev bus driver. Patch adds get_iommu_class callback in vdev bus driver and returns iova=3Dp= a for kni usecase. http://patches.dpdk.org/patch/61312/