From mboxrd@z Thu Jan 1 00:00:00 1970 Return-Path: Received: from out4-smtp.messagingengine.com (out4-smtp.messagingengine.com [66.111.4.28]) by dpdk.org (Postfix) with ESMTP id 3F7D41B602 for ; Fri, 3 Nov 2017 11:28:11 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 9F7F921000; Fri, 3 Nov 2017 06:28:11 -0400 (EDT) Received: from frontend2 ([10.202.2.161]) by compute1.internal (MEProxy); Fri, 03 Nov 2017 06:28:11 -0400 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=1vRZf3Akiy5HadT6qB5Gb4Bh5G 3DDwz71/MkImpx2Hg=; b=Zx3YLm+HCat8IB0npTWBYUEswUea/qT8c14aa5KJ1x ze8RBga9bDYYmWekHRTVex7qDjQgZnBsRxRaeghApe7oS8LaAxH+E6ArGTQhSbuu 4NOD/eStjgONp2bBCdEFOARppM6z3zm+YDbjg4VbUPP993wS05sl80aN/zQLfAR2 o= 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=1vRZf3 Akiy5HadT6qB5Gb4Bh5G3DDwz71/MkImpx2Hg=; b=kNKfHHpoLCUUl3CVqaQu75 O0DPgmwDnchWjcDUpHTVoi4od7EURpf1ParSAgYPOVVHkP2k+eaYOtovKtzmM6dz pF0bvHvy9KXXmYJA1SX2mdY4GACrdKfY1tZkLen/ZGQKbGjsciIaBaBExt/ex0n+ 9SyabeCvfTbiTlQRoNgeREC081dO+6EKp9bdw1IZFvkwPT51f5cQQT2Li7dLUshe WWaicO26ZN9j7YPs84dxKaHP9LBW/PNpHkLxg4lUSud1JusjMWE/hDB6QxK3BE1u GAyTTw5aWVuBzoSkTPmqIbVxkawXFgMJ+pUhQ7KKHmSWKuQG/zqQ/PvGehFp7s0Q == 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 4D032248BA; Fri, 3 Nov 2017 06:28:11 -0400 (EDT) From: Thomas Monjalon To: Jonas Pfefferle1 Cc: aconole@redhat.com, anatoly.burakov@intel.com, bruce.richardson@intel.com, dev@dpdk.org, gaetan.rivet@6wind.com, hemant.agrawal@nxp.com, jerin.jacob@caviumnetworks.com, maxime.coquelin@redhat.com, olivier.matz@6wind.com, Santosh Shukla , sergio.gonzalez.monroy@intel.com, shreyansh.jain@nxp.com, stephen@networkplumber.org, Alexey Kardashevskiy Date: Fri, 03 Nov 2017 11:28:10 +0100 Message-ID: <3063385.K5PMv1yDeD@xps> In-Reply-To: References: <20170814161059.6684-1-santosh.shukla@caviumnetworks.com> MIME-Version: 1.0 Content-Transfer-Encoding: 7Bit Content-Type: text/plain; charset="us-ascii" Subject: Re: [dpdk-dev] [PATCH v7 7/9] linuxapp/eal_vfio: honor iova mode before mapping 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: Fri, 03 Nov 2017 10:28:12 -0000 03/11/2017 10:56, Jonas Pfefferle1: > Thomas Monjalon wrote on 11/02/2017 11:17:10 AM: > > > 26/10/2017 14:57, Jonas Pfefferle1: > > > > > > > > Hi @all > > > > > > > > I just stumbled upon this patch while testing on POWER. RTE_IOVA_VA > > will > > > > not work for the sPAPR code since the dma window size is currently > > > > determined by the physical address only. > > > > > > Is it affecting POWER8? > > > > It is. > > > > > > > > > I'm preparing a patch to address this. > > > > > > Any news? > > > Can you use virtual addresses? > > > > After a long discussion with Alexey (CC) we came to the conclusion that > > with the current sPAPR iommu driver we cannot use virtual addresses since > > the iova is restricted to lay in the DMA window which itself is > restricted > > to physical RAM addresses resp. with the current code 0 to hotplug memory > > max. However, Alexey is working on a patch to lift this restriction on > the > > DMA window size which should allow us to do VA:VA mappings in the future. > > For now we should fall back to PA in the dynamic iova mode check. I will > > send an according patch later today. > > I looked into this yesterday but I'm not sure what the right solution is > here. > At the time rte_pci_get_iommu_class is called we already know which IOMMU > types are supported because vfio_get_container_fd resp. > vfio_has_supported_extensions has been called however we do not know which > one is going to be used (Decided later in vfio_setup_device resp. > vfio_set_iommu_type). We can choose a iova mode which is supported by all > types but if the modes are exclusive to the types we have to guess which > one is going to be used. Or let the user decide? You can keep the old behaviour, restricting to physical memory, until you support virtual addressing. It can be just a #ifdef RTE_ARCH_PPC_64.