From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from mx0a-001b2d01.pphosted.com (mx0b-001b2d01.pphosted.com [148.163.158.5]) by dpdk.org (Postfix) with ESMTP id C22301BAC4 for ; Thu, 26 Oct 2017 14:57:32 +0200 (CEST) Received: from pps.filterd (m0098413.ppops.net [127.0.0.1]) by mx0b-001b2d01.pphosted.com (8.16.0.21/8.16.0.21) with SMTP id v9QCuRZg030862 for ; Thu, 26 Oct 2017 08:57:32 -0400 Received: from smtp.notes.na.collabserv.com (smtp.notes.na.collabserv.com [192.155.248.93]) by mx0b-001b2d01.pphosted.com with ESMTP id 2dud039scu-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Thu, 26 Oct 2017 08:57:31 -0400 Received: from localhost by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Thu, 26 Oct 2017 12:57:30 -0000 Received: from us1a3-smtp08.a3.dal06.isc4sb.com (10.146.103.57) by smtp.notes.na.collabserv.com (10.106.227.39) with smtp.notes.na.collabserv.com ESMTP; Thu, 26 Oct 2017 12:57:23 -0000 Received: from us1a3-mail173.a3.dal06.isc4sb.com ([10.146.71.126]) by us1a3-smtp08.a3.dal06.isc4sb.com with ESMTP id 2017102612572193-492946 ; Thu, 26 Oct 2017 12:57:21 +0000 MIME-Version: 1.0 In-Reply-To: <20170831032618.7120-8-santosh.shukla@caviumnetworks.com> To: Santosh Shukla Cc: dev@dpdk.org, thomas@monjalon.net, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, olivier.matz@6wind.com, maxime.coquelin@redhat.com, sergio.gonzalez.monroy@intel.com, bruce.richardson@intel.com, shreyansh.jain@nxp.com, gaetan.rivet@6wind.com, anatoly.burakov@intel.com, stephen@networkplumber.org, aconole@redhat.com From: "Jonas Pfefferle1" Date: Thu, 26 Oct 2017 14:57:21 +0200 References: <20170814161059.6684-1-santosh.shukla@caviumnetworks.com> <20170831032618.7120-1-santosh.shukla@caviumnetworks.com> <20170831032618.7120-8-santosh.shukla@caviumnetworks.com> X-KeepSent: 5ECB34A3:8C8EE71E-C12581C5:0046EA4C; type=4; name=$KeepSent X-Mailer: IBM Notes Release 9.0.1 October 14, 2013 X-LLNOutbound: False X-Disclaimed: 2035 X-TNEFEvaluated: 1 x-cbid: 17102612-1799-0000-0000-000003A64ADF X-IBM-SpamModules-Scores: BY=0; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0.417846; ST=0; TS=0; UL=0; ISC=; MB=0.097916 X-IBM-SpamModules-Versions: BY=3.00007954; HX=3.00000241; KW=3.00000007; PH=3.00000004; SC=3.00000239; SDB=6.00936730; UDB=6.00472063; IPR=6.00716993; BA=6.00005660; NDR=6.00000001; ZLA=6.00000005; ZF=6.00000009; ZB=6.00000000; ZP=6.00000000; ZH=6.00000000; ZU=6.00000002; MB=3.00017725; XFM=3.00000015; UTC=2017-10-26 12:57:29 X-IBM-AV-DETECTION: SAVI=unsuspicious REMOTE=unsuspicious XFE=unused X-IBM-AV-VERSION: SAVI=2017-10-26 01:13:59 - 6.00007517 x-cbparentid: 17102612-1800-0000-0000-0000DD265DF9 Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10432:, , definitions=2017-10-26_03:, , signatures=0 X-Proofpoint-Spam-Reason: safe Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: quoted-printable X-Content-Filtered-By: Mailman/MimeDel 2.1.15 Subject: Re: [dpdk-dev] [PATCH v7 7/9] linuxapp/eal_vfio: honor iova mode before mapping 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, 26 Oct 2017 12:57:33 -0000 Hi @all I just stumbled upon this patch while testing on POWER. RTE=5FIOVA=5FVA will not work for the sPAPR code since the dma window size is currently determined by the physical address only. I'm preparing a patch to address this. Thanks, Jonas "dev" wrote on 08/31/2017 05:26:16 AM: > From: Santosh Shukla > To: dev@dpdk.org > Cc: thomas@monjalon.net, jerin.jacob@caviumnetworks.com, > hemant.agrawal@nxp.com, olivier.matz@6wind.com, > maxime.coquelin@redhat.com, sergio.gonzalez.monroy@intel.com, > bruce.richardson@intel.com, shreyansh.jain@nxp.com, > gaetan.rivet@6wind.com, anatoly.burakov@intel.com, > stephen@networkplumber.org, aconole@redhat.com, Santosh Shukla > > Date: 08/31/2017 05:28 AM > Subject: [dpdk-dev] [PATCH v7 7/9] linuxapp/eal=5Fvfio: honor iova > mode before mapping > Sent by: "dev" > > Check iova mode and accordingly map iova to pa or va. > > Signed-off-by: Santosh Shukla > Signed-off-by: Jerin Jacob > Reviewed-by: Maxime Coquelin > --- > lib/librte=5Feal/linuxapp/eal/eal=5Fvfio.c | 10 ++++++++-- > 1 file changed, 8 insertions(+), 2 deletions(-) > > diff --git a/lib/librte=5Feal/linuxapp/eal/eal=5Fvfio.c b/lib/ > librte=5Feal/linuxapp/eal/eal=5Fvfio.c > index c8a97b7e7..b32cd09a2 100644 > --- a/lib/librte=5Feal/linuxapp/eal/eal=5Fvfio.c > +++ b/lib/librte=5Feal/linuxapp/eal/eal=5Fvfio.c > @@ -706,7 +706,10 @@ vfio=5Ftype1=5Fdma=5Fmap(int vfio=5Fcontainer=5Ffd) > dma=5Fmap.argsz =3D sizeof(struct vfio=5Fiommu=5Ftype1=5Fdma=5Fmap= ); > dma=5Fmap.vaddr =3D ms[i].addr=5F64; > dma=5Fmap.size =3D ms[i].len; > - dma=5Fmap.iova =3D ms[i].phys=5Faddr; > + if (rte=5Feal=5Fiova=5Fmode() =3D=3D RTE=5FIOVA=5FVA) > + dma=5Fmap.iova =3D dma=5Fmap.vaddr; > + else > + dma=5Fmap.iova =3D ms[i].phys=5Faddr; > dma=5Fmap.flags =3D VFIO=5FDMA=5FMAP=5FFLAG=5FREAD | VFIO=5FDMA=5F= MAP=5FFLAG=5FWRITE; > > ret =3D ioctl(vfio=5Fcontainer=5Ffd, VFIO=5FIOMMU=5FMAP=5FDMA, &dm= a=5Fmap); > @@ -792,7 +795,10 @@ vfio=5Fspapr=5Fdma=5Fmap(int vfio=5Fcontainer=5Ffd) > dma=5Fmap.argsz =3D sizeof(struct vfio=5Fiommu=5Ftype1=5Fdma=5Fmap= ); > dma=5Fmap.vaddr =3D ms[i].addr=5F64; > dma=5Fmap.size =3D ms[i].len; > - dma=5Fmap.iova =3D ms[i].phys=5Faddr; > + if (rte=5Feal=5Fiova=5Fmode() =3D=3D RTE=5FIOVA=5FVA) > + dma=5Fmap.iova =3D dma=5Fmap.vaddr; > + else > + dma=5Fmap.iova =3D ms[i].phys=5Faddr; > dma=5Fmap.flags =3D VFIO=5FDMA=5FMAP=5FFLAG=5FREAD | > VFIO=5FDMA=5FMAP=5FFLAG=5FWRITE; > > -- > 2.13.0 >