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 0EAA4A00E6 for ; Wed, 10 Jul 2019 14:17:58 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id E3BDD2C60; Wed, 10 Jul 2019 14:17:56 +0200 (CEST) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by dpdk.org (Postfix) with ESMTP id 5829F2C23 for ; Wed, 10 Jul 2019 14:17:55 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id D0F0B546; Wed, 10 Jul 2019 08:17:51 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 10 Jul 2019 08:17:52 -0400 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= from:to:cc:subject:date:message-id:in-reply-to:references :mime-version:content-transfer-encoding:content-type; s=mesmtp; bh=h6bsSZ0CfBce8nQrp+HoEFUo4LETNt8q+WAiTi/Ks3w=; b=VwjMQYPD9DZv hh44r234vDCIjx6Rdz4Y34PiY0En8MwJ/p9oP1YhP2FFZc3+PzxvPIWYXYSWnYEv a8fEfJ/a40y7bw5xI3Qyct3vNFHq0h39CASkExDBtiNlfp5W/w+ptdie88RsICPx WwknZA+dcAqSlyHwrsJOXr5w3mTkNDw= DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d= messagingengine.com; h=cc:content-transfer-encoding:content-type :date:from:in-reply-to:message-id:mime-version:references :subject:to:x-me-proxy:x-me-proxy:x-me-sender:x-me-sender :x-sasl-enc; s=fm3; bh=h6bsSZ0CfBce8nQrp+HoEFUo4LETNt8q+WAiTi/Ks 3w=; b=iNQ84EORC4rnIDDncntp+hMqgtEgg8rcWYWJuMQLIiy4/RlsXX24kOJ1y czm/D2qKsB0YEbwJgeLR+vr/7/IE6/MUvrxsKMfer4zpLOdgJBl7Y8T3EftPpxFK mCqgItSplPy2/xdvSgPqfKSkSgBmIrk84m3HKNfejx0xw7LFlgMw1vr7HRxCOHwr Xi/klsJSoBchCFT7nT95z3E5Zl/pV/Jt74lanJCHLdLd9r563cLLahnnEaO+HXAm bSh6W7Eqq+DGTGB6X0cD9YFg6ROjCtG+EJDA3qS59xhVCQ6C48pHOEwYc8ImX0jX m0Ud7UmKVT+MHOLbu/HSk3+cdRBVg== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrgeeigdehudcutefuodetggdotefrodftvf curfhrohhfihhlvgemucfhrghsthforghilhdpqfgfvfdpuffrtefokffrpgfnqfghnecu uegrihhlohhuthemuceftddtnecusecvtfgvtghiphhivghnthhsucdlqddutddtmdenuc fjughrpefhvffufffkjghfggfgtgesthhqredttddtjeenucfhrhhomhepvfhhohhmrghs ucfoohhnjhgrlhhonhcuoehthhhomhgrshesmhhonhhjrghlohhnrdhnvghtqeenucfkph epudelfedrvdehtddrkeegrddvgeegnecurfgrrhgrmhepmhgrihhlfhhrohhmpehthhho mhgrshesmhhonhhjrghlohhnrdhnvghtnecuvehluhhsthgvrhfuihiivgeptd X-ME-Proxy: Received: from xps.localnet (lfbn-1-8944-244.w193-250.abo.wanadoo.fr [193.250.84.244]) by mail.messagingengine.com (Postfix) with ESMTPA id A90E280066; Wed, 10 Jul 2019 08:17:49 -0400 (EDT) From: Thomas Monjalon To: "Burakov, Anatoly" Cc: Takeshi Yoshimura , dev@dpdk.org, David Christensen Date: Wed, 10 Jul 2019 14:17:46 +0200 Message-ID: <86842673.aHDJ4ghJsv@xps> In-Reply-To: <58453aeb-de91-8297-06db-73e895667dac@intel.com> References: <20190607022830.2044-1-tyos@jp.ibm.com> <58453aeb-de91-8297-06db-73e895667dac@intel.com> MIME-Version: 1.0 Content-Transfer-Encoding: quoted-printable Content-Type: text/plain; charset="UTF-8" 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" 10/07/2019 12:32, Burakov, Anatoly: > On 07-Jun-19 3:28 AM, Takeshi Yoshimura wrote: > > sPAPR allows only page_shift from VFIO_IOMMU_SPAPR_TCE_GET_INFO ioctl. > > However, Linux 4.17 or before returns incorrect page_shift for Power9. > > I added the code for retrying creation of sPAPR DMA window. > >=20 > > Signed-off-by: Takeshi Yoshimura > > --- > > lib/librte_eal/linux/eal/eal_vfio.c | 26 +++++++++++++++++++++++--- > > 1 file changed, 23 insertions(+), 3 deletions(-) > >=20 > > diff --git a/lib/librte_eal/linux/eal/eal_vfio.c b/lib/librte_eal/linux= /eal/eal_vfio.c > > index 6892a2c14..f16c5c3c0 100644 > > --- a/lib/librte_eal/linux/eal/eal_vfio.c > > +++ b/lib/librte_eal/linux/eal/eal_vfio.c > > @@ -1448,9 +1448,29 @@ vfio_spapr_create_new_dma_window(int vfio_contai= ner_fd, > > /* create new DMA window */ > > ret =3D ioctl(vfio_container_fd, VFIO_IOMMU_SPAPR_TCE_CREATE, create= ); > > if (ret) { > > - RTE_LOG(ERR, EAL, " cannot create new DMA window, " > > - "error %i (%s)\n", errno, strerror(errno)); > > - return -1; > > + /* try possible page_shift and levels for workaround */ > > + uint32_t levels; > > + > > + for (levels =3D 1; levels <=3D info.ddw.levels; levels++) { > > + uint32_t pgsizes =3D info.ddw.pgsizes; >=20 > +CC POWER maintainer from MAINTAINERS file. >=20 > This is failing compilation on some older distros (Fedora 20, Ubuntu 14.0= 4): >=20 >=20 > /root/dpdk/lib/librte_eal/linux/eal/eal_vfio.c: In function=20 > =E2=80=98vfio_spapr_create_new_dma_window=E2=80=99: > /root/dpdk/lib/librte_eal/linux/eal/eal_vfio.c:1451:34: error: =E2=80=98s= truct=20 > vfio_iommu_spapr_tce_info=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_eal/linux/eal/eal_vfio.c:1452:27: error: =E2=80=98s= truct=20 > vfio_iommu_spapr_tce_info=E2=80=99 has no member named =E2=80=98ddw=E2=80= =99 > uint32_t pgsizes =3D info.ddw.pgsizes; > ^ > /root/dpdk/lib/librte_eal/linux/eal/eal_vfio.c: At top level: > cc1: error: unrecognized command line option=20 > "-Wno-address-of-packed-member" [-Werror] > cc1: all warnings being treated as errors > make[7]: *** [eal_vfio.o] Error 1 > make[7]: *** Waiting for unfinished jobs.... > make[6]: *** [eal] Error 2 > make[5]: *** [linux] Error 2 > make[4]: *** [librte_eal] Error 2 > make[3]: *** [lib] Error 2 > make[2]: *** [all] Error 2 > make[1]: *** [pre_install] Error 2 > make: *** [install] Error 2 >=20 >=20 > Looking at the eal_vfio.h we are handling case of missing sPAPR info/ddw= =20 > structures, but this isn't simply a case of a missing struct; rather it=20 > is an issue of differing definitions between what recent kernels have,=20 > and what older kernels had. >=20 > @Thomas Do we still support these older distros? If the kernel is not maintained, we don't support it. =46or most distros, Linux < 3.16 is not maintained.