From mboxrd@z Thu Jan 1 00:00:00 1970 From: "Burakov, Anatoly" Subject: Re: [PATCH] eal/vfio: share the default container in multi process Date: Thu, 4 Oct 2018 16:52:55 +0100 Message-ID: <254f2fd2-832b-0722-cb1b-bd0a5050bd00@intel.com> References: <20181003123925.6343-1-dariusz.stojaczyk@intel.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8; format=flowed Content-Transfer-Encoding: 7bit Cc: wuzhouhui250@gmail.com, pawelx.wodkowski@intel.com, gowrishankar.m@linux.vnet.ibm.com, stable@dpdk.org To: Darek Stojaczyk , dev@dpdk.org Return-path: In-Reply-To: <20181003123925.6343-1-dariusz.stojaczyk@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 03-Oct-18 1:39 PM, Darek Stojaczyk wrote: > So far each process in MP used to have a separate container > and relied on the primary process to register all memsegs. > > Mapping external memory via rte_vfio_container_dma_map() > in secondary processes was broken, because the default > (process-local) container had no groups bound. There was > even no way to bind any groups to it, because the container > fd was deeply encapsulated within EAL. > > This patch introduces a new SOCKET_REQ_DEFAULT_CONTAINER > message type for MP synchronization, makes all processes > within a MP party use a single default container, and hence > fixes rte_vfio_container_dma_map() for secondary processes. > >>>From what I checked this behavior was always the same, but > started to be invalid/insufficient once mapping external > memory was allowed. > > Fixes: 73a639085938 ("vfio: allow to map other memory regions") > Cc: anatoly.burakov@intel.com > Cc: pawelx.wodkowski@intel.com > Cc: gowrishankar.m@linux.vnet.ibm.com > Cc: stable@dpdk.org > > While here, fix up the comment on rte_vfio_get_container_fd(). > This function always opens a new container, never reuses > an old one. > > Signed-off-by: Darek Stojaczyk > --- This makes things a bit funky when we consider external memory support. The same address space may or may not be mapped into the process, so we may or may not need to map things for DMA depending on whether we're mapping shared memory for DMA, or not. The previous behavior may be counter-intuitive, but it's IMO the correct one - each process has its own container and performs its own DMA mappings. -- Thanks, Anatoly