[dpdk-dev] [PATCH] vfio: change default per vfio_cfg map all dpdk segments for DMA
Xia, Chenbo
chenbo.xia at intel.com
Tue Apr 6 07:24:00 CEST 2021
Hi, Yunjian
> -----Original Message-----
> From: dev <dev-bounces at dpdk.org> On Behalf Of wangyunjian
> Sent: Friday, May 15, 2020 7:02 PM
> To: dev at dpdk.org
> Cc: Burakov, Anatoly <anatoly.burakov at intel.com>; jerry.lilijun at huawei.com;
> xudingke at huawei.com; Yunjian Wang <wangyunjian at huawei.com>
> Subject: [dpdk-dev] [PATCH] vfio: change default per vfio_cfg map all dpdk
> segments for DMA
>
> From: Yunjian Wang <wangyunjian at huawei.com>
>
> As all vfio_cfgs need to map all dpdk segments for DMA, but now only
> default_vfio_cfg map it. This patch changes rte_vfio_setup_device()
> as a default map, so that IOMMU progrming does notneed to map dpdk
> segments separately.
>
> Signed-off-by: Yunjian Wang <wangyunjian at huawei.com>
> ---
> lib/librte_eal/linux/eal_vfio.c | 5 +----
> 1 file changed, 1 insertion(+), 4 deletions(-)
>
> diff --git a/lib/librte_eal/linux/eal_vfio.c b/lib/librte_eal/linux/eal_vfio.c
> index d26e1649a..46160c328 100644
> --- a/lib/librte_eal/linux/eal_vfio.c
> +++ b/lib/librte_eal/linux/eal_vfio.c
> @@ -807,10 +807,7 @@ rte_vfio_setup_device(const char *sysfs_base, const char
> *dev_addr,
> * after registering callback, to prevent races
> */
> rte_mcfg_mem_read_lock();
> - if (vfio_cfg == default_vfio_cfg)
> - ret = t->dma_map_func(vfio_container_fd);
> - else
> - ret = 0;
> + ret = t->dma_map_func(vfio_container_fd);
Anatoly is correct, this is intentional for ifc vdpa. For vdpa/ifc, we need another vfio container
for vdpa device and the dma map info comes from QEMU/virtio-user, so this container will not use dpdk
memsegs. Your patch will break current ifc vdpa driver.
Thanks,
Chenbo
> if (ret) {
> RTE_LOG(ERR, EAL,
> " %s DMA remapping failed, error %i (%s)\n",
> --
> 2.23.0
>
More information about the dev
mailing list