search for: virtio_ring_f_event_idx

Displaying 20 results from an estimated 444 matches for "virtio_ring_f_event_idx".

2013 May 07
1
[PATCH] vhost-scsi: Enable VIRTIO_RING_F_EVENT_IDX
...> --- drivers/vhost/scsi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index d860b58..5531ebc 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -160,14 +160,8 @@ enum { VHOST_SCSI_VQ_IO = 2, }; -/* - * VIRTIO_RING_F_EVENT_IDX seems broken. Not sure the bug is in - * kernel but disabling it helps. - * TODO: debug and remove the workaround. - */ enum { - VHOST_SCSI_FEATURES = (VHOST_FEATURES & (~VIRTIO_RING_F_EVENT_IDX)) | - (1ULL << VIRTIO_SCSI_F_HOTPLUG) + VHOST_SCSI_FEATURES = VHOST_FEATURES | (1ULL...
2013 May 07
1
[PATCH] vhost-scsi: Enable VIRTIO_RING_F_EVENT_IDX
...> --- drivers/vhost/scsi.c | 8 +------- 1 file changed, 1 insertion(+), 7 deletions(-) diff --git a/drivers/vhost/scsi.c b/drivers/vhost/scsi.c index d860b58..5531ebc 100644 --- a/drivers/vhost/scsi.c +++ b/drivers/vhost/scsi.c @@ -160,14 +160,8 @@ enum { VHOST_SCSI_VQ_IO = 2, }; -/* - * VIRTIO_RING_F_EVENT_IDX seems broken. Not sure the bug is in - * kernel but disabling it helps. - * TODO: debug and remove the workaround. - */ enum { - VHOST_SCSI_FEATURES = (VHOST_FEATURES & (~VIRTIO_RING_F_EVENT_IDX)) | - (1ULL << VIRTIO_SCSI_F_HOTPLUG) + VHOST_SCSI_FEATURES = VHOST_FEATURES | (1ULL...
2014 Dec 11
0
[PATCH RFC v6 04/20] virtio: add feature checking helpers
...rtio/dataplane/vring.c +++ b/hw/virtio/dataplane/vring.c @@ -103,7 +103,7 @@ void vring_teardown(Vring *vring, VirtIODevice *vdev, int n) /* Disable guest->host notifies */ void vring_disable_notification(VirtIODevice *vdev, Vring *vring) { - if (!(vdev->guest_features & (1 << VIRTIO_RING_F_EVENT_IDX))) { + if (!virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX)) { vring->vr.used->flags |= VRING_USED_F_NO_NOTIFY; } } @@ -114,7 +114,7 @@ void vring_disable_notification(VirtIODevice *vdev, Vring *vring) */ bool vring_enable_notification(VirtIODevice *vdev, Vring *vring)...
2014 Dec 11
0
[PATCH RFC v6 04/20] virtio: add feature checking helpers
...rtio/dataplane/vring.c +++ b/hw/virtio/dataplane/vring.c @@ -103,7 +103,7 @@ void vring_teardown(Vring *vring, VirtIODevice *vdev, int n) /* Disable guest->host notifies */ void vring_disable_notification(VirtIODevice *vdev, Vring *vring) { - if (!(vdev->guest_features & (1 << VIRTIO_RING_F_EVENT_IDX))) { + if (!virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX)) { vring->vr.used->flags |= VRING_USED_F_NO_NOTIFY; } } @@ -114,7 +114,7 @@ void vring_disable_notification(VirtIODevice *vdev, Vring *vring) */ bool vring_enable_notification(VirtIODevice *vdev, Vring *vring)...
2019 Mar 06
1
[PATCH] vhost: silence an unused-variable warning
...the MMU can be disabled, leading to access_ok() becoming an empty macro that does not evaluate its size argument, which in turn produces an unused-variable warning: drivers/vhost/vhost.c:1191:9: error: unused variable 's' [-Werror,-Wunused-variable] size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; Mark the variable as __maybe_unused to shut up that warning. Signed-off-by: Arnd Bergmann <arnd at arndb.de> --- drivers/vhost/vhost.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index a2e5dc7716e2..5ace833de74...
2014 Jun 05
2
[PATCH 1/2] vhost: move acked_features to VQs
...return 1; } -static int vq_access_ok(struct vhost_dev *d, unsigned int num, +static int vq_access_ok(struct vhost_virtqueue *vq, unsigned int num, struct vring_desc __user *desc, struct vring_avail __user *avail, struct vring_used __user *used) { - size_t s = vhost_has_feature(d, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; + size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; return access_ok(VERIFY_READ, desc, num * sizeof *desc) && access_ok(VERIFY_READ, avail, sizeof *avail + num * sizeof *avail->ring + s) && @@ -565,16 +567,16 @@ EXPORT_SYMBOL_GPL(vhost_...
2014 Jun 05
2
[PATCH 1/2] vhost: move acked_features to VQs
...return 1; } -static int vq_access_ok(struct vhost_dev *d, unsigned int num, +static int vq_access_ok(struct vhost_virtqueue *vq, unsigned int num, struct vring_desc __user *desc, struct vring_avail __user *avail, struct vring_used __user *used) { - size_t s = vhost_has_feature(d, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; + size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; return access_ok(VERIFY_READ, desc, num * sizeof *desc) && access_ok(VERIFY_READ, avail, sizeof *avail + num * sizeof *avail->ring + s) && @@ -565,16 +567,16 @@ EXPORT_SYMBOL_GPL(vhost_...
2014 Sep 19
2
[PATCH RFC 2/2] vhost: support urgent descriptors
...ivers/vhost/vhost.h [...] > EXPORT_SYMBOL_GPL(vhost_add_used_n); > @@ -1433,12 +1439,13 @@ static bool vhost_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) > unlikely(vq->avail_idx == vq->last_avail_idx)) > return true; > > - if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { > + if (vq->urgent || !vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { So the urgent descriptor only work when event index was not enabled? This seems suboptimal, we may still want to benefit from event index even if urgent descriptor is used. Looks like we need return true here when v...
2014 Sep 19
2
[PATCH RFC 2/2] vhost: support urgent descriptors
...ivers/vhost/vhost.h [...] > EXPORT_SYMBOL_GPL(vhost_add_used_n); > @@ -1433,12 +1439,13 @@ static bool vhost_notify(struct vhost_dev *dev, struct vhost_virtqueue *vq) > unlikely(vq->avail_idx == vq->last_avail_idx)) > return true; > > - if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { > + if (vq->urgent || !vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { So the urgent descriptor only work when event index was not enabled? This seems suboptimal, we may still want to benefit from event index even if urgent descriptor is used. Looks like we need return true here when v...
2019 Mar 06
0
[RFC PATCH V2 4/5] vhost: introduce helpers to get the size of metadata area
...0644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -413,6 +413,27 @@ static void vhost_dev_free_iovecs(struct vhost_dev *dev) vhost_vq_free_iovecs(dev->vqs[i]); } +static size_t vhost_get_avail_size(struct vhost_virtqueue *vq, int num) +{ + size_t event = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; + + return sizeof(*vq->avail) + + sizeof(*vq->avail->ring) * num + event; +} + +static size_t vhost_get_used_size(struct vhost_virtqueue *vq, int num) +{ + size_t event = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; + + return sizeof(*vq->used) + + siz...
2019 Mar 07
0
[RFC PATCH V2 4/5] vhost: introduce helpers to get the size of metadata area
...13,27 @@ static void vhost_dev_free_iovecs(struct vhost_dev *dev) >> vhost_vq_free_iovecs(dev->vqs[i]); >> } >> >> +static size_t vhost_get_avail_size(struct vhost_virtqueue *vq, int num) >> +{ >> + size_t event = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; >> + >> + return sizeof(*vq->avail) + >> + sizeof(*vq->avail->ring) * num + event; >> +} >> + >> +static size_t vhost_get_used_size(struct vhost_virtqueue *vq, int num) >> +{ >> + size_t event = vhost_has_fe...
2019 Mar 06
1
[RFC PATCH V2 4/5] vhost: introduce helpers to get the size of metadata area
...tatic void vhost_dev_free_iovecs(struct vhost_dev *dev) > vhost_vq_free_iovecs(dev->vqs[i]); > } > > +static size_t vhost_get_avail_size(struct vhost_virtqueue *vq, int num) Nit: Any reason not to make `num` unsigned or size_t? > +{ > + size_t event = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; > + > + return sizeof(*vq->avail) + > + sizeof(*vq->avail->ring) * num + event; > +} > + > +static size_t vhost_get_used_size(struct vhost_virtqueue *vq, int num) > +{ > + size_t event = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; > +...
2019 Mar 06
1
[RFC PATCH V2 4/5] vhost: introduce helpers to get the size of metadata area
...tatic void vhost_dev_free_iovecs(struct vhost_dev *dev) > vhost_vq_free_iovecs(dev->vqs[i]); > } > > +static size_t vhost_get_avail_size(struct vhost_virtqueue *vq, int num) Nit: Any reason not to make `num` unsigned or size_t? > +{ > + size_t event = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; > + > + return sizeof(*vq->avail) + > + sizeof(*vq->avail->ring) * num + event; > +} > + > +static size_t vhost_get_used_size(struct vhost_virtqueue *vq, int num) > +{ > + size_t event = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; > +...
2014 Sep 22
2
[PATCH RFC 2/2] vhost: support urgent descriptors
On 09/20/2014 06:00 PM, Paolo Bonzini wrote: > Il 19/09/2014 09:10, Jason Wang ha scritto: >>>> >>>> - if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { >>>> + if (vq->urgent || !vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { >> So the urgent descriptor only work when event index was not enabled? >> This seems suboptimal, we may still want to benefit from event index >> even if urgent descriptor is used. Look...
2014 Sep 22
2
[PATCH RFC 2/2] vhost: support urgent descriptors
On 09/20/2014 06:00 PM, Paolo Bonzini wrote: > Il 19/09/2014 09:10, Jason Wang ha scritto: >>>> >>>> - if (!vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { >>>> + if (vq->urgent || !vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX)) { >> So the urgent descriptor only work when event index was not enabled? >> This seems suboptimal, we may still want to benefit from event index >> even if urgent descriptor is used. Look...
2014 Oct 07
1
[PATCH RFC 03/11] virtio: support more feature bits
...rtio/dataplane/vring.c +++ b/hw/virtio/dataplane/vring.c @@ -103,7 +103,7 @@ void vring_teardown(Vring *vring, VirtIODevice *vdev, int n) /* Disable guest->host notifies */ void vring_disable_notification(VirtIODevice *vdev, Vring *vring) { - if (!(vdev->guest_features & (1 << VIRTIO_RING_F_EVENT_IDX))) { + if (!(vdev->guest_features[0] & (1 << VIRTIO_RING_F_EVENT_IDX))) { vring->vr.used->flags |= VRING_USED_F_NO_NOTIFY; } } @@ -114,7 +114,7 @@ void vring_disable_notification(VirtIODevice *vdev, Vring *vring) */ bool vring_enable_notification(VirtIODevice...
2014 Oct 07
1
[PATCH RFC 03/11] virtio: support more feature bits
...rtio/dataplane/vring.c +++ b/hw/virtio/dataplane/vring.c @@ -103,7 +103,7 @@ void vring_teardown(Vring *vring, VirtIODevice *vdev, int n) /* Disable guest->host notifies */ void vring_disable_notification(VirtIODevice *vdev, Vring *vring) { - if (!(vdev->guest_features & (1 << VIRTIO_RING_F_EVENT_IDX))) { + if (!(vdev->guest_features[0] & (1 << VIRTIO_RING_F_EVENT_IDX))) { vring->vr.used->flags |= VRING_USED_F_NO_NOTIFY; } } @@ -114,7 +114,7 @@ void vring_disable_notification(VirtIODevice *vdev, Vring *vring) */ bool vring_enable_notification(VirtIODevice...
2014 Nov 27
1
[PATCH RFC v4 03/16] virtio: support more feature bits
...rtio/dataplane/vring.c +++ b/hw/virtio/dataplane/vring.c @@ -103,7 +103,7 @@ void vring_teardown(Vring *vring, VirtIODevice *vdev, int n) /* Disable guest->host notifies */ void vring_disable_notification(VirtIODevice *vdev, Vring *vring) { - if (!(vdev->guest_features & (1 << VIRTIO_RING_F_EVENT_IDX))) { + if (!(vdev->guest_features[0] & (1 << VIRTIO_RING_F_EVENT_IDX))) { vring->vr.used->flags |= VRING_USED_F_NO_NOTIFY; } } @@ -114,7 +114,7 @@ void vring_disable_notification(VirtIODevice *vdev, Vring *vring) */ bool vring_enable_notification(VirtIODevice...
2014 Jun 05
1
[PATCH v2 1/2] vhost: move acked_features to VQs
...return 1; } -static int vq_access_ok(struct vhost_dev *d, unsigned int num, +static int vq_access_ok(struct vhost_virtqueue *vq, unsigned int num, struct vring_desc __user *desc, struct vring_avail __user *avail, struct vring_used __user *used) { - size_t s = vhost_has_feature(d, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; + size_t s = vhost_has_feature(vq, VIRTIO_RING_F_EVENT_IDX) ? 2 : 0; return access_ok(VERIFY_READ, desc, num * sizeof *desc) && access_ok(VERIFY_READ, avail, sizeof *avail + num * sizeof *avail->ring + s) && @@ -565,16 +567,16 @@ EXPORT_SYMBOL_GPL(vhost_...
2014 Nov 27
1
[PATCH RFC v4 03/16] virtio: support more feature bits
...rtio/dataplane/vring.c +++ b/hw/virtio/dataplane/vring.c @@ -103,7 +103,7 @@ void vring_teardown(Vring *vring, VirtIODevice *vdev, int n) /* Disable guest->host notifies */ void vring_disable_notification(VirtIODevice *vdev, Vring *vring) { - if (!(vdev->guest_features & (1 << VIRTIO_RING_F_EVENT_IDX))) { + if (!(vdev->guest_features[0] & (1 << VIRTIO_RING_F_EVENT_IDX))) { vring->vr.used->flags |= VRING_USED_F_NO_NOTIFY; } } @@ -114,7 +114,7 @@ void vring_disable_notification(VirtIODevice *vdev, Vring *vring) */ bool vring_enable_notification(VirtIODevice...