> -----Original Message----- > From: Maxime Coquelin <maxime.coque...@redhat.com> > Sent: Friday, May 26, 2023 12:26 AM > To: dev@dpdk.org; Xia, Chenbo <chenbo....@intel.com>; > david.march...@redhat.com; m...@redhat.com; f...@redhat.com; > jasow...@redhat.com; Liang, Cunming <cunming.li...@intel.com>; Xie, Yongji > <xieyon...@bytedance.com>; echau...@redhat.com; epere...@redhat.com; > amore...@redhat.com; l...@redhat.com > Cc: Maxime Coquelin <maxime.coque...@redhat.com> > Subject: [PATCH v3 20/28] vhost: add VDUSE callback for IOTLB entry > removal > > This patch implements the VDUSE callback for IOTLB entry > removal, where it unmaps the pages from the invalidated > IOTLB entry. > > Signed-off-by: Maxime Coquelin <maxime.coque...@redhat.com> > --- > lib/vhost/vduse.c | 7 +++++++ > 1 file changed, 7 insertions(+) > > diff --git a/lib/vhost/vduse.c b/lib/vhost/vduse.c > index f72c7bf6ab..58c1b384a8 100644 > --- a/lib/vhost/vduse.c > +++ b/lib/vhost/vduse.c > @@ -42,6 +42,12 @@ > (1ULL << VIRTIO_F_IN_ORDER) | \ > (1ULL << VIRTIO_F_IOMMU_PLATFORM)) > > +static void > +vduse_iotlb_remove_notify(uint64_t addr, uint64_t offset, uint64_t size) > +{ > + munmap((void *)(uintptr_t)addr, offset + size); > +} > + > static int > vduse_iotlb_miss(struct virtio_net *dev, uint64_t iova, uint8_t perm > __rte_unused) > { > @@ -99,6 +105,7 @@ vduse_iotlb_miss(struct virtio_net *dev, uint64_t iova, > uint8_t perm __rte_unuse > > static struct vhost_backend_ops vduse_backend_ops = { > .iotlb_miss = vduse_iotlb_miss, > + .iotlb_remove_notify = vduse_iotlb_remove_notify, > }; > > int > -- > 2.40.1
Reviewed-by: Chenbo Xia <chenbo....@intel.com>