[dpdk-dev] [PATCH v5 2/2] vhost: enable IOMMU for async vhost

Ding, Xuan xuan.ding at intel.com
Tue Sep 28 11:03:19 CEST 2021


Hi Anatoly,

> -----Original Message-----
> From: Burakov, Anatoly <anatoly.burakov at intel.com>
> Sent: Monday, September 27, 2021 8:14 PM
> To: Ding, Xuan <xuan.ding at intel.com>; dev at dpdk.org;
> maxime.coquelin at redhat.com; Xia, Chenbo <chenbo.xia at intel.com>
> Cc: Hu, Jiayu <jiayu.hu at intel.com>; Jiang, Cheng1 <cheng1.jiang at intel.com>;
> Richardson, Bruce <bruce.richardson at intel.com>; Pai G, Sunil
> <sunil.pai.g at intel.com>; Wang, Yinan <yinan.wang at intel.com>; Yang, YvonneX
> <yvonnex.yang at intel.com>
> Subject: Re: [PATCH v5 2/2] vhost: enable IOMMU for async vhost
> 
> On 27-Sep-21 8:48 AM, Xuan Ding wrote:
> > The use of IOMMU has many advantages, such as isolation and address
> > translation. This patch extends the capbility of DMA engine to use
> > IOMMU if the DMA engine is bound to vfio.
> >
> > When set memory table, the guest memory will be mapped
> > into the default container of DPDK.
> >
> > Signed-off-by: Xuan Ding <xuan.ding at intel.com>
> > ---
> 
> 
> >   	/* Flush IOTLB cache as previous HVAs are now invalid */
> > @@ -1329,6 +1424,17 @@ vhost_user_set_mem_table(struct virtio_net
> **pdev, struct VhostUserMsg *msg,
> >   		goto free_guest_pages;
> >   	}
> >
> > +	if (dev->async_copy) {
> > +		dev->async_map_status = rte_zmalloc_socket("async-dma-
> map-status",
> > +					sizeof(bool) * memory->nregions, 0,
> numa_node);
> 
> Would it be useful to sanity check this to make sure we're not leaking
> memory?

Thanks for the catch, will add the check in next version.

Regards,
Xuan

> 
> --
> Thanks,
> Anatoly


More information about the dev mailing list