[PATCH v4 2/2] virtio-net: pass Device-TLB enable/disable events to vhost

Viktor Prutyanov posted 2 patches 1 year, 3 months ago
Maintainers: "Michael S. Tsirkin" <mst@redhat.com>, Jason Wang <jasowang@redhat.com>
There is a newer version of this series
[PATCH v4 2/2] virtio-net: pass Device-TLB enable/disable events to vhost
Posted by Viktor Prutyanov 1 year, 3 months ago
If vhost is enabled for virtio-net, Device-TLB enable/disable events
must be passed to vhost for proper IOMMU unmap flag selection.

Signed-off-by: Viktor Prutyanov <viktor@daynix.com>
---
 hw/net/virtio-net.c | 1 +
 1 file changed, 1 insertion(+)

diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
index 6df6b7329d..30497c00b5 100644
--- a/hw/net/virtio-net.c
+++ b/hw/net/virtio-net.c
@@ -3951,6 +3951,7 @@ static void virtio_net_class_init(ObjectClass *klass, void *data)
     vdc->vmsd = &vmstate_virtio_net_device;
     vdc->primary_unplug_pending = primary_unplug_pending;
     vdc->get_vhost = virtio_net_get_vhost;
+    vdc->toggle_device_iotlb = vhost_toggle_device_iotlb;
 }
 
 static const TypeInfo virtio_net_info = {
-- 
2.21.0
Re: [PATCH v4 2/2] virtio-net: pass Device-TLB enable/disable events to vhost
Posted by Jason Wang 1 year, 3 months ago
On Thu, May 25, 2023 at 8:58 PM Viktor Prutyanov <viktor@daynix.com> wrote:
>
> If vhost is enabled for virtio-net, Device-TLB enable/disable events
> must be passed to vhost for proper IOMMU unmap flag selection.
>
> Signed-off-by: Viktor Prutyanov <viktor@daynix.com>

Acked-by: Jason Wang <jasowang@redhat.com>

Thanks

> ---
>  hw/net/virtio-net.c | 1 +
>  1 file changed, 1 insertion(+)
>
> diff --git a/hw/net/virtio-net.c b/hw/net/virtio-net.c
> index 6df6b7329d..30497c00b5 100644
> --- a/hw/net/virtio-net.c
> +++ b/hw/net/virtio-net.c
> @@ -3951,6 +3951,7 @@ static void virtio_net_class_init(ObjectClass *klass, void *data)
>      vdc->vmsd = &vmstate_virtio_net_device;
>      vdc->primary_unplug_pending = primary_unplug_pending;
>      vdc->get_vhost = virtio_net_get_vhost;
> +    vdc->toggle_device_iotlb = vhost_toggle_device_iotlb;
>  }
>
>  static const TypeInfo virtio_net_info = {
> --
> 2.21.0
>