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 B8771A00E6 for ; Thu, 11 Jul 2019 04:18:54 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id A969F2E81; Thu, 11 Jul 2019 04:18:53 +0200 (CEST) Received: from mx0a-001b2d01.pphosted.com (mx0a-001b2d01.pphosted.com [148.163.156.1]) by dpdk.org (Postfix) with ESMTP id 326762C6A for ; Thu, 11 Jul 2019 04:18:51 +0200 (CEST) Received: from pps.filterd (m0098393.ppops.net [127.0.0.1]) by mx0a-001b2d01.pphosted.com (8.16.0.27/8.16.0.27) with SMTP id x6B21Vog111947 for ; Wed, 10 Jul 2019 22:18:51 -0400 Received: from smtp.notes.na.collabserv.com (smtp.notes.na.collabserv.com [192.155.248.82]) by mx0a-001b2d01.pphosted.com with ESMTP id 2tnr8tr4wp-1 (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NOT) for ; Wed, 10 Jul 2019 22:18:51 -0400 Received: from localhost by smtp.notes.na.collabserv.com with smtp.notes.na.collabserv.com ESMTP for from ; Thu, 11 Jul 2019 02:18:50 -0000 Received: from us1a3-smtp04.a3.dal06.isc4sb.com (10.106.154.237) by smtp.notes.na.collabserv.com (10.106.227.105) with smtp.notes.na.collabserv.com ESMTP; Thu, 11 Jul 2019 02:18:46 -0000 Received: from us1a3-mail157.a3.dal06.isc4sb.com ([10.146.71.179]) by us1a3-smtp04.a3.dal06.isc4sb.com with ESMTP id 2019071102184502-1188137 ; Thu, 11 Jul 2019 02:18:45 +0000 In-Reply-To: <80114dab-b80a-9670-01af-735031f01c68@intel.com> From: "Takeshi T Yoshimura" To: "Burakov, Anatoly" Cc: Thomas Monjalon , dev@dpdk.org, David Christensen Date: Thu, 11 Jul 2019 02:18:45 +0000 MIME-Version: 1.0 Sensitivity: Importance: Normal X-Priority: 3 (Normal) References: <80114dab-b80a-9670-01af-735031f01c68@intel.com>, <20190607022830.2044-1-tyos@jp.ibm.com> <86842673.aHDJ4ghJsv@xps> <2134455.0e53NjsZy4@xps> X-Mailer: IBM iNotes ($HaikuForm 1054) | IBM Domino Build SCN1812108_20180501T0841_FP55 May 22, 2019 at 11:09 X-LLNOutbound: False X-Disclaimed: 2691 X-TNEFEvaluated: 1 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset=UTF-8 x-cbid: 19071102-9463-0000-0000-00000022678B X-IBM-SpamModules-Scores: BY=0.050399; FL=0; FP=0; FZ=0; HX=0; KW=0; PH=0; SC=0.40962; ST=0; TS=0; UL=0; ISC=; MB=0.001690 X-IBM-SpamModules-Versions: BY=3.00011407; HX=3.00000242; KW=3.00000007; PH=3.00000004; SC=3.00000286; SDB=6.01230423; UDB=6.00648086; IPR=6.01011695; MB=3.00027673; MTD=3.00000008; XFM=3.00000015; UTC=2019-07-11 02:18:49 X-IBM-AV-DETECTION: SAVI=unsuspicious REMOTE=unsuspicious XFE=unused X-IBM-AV-VERSION: SAVI=2019-07-10 21:35:30 - 6.00010149 x-cbparentid: 19071102-9464-0000-0000-00000035BFFB Message-Id: X-Proofpoint-Virus-Version: vendor=fsecure engine=2.50.10434:, , definitions=2019-07-10_08:, , signatures=0 X-Proofpoint-Spam-Reason: safe Subject: Re: [dpdk-dev] [PATCH] vfio: retry creating sPAPR DMA window 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" -----"Burakov, Anatoly" wrote: ----- >To: Thomas Monjalon >From: "Burakov, Anatoly" >Date: 07/10/2019 09:01AM >Cc: Takeshi Yoshimura , dev@dpdk.org, David >Christensen >Subject: [EXTERNAL] Re: [dpdk-dev] [PATCH] vfio: retry creating sPAPR >DMA window > >On 10-Jul-19 1:39 PM, Thomas Monjalon wrote: >> 10/07/2019 14:35, Burakov, Anatoly: >>> On 10-Jul-19 1:17 PM, Thomas Monjalon wrote: >>>> 10/07/2019 12:32, Burakov, Anatoly: >>>>> On 07-Jun-19 3:28 AM, Takeshi Yoshimura wrote: >>>>>> sPAPR allows only page=5Fshift from VFIO=5FIOMMU=5FSPAPR=5FTCE=5FGET= =5FINFO >ioctl. >>>>>> However, Linux 4.17 or before returns incorrect page=5Fshift for >Power9. >>>>>> I added the code for retrying creation of sPAPR DMA window. >>>>>> >>>>>> Signed-off-by: Takeshi Yoshimura >>>>>> --- >>>>>> lib/librte=5Feal/linux/eal/eal=5Fvfio.c | 26 >+++++++++++++++++++++++--- >>>>>> 1 file changed, 23 insertions(+), 3 deletions(-) >>>>>> >>>>>> diff --git a/lib/librte=5Feal/linux/eal/eal=5Fvfio.c >b/lib/librte=5Feal/linux/eal/eal=5Fvfio.c >>>>>> index 6892a2c14..f16c5c3c0 100644 >>>>>> --- a/lib/librte=5Feal/linux/eal/eal=5Fvfio.c >>>>>> +++ b/lib/librte=5Feal/linux/eal/eal=5Fvfio.c >>>>>> @@ -1448,9 +1448,29 @@ vfio=5Fspapr=5Fcreate=5Fnew=5Fdma=5Fwindow(int >vfio=5Fcontainer=5Ffd, >>>>>> /* create new DMA window */ >>>>>> ret =3D ioctl(vfio=5Fcontainer=5Ffd, >VFIO=5FIOMMU=5FSPAPR=5FTCE=5FCREATE, create); >>>>>> if (ret) { >>>>>> - RTE=5FLOG(ERR, EAL, " cannot create new DMA window, " >>>>>> - "error %i (%s)\n", errno, strerror(errno)); >>>>>> - return -1; >>>>>> + /* try possible page=5Fshift and levels for workaround */ >>>>>> + uint32=5Ft levels; >>>>>> + >>>>>> + for (levels =3D 1; levels <=3D info.ddw.levels; levels++) { >>>>>> + uint32=5Ft pgsizes =3D info.ddw.pgsizes; >>>>> >>>>> +CC POWER maintainer from MAINTAINERS file. >>>>> >>>>> This is failing compilation on some older distros (Fedora 20, >Ubuntu 14.04): >>>>> >>>>> >>>>> /root/dpdk/lib/librte=5Feal/linux/eal/eal=5Fvfio.c: In function >>>>> =E2=80=98vfio=5Fspapr=5Fcreate=5Fnew=5Fdma=5Fwindow=E2=80=99: >>>>> /root/dpdk/lib/librte=5Feal/linux/eal/eal=5Fvfio.c:1451:34: error: >=E2=80=98struct >>>>> vfio=5Fiommu=5Fspapr=5Ftce=5Finfo=E2=80=99 has no member named =E2=80= =98ddw=E2=80=99 >>>>> for (levels =3D 1; levels <=3D info.ddw.levels; levels++) { >>>>> ^ >>>>> /root/dpdk/lib/librte=5Feal/linux/eal/eal=5Fvfio.c:1452:27: error: >=E2=80=98struct >>>>> vfio=5Fiommu=5Fspapr=5Ftce=5Finfo=E2=80=99 has no member named =E2=80= =98ddw=E2=80=99 >>>>> uint32=5Ft pgsizes =3D info.ddw.pgsizes; >>>>> ^ >>>>> /root/dpdk/lib/librte=5Feal/linux/eal/eal=5Fvfio.c: At top level: >>>>> cc1: error: unrecognized command line option >>>>> "-Wno-address-of-packed-member" [-Werror] >>>>> cc1: all warnings being treated as errors >>>>> make[7]: *** [eal=5Fvfio.o] Error 1 >>>>> make[7]: *** Waiting for unfinished jobs.... >>>>> make[6]: *** [eal] Error 2 >>>>> make[5]: *** [linux] Error 2 >>>>> make[4]: *** [librte=5Feal] Error 2 >>>>> make[3]: *** [lib] Error 2 >>>>> make[2]: *** [all] Error 2 >>>>> make[1]: *** [pre=5Finstall] Error 2 >>>>> make: *** [install] Error 2 >>>>> >>>>> >>>>> Looking at the eal=5Fvfio.h we are handling case of missing sPAPR >info/ddw >>>>> structures, but this isn't simply a case of a missing struct; >rather it >>>>> is an issue of differing definitions between what recent kernels >have, >>>>> and what older kernels had. >>>>> >>>>> @Thomas Do we still support these older distros? >>>> >>>> If the kernel is not maintained, we don't support it. >>>> For most distros, Linux < 3.16 is not maintained. >>> >>> This is on kernel 3.13 (Ubuntu 14.04 LTS which according to >Canonical's >>> published schedule [1] has stopped receiving even maintenance >updates, >>> and is only updated for select customers). It was never an LTS >kernel to >>> begin with, i think. >>=20 >> So we can ignore this issue. >>=20 > >It seems that it's also reproducible on Ubuntu 14.04 with kernel >3.19.=20 >Which is not an upstream LTS kernel, but it's >3.16. > >It also looks like it may be an issue for us specifically, so i would > >suggest reverting the patch for rc2 if the submitter/maintainers >don't=20 >come back and fix it. > >--=20 >Thanks, >Anatoly > > Hi Anatoly, Thank you for your report and analysis. This can be avoided by adding #ifde= f VFIO=5FIOMMU=5FSPAPR=5FINFO=5FDDW. I will quickly submit the fix soon after this email. Regards, Takeshi