From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: [PATCH v3 46/68] vfio: allow to map other memory regions Date: Thu, 5 Apr 2018 12:30:47 +0100 Message-ID: <21db37b3-c9ea-7994-a2f7-639f69f2ab32@intel.com> References: <0de49c396f7e2c0651acb4cc4a575919234f4c8d.1522797505.git.anatoly.burakov@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: Bruce Richardson , keith.wiles@intel.com, jianfeng.tan@intel.com, andras.kovacs@ericsson.com, laszlo.vadkeri@ericsson.com, benjamin.walker@intel.com, thomas@monjalon.net, konstantin.ananyev@intel.com, kuralamudhan.ramakrishnan@intel.com, louise.m.daly@intel.com, nelio.laranjeiro@6wind.com, yskoh@mellanox.com, pepperjo@japf.ch, jerin.jacob@caviumnetworks.com, hemant.agrawal@nxp.com, olivier.matz@6wind.com, shreyansh.jain@nxp.com, gowrishankar.m@linux.vnet.ibm.com, Pawel Wodkowski To: dev@dpdk.org Return-path: Received: from mga11.intel.com (mga11.intel.com [192.55.52.93]) by dpdk.org (Postfix) with ESMTP id 9D7F21CB45 for ; Thu, 5 Apr 2018 13:30:53 +0200 (CEST) In-Reply-To: <0de49c396f7e2c0651acb4cc4a575919234f4c8d.1522797505.git.anatoly.burakov@intel.com> Content-Language: en-US List-Id: DPDK patches and discussions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Errors-To: dev-bounces@dpdk.org Sender: "dev" On 04-Apr-18 12:21 AM, Anatoly Burakov wrote: > Currently it is not possible to use memory that is not owned by DPDK to > perform DMA. This scenarion might be used in vhost applications (like > SPDK) where guest send its own memory table. To fill this gap provide > API to allow registering arbitrary address in VFIO container. > > Signed-off-by: Pawel Wodkowski > Signed-off-by: Anatoly Burakov > Signed-off-by: Gowrishankar Muthukrishnan > --- @Gowrishankar, We've discussed this privately already, but just to make sure it is publicly stated: as it is, parts of this patchset for PPC64 have potential issues with them. Unmapping and remapping the entire segment list on alloc introduces a race condition - what if a DMA request comes in while we're in the middle of remapping? We cannot realistically stop NICs from doing DMA while some other thread is allocating memory. There is also a larger issue that i've raised in a previous response to this patch [1], and PPC64 will will have this problem worse, because not only the described issue will happen on hot-unplug/hotplug, but it may also happen during regular allocations, because PPC64 IOMMU will drop all mappings on window resize. [1] http://dpdk.org/ml/archives/dev/2018-April/095182.html -- Thanks, Anatoly