[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]
[Qemu-devel] [PATCH 09/40] vring: make vring_enable_notification return
From: |
Paolo Bonzini |
Subject: |
[Qemu-devel] [PATCH 09/40] vring: make vring_enable_notification return void |
Date: |
Tue, 24 Nov 2015 19:01:00 +0100 |
Make the API more similar to the regular virtqueue API.
Signed-off-by: Paolo Bonzini <address@hidden>
---
hw/block/dataplane/virtio-blk.c | 3 ++-
hw/virtio/dataplane/vring.c | 3 +--
include/hw/virtio/dataplane/vring.h | 2 +-
3 files changed, 4 insertions(+), 4 deletions(-)
diff --git a/hw/block/dataplane/virtio-blk.c b/hw/block/dataplane/virtio-blk.c
index 0cadd3a..ace36f5 100644
--- a/hw/block/dataplane/virtio-blk.c
+++ b/hw/block/dataplane/virtio-blk.c
@@ -126,7 +126,8 @@ static void handle_notify(EventNotifier *e)
/* Re-enable guest->host notifies and stop processing the vring.
* But if the guest has snuck in more descriptors, keep processing.
*/
- if (vring_enable_notification(s->vdev, &s->vring)) {
+ vring_enable_notification(s->vdev, &s->vring);
+ if (!vring_more_avail(s->vdev, &s->vring)) {
break;
}
} else { /* fatal error */
diff --git a/hw/virtio/dataplane/vring.c b/hw/virtio/dataplane/vring.c
index d6b8ba9..4e1a299 100644
--- a/hw/virtio/dataplane/vring.c
+++ b/hw/virtio/dataplane/vring.c
@@ -174,7 +174,7 @@ void vring_disable_notification(VirtIODevice *vdev, Vring
*vring)
*
* Return true if the vring is empty, false if there are more requests.
*/
-bool vring_enable_notification(VirtIODevice *vdev, Vring *vring)
+void vring_enable_notification(VirtIODevice *vdev, Vring *vring)
{
if (virtio_vdev_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX)) {
vring_avail_event(&vring->vr) = vring->vr.avail->idx;
@@ -182,7 +182,6 @@ bool vring_enable_notification(VirtIODevice *vdev, Vring
*vring)
vring_clear_used_flags(vdev, vring, VRING_USED_F_NO_NOTIFY);
}
smp_mb(); /* ensure update is seen before reading avail_idx */
- return !vring_more_avail(vdev, vring);
}
/* This is stolen from linux/drivers/vhost/vhost.c:vhost_notify() */
diff --git a/include/hw/virtio/dataplane/vring.h
b/include/hw/virtio/dataplane/vring.h
index e80985e..e1c2a65 100644
--- a/include/hw/virtio/dataplane/vring.h
+++ b/include/hw/virtio/dataplane/vring.h
@@ -42,7 +42,7 @@ static inline void vring_set_broken(Vring *vring)
bool vring_setup(Vring *vring, VirtIODevice *vdev, int n);
void vring_teardown(Vring *vring, VirtIODevice *vdev, int n);
void vring_disable_notification(VirtIODevice *vdev, Vring *vring);
-bool vring_enable_notification(VirtIODevice *vdev, Vring *vring);
+void vring_enable_notification(VirtIODevice *vdev, Vring *vring);
bool vring_should_notify(VirtIODevice *vdev, Vring *vring);
void *vring_pop(VirtIODevice *vdev, Vring *vring, size_t sz);
void vring_push(VirtIODevice *vdev, Vring *vring, VirtQueueElement *elem,
--
1.8.3.1
- Re: [Qemu-devel] [PATCH 01/40] 9pfs: allocate pdus with g_malloc/g_free, (continued)
- [Qemu-devel] [PATCH 02/40] virtio: move VirtQueueElement at the beginning of the structs, Paolo Bonzini, 2015/11/24
- [Qemu-devel] [PATCH 06/40] virtio: introduce virtqueue_alloc_element, Paolo Bonzini, 2015/11/24
- [Qemu-devel] [PATCH 03/40] virtio: move allocation to virtqueue_pop/vring_pop, Paolo Bonzini, 2015/11/24
- [Qemu-devel] [PATCH 04/40] virtio: introduce qemu_get/put_virtqueue_element, Paolo Bonzini, 2015/11/24
- [Qemu-devel] [PATCH 07/40] virtio: slim down allocation of VirtQueueElements, Paolo Bonzini, 2015/11/24
- [Qemu-devel] [PATCH 08/40] vring: slim down allocation of VirtQueueElements, Paolo Bonzini, 2015/11/24
- [Qemu-devel] [PATCH 09/40] vring: make vring_enable_notification return void,
Paolo Bonzini <=
- [Qemu-devel] [PATCH 13/40] virtio-blk: fix "disabled data plane" mode, Paolo Bonzini, 2015/11/24
- [Qemu-devel] [PATCH 05/40] virtio: read/write the VirtQueueElement a field at a time, Paolo Bonzini, 2015/11/24
- [Qemu-devel] [PATCH 12/40] virtio: export vring_notify as virtio_should_notify, Paolo Bonzini, 2015/11/24
- [Qemu-devel] [PATCH 10/40] virtio: combine the read of a descriptor, Paolo Bonzini, 2015/11/24
- [Qemu-devel] [PATCH 11/40] virtio: add AioContext-specific function for host notifiers, Paolo Bonzini, 2015/11/24
- [Qemu-devel] [PATCH 14/40] virtio-blk: do not use vring in dataplane, Paolo Bonzini, 2015/11/24
- [Qemu-devel] [PATCH 15/40] virtio-scsi: do not use vring in dataplane, Paolo Bonzini, 2015/11/24
- [Qemu-devel] [PATCH 16/40] vring: remove, Paolo Bonzini, 2015/11/24