qemu-devel.nongnu.org archive mirror
 help / color / mirror / Atom feed
* [Qemu-devel] [PATCH] notify io_thread at the end of rx handling
@ 2009-07-20 17:07 Glauber Costa
  2009-07-20 18:15 ` Mark McLoughlin
  0 siblings, 1 reply; 2+ messages in thread
From: Glauber Costa @ 2009-07-20 17:07 UTC (permalink / raw)
  To: qemu-devel; +Cc: aliguori

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

Signed-off-by: Glauber Costa <glommer@redhat.com>
---
 hw/virtio-net.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)

diff --git a/hw/virtio-net.c b/hw/virtio-net.c
index 7a7eafe..218f985 100644
--- a/hw/virtio-net.c
+++ b/hw/virtio-net.c
@@ -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)
-- 
1.6.2.2

^ permalink raw reply related	[flat|nested] 2+ messages in thread

* Re: [Qemu-devel] [PATCH] notify io_thread at the end of rx handling
  2009-07-20 17:07 [Qemu-devel] [PATCH] notify io_thread at the end of rx handling Glauber Costa
@ 2009-07-20 18:15 ` Mark McLoughlin
  0 siblings, 0 replies; 2+ messages in thread
From: Mark McLoughlin @ 2009-07-20 18:15 UTC (permalink / raw)
  To: Glauber Costa; +Cc: aliguori, qemu-devel

On Mon, 2009-07-20 at 13:07 -0400, Glauber Costa wrote:
> This is a backport from qemu-kvm. Just instead of using kvm's specific
> notification mechanism, we use qemu_notify_event()
> 
> Signed-off-by: Glauber Costa <glommer@redhat.com>
> ---
>  hw/virtio-net.c |    4 ++++
>  1 files changed, 4 insertions(+), 0 deletions(-)
> 
> diff --git a/hw/virtio-net.c b/hw/virtio-net.c
> index 7a7eafe..218f985 100644
> --- a/hw/virtio-net.c
> +++ b/hw/virtio-net.c
> @@ -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

Acked-by: Mark McLoughlin <markmc@redhat.com>

Cheers,
Mark.

^ permalink raw reply	[flat|nested] 2+ messages in thread

end of thread, other threads:[~2009-07-20 18:16 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-07-20 17:07 [Qemu-devel] [PATCH] notify io_thread at the end of rx handling Glauber Costa
2009-07-20 18:15 ` Mark McLoughlin

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).