Skip to contentSkip to conversation

notify io_thread at the end of rx handling

PATCH In review Glauber Costa 2 participants 2 messages Jul 20, 2009

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 notify io_thread at the end of rx handling

This is a backport from qemu-kvm. Just instead of using kvm's specific notification mechanism, we use qemu_notify_event()

---
 hw/virtio-net.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
hw/virtio-net.c +4 -0
index 7a7eafe..218f985 100644
@@ -305,6 +305,10 @@ static void virtio_net_handle_rx(VirtIODevice *vdev, VirtQueue *vq)
     VirtIONet *n = to_virtio_net(vdev);
 
     qemu_flush_queued_packets(n->vc);
+
+    /* We now have RX buffers, signal to the IO thread to break out of the
+     * select to re-poll the tap file descriptor */
+    qemu_notify_event();
 }
 
 static int do_virtio_net_can_receive(VirtIONet *n, int bufsize)
Signature · 1 line
1.6.2.2
Acked-by on v1 1/1
#1 lore raw
Quoted 13 lines · Glauber Costa

This is a backport from qemu-kvm. Just instead of using kvm's specific notification mechanism, we use qemu_notify_event()

---
 hw/virtio-net.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
hw/virtio-net.c +0 -0
index 7a7eafe..218f985 100644

hw/virtio-net.c static void virtio_net_handle_rx(VirtIODevice *vdev, VirtQueue *vq) · line 312

Quoted 8 lines
hw/virtio-net.c +4 -0
@@ -305,6 +305,10 @@ static void virtio_net_handle_rx(VirtIODevice *vdev, VirtQueue *vq)
     VirtIONet *n = to_virtio_net(vdev);
 
     qemu_flush_queued_packets(n->vc);
+
+    /* We now have RX buffers, signal to the IO thread to break out of the
+     * select to re-poll the tap file descriptor */
+    qemu_notify_event();
 }

Looks good to me

Cheers,
Mark.