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 1FCBAA00E6 for ; Thu, 11 Jul 2019 04:23:10 +0200 (CEST) Received: from [92.243.14.124] (localhost [127.0.0.1]) by dpdk.org (Postfix) with ESMTP id EE62D2E81; Thu, 11 Jul 2019 04:23:09 +0200 (CEST) Received: from ns601-vm9.bullet.mail.ssk.yahoo.co.jp (ns601-vm9.bullet.mail.ssk.yahoo.co.jp [182.22.91.58]) by dpdk.org (Postfix) with SMTP id 6A6BE2C6A for ; Thu, 11 Jul 2019 04:23:06 +0200 (CEST) Received: from [182.22.66.104] by ns601.bullet.mail.ssk.yahoo.co.jp with NNFMP; 11 Jul 2019 02:23:05 -0000 Received: from [182.22.91.128] by t602.bullet.mail.ssk.yahoo.co.jp with NNFMP; 11 Jul 2019 02:23:05 -0000 Received: from [127.0.0.1] by omp601.mail.ssk.yahoo.co.jp with NNFMP; 11 Jul 2019 02:23:05 -0000 X-Yahoo-Newman-Property: ymail-5 X-Yahoo-Newman-Id: 57677.67304.bm@omp601.mail.ssk.yahoo.co.jp Received: (qmail 75823 invoked by alias); 11 Jul 2019 02:23:05 -0000 Received: from unknown (HELO localhost.localdomain) (38.119.166.65 with ) by ymobsmtp6006.mail.ssk.ynwp.yahoo.co.jp with SMTP; 11 Jul 2019 02:23:04 -0000 X-YMail-JAS: VtF8PL0VM1lO3mwISsZuyFADEcJ6JojoO0GEE9YGNtNtZi22TrLCMDragQvIYydB1lQLRjMQVtnWRb_QLuDQ8mMExMoVCsM_IvpIzJCfQg0Zb6WvveS78ZPO0jkTGXqmkExPmtt2S4cJs4c- X-Apparently-From: X-YMail-OSG: wk6j18EVM1lfriJHDXc3eZGnGEvdT_yyivDPPHm4T93VaE6 xPaqZn001W16KEyZ1dtA8HquL0u_a_GxG6VRH18u3BhebfpQ3IscP1yAMCKU yI_N4C3p2A0Jp0ZjDhaiaMoaocLjtZl7DXzYfW4f9ir6DTP8.xaR99QJFZUu M073AdpuIe1h4e9P2FsjZhUbKPAfIz3WNEl1GkU5oo0OIorKq.OEbQiXn4QC euYb1gEqU6OCcFYy2VrF7hIHhS4fXvHiQRzh4SBrIwaTL.E_kQ2r.VkD9PtK zveAOGMQlIWIsAk84dcXdKiH3h7wEqZPvoSnKl3uoWdeRfS5QqytWkxOArrB .RsG4hB2Qi8r_KyfHe4DpOvcaF91Y9FfGpY9i60Tf_xZAXVamHYWQeRkfSn0 PiRe7owDoYjlgzvWaxOSAGV_hkwg3URB50j3Lo8a_O8weUq3h1jDhLoxt1jR KgUcNWSvQaiq4EmkzGXrCcatKlOr8dgBr37NmbqJIimcDxsURft85dkU6keI dXa8RkkzdQ7nwmUa97QJCxhB2gCU7A.K2dxpC_TH5eIk2Qt5NybTFXqI5Ayo KbR6gBs3yCk77GITiintE_5GMfiQC4OF.uTcMwf.R0rIekt9fN33Rsi7nZkJ 3uuimlGH_7mgluWjWBKWh8R67sbq26ozaYWchoP4WGEDtUGPwfEmqdK5oBT5 UrRK1RRBi76vx3gOeSQVsTCeHM5if67a1 From: Takeshi Yoshimura To: dev@dpdk.org Cc: Burakov@dpdk.org, Anatoly , Thomas Monjalon , David Christensen , Takeshi Yoshimura Date: Wed, 10 Jul 2019 19:22:35 -0700 Message-Id: <20190711022235.2958-1-tyos@jp.ibm.com> X-Mailer: git-send-email 2.17.2 (Apple Git-113) Subject: [dpdk-dev] [PATCH] vfio: fix build errors on old Linux 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" The commit db90b4969e2e ("vfio: retry creating sPAPR DMA window") introduced a build breakage on old Linux. Linux <4.2 does not define ddw in struct vfio_iommu_spapr_tce_info. Without ddw, we cannot change window size and so should give up the creation. I just exculuded the retrying code if ddw is not supported. Fixes: db90b4969e2e ("vfio: retry creating sPAPR DMA window") Signed-off-by: Takeshi Yoshimura --- lib/librte_eal/linux/eal/eal_vfio.c | 2 ++ 1 file changed, 2 insertions(+) diff --git a/lib/librte_eal/linux/eal/eal_vfio.c b/lib/librte_eal/linux/eal/eal_vfio.c index 7053ebe7d..fadef427f 100644 --- a/lib/librte_eal/linux/eal/eal_vfio.c +++ b/lib/librte_eal/linux/eal/eal_vfio.c @@ -1445,6 +1445,7 @@ vfio_spapr_create_new_dma_window(int vfio_container_fd, /* create new DMA window */ ret = ioctl(vfio_container_fd, VFIO_IOMMU_SPAPR_TCE_CREATE, create); if (ret) { +#ifdef VFIO_IOMMU_SPAPR_INFO_DDW /* try possible page_shift and levels for workaround */ uint32_t levels; @@ -1463,6 +1464,7 @@ vfio_spapr_create_new_dma_window(int vfio_container_fd, if (!ret) break; } +#endif if (ret) { RTE_LOG(ERR, EAL, " cannot create new DMA window, " "error %i (%s)\n", errno, strerror(errno)); -- 2.17.2 (Apple Git-113)