[dpdk-dev] [PATCH] eal/vfio: share the default container in multi process
Burakov, Anatoly
anatoly.burakov at intel.com
Fri Oct 5 10:57:50 CEST 2018
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 at intel.com
> Cc: pawelx.wodkowski at intel.com
> Cc: gowrishankar.m at linux.vnet.ibm.com
> Cc: stable at 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 <dariusz.stojaczyk at intel.com>
> ---
<snip>
> + if (internal_config.process_type == RTE_PROC_PRIMARY) {
> + /* if we were secondary process we would try requesting
> + * container fd from the primary, but we're the primary
> + * process so just exit here
> + */
> + return -1;
> + }
> +
> + p->req = SOCKET_REQ_DEFAULT_CONTAINER;
> + strcpy(mp_req.name, EAL_VFIO_MP);
strlcpy?
Otherwise,
Reviewed-by: Anatoly Burakov <anatoly.burakov at intel.com>
--
Thanks,
Anatoly
More information about the dev
mailing list