From: Stefan Hajnoczi <stefanha@gmail.com>
To: Bin Wu <wu.wubin@huawei.com>
Cc: pbonzini@redhat.com, famz@redhat.com, qemu-devel@nongnu.org,
mst@redhat.com
Subject: Re: [Qemu-devel] [PATCH v2] hw/virtio/vring/event_idx: fix the vring_avail_event error
Date: Fri, 31 Oct 2014 10:57:55 +0000 [thread overview]
Message-ID: <20141031105755.GA9532@stefanha-thinkpad.redhat.com> (raw)
In-Reply-To: <1414716016-18004-1-git-send-email-wu.wubin@huawei.com>
[-- Attachment #1: Type: text/plain, Size: 1045 bytes --]
On Fri, Oct 31, 2014 at 12:40:16AM +0000, Bin Wu wrote:
> The event idx in virtio is an effective way to reduce the number of
> interrupts and exits of the guest. When the guest puts an request
> into the virtio ring, it doesn't exit immediately to inform the
> backend. Instead, the guest checks the "avail" event idx to determine
> the notification.
>
> In virtqueue_pop, when a request is poped, the current avail event
> idx should be set to the number of vq->last_avail_idx.
>
> Signed-off-by: Bin Wu <wu.wubin@huawei.com>
> ---
> V2 -> V1:
> update the same code in hw/virtio/dataplane/vring.c (Stefan)
> ---
> hw/virtio/dataplane/vring.c | 8 ++++----
> hw/virtio/virtio.c | 2 +-
> 2 files changed, 5 insertions(+), 5 deletions(-)
Reviewed-by: Stefan Hajnoczi <stefanha@redhat.com>
By the way, did you see that kernel drivers/vhost/vhost.c doesn't update
the field for each pop? Instead it only updates when notify is
re-enabled. I wonder if that approach is better than what QEMU does.
Stefan
[-- Attachment #2: Type: application/pgp-signature, Size: 473 bytes --]
next prev parent reply other threads:[~2014-10-31 15:06 UTC|newest]
Thread overview: 3+ messages / expand[flat|nested] mbox.gz Atom feed top
2014-10-31 0:40 [Qemu-devel] [PATCH v2] hw/virtio/vring/event_idx: fix the vring_avail_event error Bin Wu
2014-10-31 10:57 ` Stefan Hajnoczi [this message]
2014-10-31 14:28 ` Michael S. Tsirkin
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=20141031105755.GA9532@stefanha-thinkpad.redhat.com \
--to=stefanha@gmail.com \
--cc=famz@redhat.com \
--cc=mst@redhat.com \
--cc=pbonzini@redhat.com \
--cc=qemu-devel@nongnu.org \
--cc=wu.wubin@huawei.com \
/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).