From: Laszlo Ersek <lersek@redhat.com>
To: Gal Hammer <ghammer@redhat.com>
Cc: qemu-devel@nongnu.org
Subject: Re: [Qemu-devel] [PATCH] virtio: Do not notify virtqueue if no element was pushed back.
Date: Mon, 05 Aug 2013 13:49:04 +0200 [thread overview]
Message-ID: <51FF9130.3030201@redhat.com> (raw)
In-Reply-To: <1375690705-17266-1-git-send-email-ghammer@redhat.com>
On 08/05/13 10:18, Gal Hammer wrote:
> Signed-off-by: Gal Hammer <ghammer@redhat.com>
> ---
> hw/char/virtio-serial-bus.c | 6 +++++-
> 1 file changed, 5 insertions(+), 1 deletion(-)
>
> diff --git a/hw/char/virtio-serial-bus.c b/hw/char/virtio-serial-bus.c
> index da417c7..0d38b4b 100644
> --- a/hw/char/virtio-serial-bus.c
> +++ b/hw/char/virtio-serial-bus.c
> @@ -105,6 +105,7 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq,
> VirtIODevice *vdev)
> {
> VirtIOSerialPortClass *vsc;
> + bool elem_pushed = false;
>
> assert(port);
> assert(virtio_queue_ready(vq));
> @@ -145,9 +146,12 @@ static void do_flush_queued_data(VirtIOSerialPort *port, VirtQueue *vq,
> break;
> }
> virtqueue_push(vq, &port->elem, 0);
> + elem_pushed = true;
> port->elem.out_num = 0;
> }
> - virtio_notify(vdev, vq);
> + if (elem_pushed) {
> + virtio_notify(vdev, vq);
> + }
> }
>
> static void flush_queued_data(VirtIOSerialPort *port)
>
I could be missing something, but it looks good to me.
BTW the subject should say: "virtio-serial: ...", not generic "virtio: ...".
How did you catch this? Is this a performance problem, or did it expose
a guest driver bug? (The guest driver should be prepared for spurious
wakeups.)
Reviewed-by: Laszlo Ersek <lersek@redhat.com>
next prev parent reply other threads:[~2013-08-05 11:46 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2013-08-05 8:18 [Qemu-devel] [PATCH] virtio: Do not notify virtqueue if no element was pushed back Gal Hammer
2013-08-05 11:49 ` Laszlo Ersek [this message]
2013-08-05 12:07 ` Gal Hammer
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=51FF9130.3030201@redhat.com \
--to=lersek@redhat.com \
--cc=ghammer@redhat.com \
--cc=qemu-devel@nongnu.org \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
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).