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 7FE861B638 for ; Fri, 3 Nov 2017 11:54:47 +0100 (CET) Received: from compute1.internal (compute1.nyi.internal [10.202.2.41]) by mailout.nyi.internal (Postfix) with ESMTP id 0CCDB20C11; Fri, 3 Nov 2017 06:54:47 -0400 (EDT) Received: from frontend1 ([10.202.2.160]) by compute1.internal (MEProxy); Fri, 03 Nov 2017 06:54:47 -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=TzxVX6cTosAYUx2nVj1LUdM0ns Pu6953s9N+deBez2Y=; b=UOmvGzcoed2gRi9IXSpKUApDHMgwC8UP6LF5S5SyjX oY9O+hq2jWUVssTX4fxhbzerYy/m+tEn9jfDygA9WbkfBMYkhnXXg5mJcd7gD62o VpWmEpoVcYRtaKE8IUYoB01sl1LKqJbYjlYfwf60hH1kpdt9MbrXjtt1lcFEWknj U= 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=TzxVX6 cTosAYUx2nVj1LUdM0nsPu6953s9N+deBez2Y=; b=m45NHnsC4XfZOPqOgs5LCL ij7RAL0eohvs2IkPIFooobRrd8QlZu6DNYVhkR2HKISPPic15EXmLPC/NNPX3OHi mJl65FcyzHgcB1wrHXICZETi2qiYQT+U0b8byrOLuNrC7+g8k0kQkpiwDB4V3jJ5 A5v3SiuSNeZuzurH0YCX9Gw9du3wag8WR3GtId/Gg2OR1nmHFu5b7K0+86P+fhjk e/p0UGvTLqqGmWF3h8XDiq1F/OwsUXq0VpME/blUXBo8wjAVM8jTXU7o4YdDyrKw XfjVDgJOzPKIVWmYNs0wtcZ1DjLmXnqPmyDBumOTIcjGQFY0owWWtm2JRg05kUvQ == 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 B9BB87FA6B; Fri, 3 Nov 2017 06:54:46 -0400 (EDT) From: Thomas Monjalon To: Jonas Pfefferle1 Cc: aconole@redhat.com, Alexey Kardashevskiy , 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 Date: Fri, 03 Nov 2017 11:54:45 +0100 Message-ID: <2435156.eG8feLuSfo@xps> In-Reply-To: References: <20170814161059.6684-1-santosh.shukla@caviumnetworks.com> <3063385.K5PMv1yDeD@xps> 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:54:47 -0000 03/11/2017 11:44, Jonas Pfefferle1: > Thomas Monjalon wrote on 11/03/2017 11:28:10 AM: > > 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. > > > > Ok but we might want to refine this in the future. IMO It looks much > cleaner > to decide this on the iommu type plus this would also cover the noiommu > case without having this extra check reading the sysfs variable. You are using the word "this" too many times to help me understand :) Anyway, please send a quick fix today for 17.11. The RC3 will be probably closed before Monday.