* [Qemu-devel] [6868] virtio: Allow guest to defer VIRTIO_F_NOTIFY_ON_EMPTY ( Alex Williamson)
@ 2009-03-20 16:18 Anthony Liguori
0 siblings, 0 replies; only message in thread
From: Anthony Liguori @ 2009-03-20 16:18 UTC (permalink / raw)
To: qemu-devel
Revision: 6868
http://svn.sv.gnu.org/viewvc/?view=rev&root=qemu&revision=6868
Author: aliguori
Date: 2009-03-20 16:18:45 +0000 (Fri, 20 Mar 2009)
Log Message:
-----------
virtio: Allow guest to defer VIRTIO_F_NOTIFY_ON_EMPTY (Alex Williamson)
There may be cases where the guest does not want the avail queue
interrupt, even when it's empty. For the virtio-net case, the
guest may use a different buffering scheme or decide polling for
used buffers is more efficient. This can be accomplished by simply
checking for whether the guest has acknowledged the existing notify
on empty flag.
Signed-off-by: Alex Williamson <alex.williamson@hp.com>
Signed-off-by: Anthony Liguori <aliguori@us.ibm.com>
Modified Paths:
--------------
branches/stable_0_10_0/hw/virtio.c
Modified: branches/stable_0_10_0/hw/virtio.c
===================================================================
--- branches/stable_0_10_0/hw/virtio.c 2009-03-20 16:18:39 UTC (rev 6867)
+++ branches/stable_0_10_0/hw/virtio.c 2009-03-20 16:18:45 UTC (rev 6868)
@@ -726,9 +726,10 @@
void virtio_notify(VirtIODevice *vdev, VirtQueue *vq)
{
- /* Always notify when queue is empty */
- if ((vq->inuse || vring_avail_idx(vq) != vq->last_avail_idx) &&
- (vring_avail_flags(vq) & VRING_AVAIL_F_NO_INTERRUPT))
+ /* Always notify when queue is empty (when feature acknowledge) */
+ if ((vring_avail_flags(vq) & VRING_AVAIL_F_NO_INTERRUPT) &&
+ (!(vdev->features & (1 << VIRTIO_F_NOTIFY_ON_EMPTY)) ||
+ (vq->inuse || vring_avail_idx(vq) != vq->last_avail_idx)))
return;
vdev->isr |= 0x01;
^ permalink raw reply [flat|nested] only message in thread
only message in thread, other threads:[~2009-03-20 16:18 UTC | newest]
Thread overview: (only message) (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2009-03-20 16:18 [Qemu-devel] [6868] virtio: Allow guest to defer VIRTIO_F_NOTIFY_ON_EMPTY ( Alex Williamson) Anthony Liguori
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).