From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out1-smtp.messagingengine.com (out1-smtp.messagingengine.com [66.111.4.25]) by dpdk.org (Postfix) with ESMTP id 2A9B6A48A; Sat, 20 Jan 2018 16:30:42 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9544A206B8; Sat, 20 Jan 2018 10:30:41 -0500 (EST) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Sat, 20 Jan 2018 10:30:41 -0500 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=monjalon.net; h= cc:content-transfer-encoding:content-type:date:from:in-reply-to :message-id:mime-version:references:subject:to:x-me-sender :x-me-sender:x-sasl-enc; s=mesmtp; bh=Qc3mov3UXa0MUHphItgi1uAg8i K0ypXg0oAWFLa7CR4=; b=qIxHbpIpy1iqsoL9HclKn92JL9WSx0wm96GcTyW/be cA4DDGrMFRdUpMlqjDxf1QvOm1umKpRgfhNhM9vHfu2BESIvtRV84WR+TqvROQJq hd9jkfGOkaESzjf2sB/UOCcKA5adzfU29qQx1jNvTaog7dz3SKxUkABXVERq88w9 Q= 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-sender:x-me-sender:x-sasl-enc; s=fm1; bh=Qc3mov 3UXa0MUHphItgi1uAg8iK0ypXg0oAWFLa7CR4=; b=qHh8aGBMe+m7bEfgL3MubO CEh67swkVJak9wgHkOSyBUSQiG3RV/+pip9J6OJpGeT265BP7ykzXjjfb8eeXvWT 2QSYbuyFjU9TlRFZVmCLse1V3XWzctzUxBYZdegfwO7QDJ3kHX883QsrZtrZp+t2 3zBYtaGyLJu1yH7/zde5Mwk5OcFyBPqWqQeZ7gMoXXaHRGN2PEgyxIdzE4JG8Nn1 4+Xd3PDuyJGGcTuRnx4BtRsBmMXA5PWpIWBJcNMNvMY0YEadUNFxdIUNwPWFsmdz iWueMUIpc7kxxYjfe7CFkhCrnQqpqrVRsXB1cCbP9XRjHXi8yrF7h5wrlXdfMFhA == X-ME-Sender: Received: from xps.localnet (184.203.134.77.rev.sfr.net [77.134.203.184]) by mail.messagingengine.com (Postfix) with ESMTPA id 3765A240DE; Sat, 20 Jan 2018 10:30:41 -0500 (EST) From: Thomas Monjalon To: Maxime Coquelin Cc: stable@dpdk.org, dev@dpdk.org, jianfeng.tan@intel.com, qi.z.zhang@intel.com, stephen@networkplumber.org, santosh.shukla@caviumnetworks.com, anatoly.burakov@intel.com, peterx@redhat.com Date: Sat, 20 Jan 2018 16:30:05 +0100 Message-ID: <7562300.6VOHPpqvym@xps> In-Reply-To: <20180112102220.20061-1-maxime.coquelin@redhat.com> References: <20180112102220.20061-1-maxime.coquelin@redhat.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [dpdk-stable] [PATCH v3] bus/pci: forbid VA as IOVA mode if IOMMU address width too small 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: Sat, 20 Jan 2018 15:30:42 -0000 12/01/2018 11:22, Maxime Coquelin: > Intel VT-d supports different address widths for the IOVAs, from > 39 bits to 56 bits. > > While recent processors support at least 48 bits, VT-d emulation > currently only supports 39 bits. It makes DMA mapping to fail in this > case when using VA as IOVA mode, as user-space virtual addresses uses > up to 47 bits (see kernel's Documentation/x86/x86_64/mm.txt). > > This patch parses VT-d CAP register value available in sysfs, and > forbid VA as IOVA mode if the GAW is 39 bits or unknown. > > Fixes: f37dfab21c98 ("drivers/net: enable IOVA mode for Intel PMDs") > > Cc: stable@dpdk.org > Signed-off-by: Maxime Coquelin [...] > + if (fscanf(fp, "%lx", &vtd_cap_reg) != 1) { Compilation error on 32-bit. Fix: - if (fscanf(fp, "%lx", &vtd_cap_reg) != 1) { + if (fscanf(fp, "%" PRIx64, &vtd_cap_reg) != 1) { [...] > +#elif defined(RTE_ARCH_PPC_64) > +static bool > +pci_one_device_iommu_support_va(struct rte_pci_device *dev) > +{ > + return false; > +} > +#else > +static bool > +pci_one_device_iommu_support_va(struct rte_pci_device *dev) > +{ > + return true; > +} > +#endif Compilation error on non-x86. Fix: #elif defined(RTE_ARCH_PPC_64) static bool -pci_one_device_iommu_support_va(struct rte_pci_device *dev) +pci_one_device_iommu_support_va(__rte_unused struct rte_pci_device *dev) { return false; } #else static bool -pci_one_device_iommu_support_va(struct rte_pci_device *dev) +pci_one_device_iommu_support_va(__rte_unused struct rte_pci_device *dev) { return true; } Applied with above fixes, thanks.