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 2411FA00E6 for ; Wed, 10 Jul 2019 14:39:35 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EF98E31FC; Wed, 10 Jul 2019 14:39:34 +0200 (CEST) Received: from wout2-smtp.messagingengine.com (wout2-smtp.messagingengine.com [64.147.123.25]) by dpdk.org (Postfix) with ESMTP id 15A702F42 for ; Wed, 10 Jul 2019 14:39:33 +0200 (CEST) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.west.internal (Postfix) with ESMTP id 019F1435; Wed, 10 Jul 2019 08:39:31 -0400 (EDT) Received: from mailfrontend1 ([10.202.2.162]) by compute1.internal (MEProxy); Wed, 10 Jul 2019 08:39:32 -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=IwHc8PSsVxQO9Y4IpYliKnajoQE5pRXI5qw7QJxlaPQ=; b=OULDdz97imth N3kOg53Novgni+zwmKZC/jntbd6eSYbyVsuAxtAoVsuqKis7/+IyeYkZ/k9rCiae SMcCsX3HvnG8lCt3Ikk5OHhKb7jblZntpkmDzA58AOPEN/4Fi7PM/p+Po+mxayMe q8mvbUt+xtZ8WfSXcaKqzk3d/fiWy+Y= 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=IwHc8PSsVxQO9Y4IpYliKnajoQE5pRXI5qw7QJxla PQ=; b=kV6uIs0D8yycbdjdHHaGn/Ztez3p/wwRyNe9/JGeAmI5hgK8HwsoJarpp 7Se9Y/RcvBpjfnD6+xtVhOsinNRx7+Mr/5y5BCng6WkOMh82NiOJZHkCdFi7Hw62 6atsQsSYOePS/7A87MH0VTb4YTQaaNlIh92smhSLakRWKtqLFtVYmA28IR7KAKn4 M+92jb+z5YEzgzErlOVAyb2RZu6MMbufZtpuE22laB1Pun4ODvQ4iY8uWmlNBOjS ALvU+7k3HV2EGBtSMtxbRfJjOyauR0ic2vUEMPJs5miDwLGVFGA5PfZeAtn3ME9n kFjNFjRF2mnsM9YJFTRhyVgHXLpZQ== X-ME-Sender: X-ME-Proxy-Cause: gggruggvucftvghtrhhoucdtuddrgeduvddrgeeigdehhecutefuodetggdotefrodftvf 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 53D6780060; Wed, 10 Jul 2019 08:39:30 -0400 (EDT) From: Thomas Monjalon To: "Burakov, Anatoly" Cc: Takeshi Yoshimura , dev@dpdk.org, David Christensen Date: Wed, 10 Jul 2019 14:39:28 +0200 Message-ID: <2134455.0e53NjsZy4@xps> In-Reply-To: References: <20190607022830.2044-1-tyos@jp.ibm.com> <86842673.aHDJ4ghJsv@xps> 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 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_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. > >>> > >>> Signed-off-by: Takeshi Yoshimura > >>> --- > >>> lib/librte_eal/linux/eal/eal_vfio.c | 26 +++++++++++++++++++++++--- > >>> 1 file changed, 23 insertions(+), 3 deletions(-) > >>> > >>> diff --git a/lib/librte_eal/linux/eal/eal_vfio.c b/lib/librte_eal/lin= ux/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_cont= ainer_fd, > >>> /* create new DMA window */ > >>> ret =3D ioctl(vfio_container_fd, VFIO_IOMMU_SPAPR_TCE_CREATE, cre= ate); > >>> 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; > >> > >> +CC POWER maintainer from MAINTAINERS file. > >> > >> This is failing compilation on some older distros (Fedora 20, Ubuntu 1= 4.04): > >> > >> > >> /root/dpdk/lib/librte_eal/linux/eal/eal_vfio.c: In function > >> =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= =98struct > >> 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= =98struct > >> 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 > >> "-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 > >> > >> > >> Looking at the eal_vfio.h we are handling case of missing sPAPR info/d= dw > >> 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? > >=20 > > If the kernel is not maintained, we don't support it. > > For most distros, Linux < 3.16 is not maintained. >=20 > This is on kernel 3.13 (Ubuntu 14.04 LTS which according to Canonical's=20 > published schedule [1] has stopped receiving even maintenance updates,=20 > and is only updated for select customers). It was never an LTS kernel to= =20 > begin with, i think. So we can ignore this issue.