search for: __vring_new_virtqueue

Displaying 20 results from an estimated 104 matches for "__vring_new_virtqueue".

2020 Apr 16
0
[PATCH v2 5/8] tools/virtio: Use __vring_new_virtqueue in virtio_test.c
...(&info->vring, num, info->ring, 4096); > - info->vq = vring_new_virtqueue(info->idx, > - info->vring.num, 4096, &dev->vdev, > - true, false, info->ring, > - vq_notify, vq_callback, "test"); > + info->vq = > + __vring_new_virtqueue(info->idx, info->vring, &dev->vdev, true, > + false, vq_notify, vq_callback, "test"); > assert(info->vq); > info->vq->priv = info; > vhost_vq_setup(dev, info); > -- > 2.18.1
2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
...adds two new improved APIs: > > vring_create_virtqueue: Creates a virtqueue backed by automatically > allocated coherent memory. (Some day it this could be extended to > support non-coherent memory, too, if there ends up being a platform > on which it's worthwhile.) > > __vring_new_virtqueue: Creates a virtqueue with a manually-specified > layout. This should allow mic_virtio to work much more cleanly. > > Signed-off-by: Andy Lutomirski <luto at kernel.org> > --- > drivers/virtio/virtio_ring.c | 178 +++++++++++++++++++++++++++++++++++-------- > include/linux...
2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
...adds two new improved APIs: > > vring_create_virtqueue: Creates a virtqueue backed by automatically > allocated coherent memory. (Some day it this could be extended to > support non-coherent memory, too, if there ends up being a platform > on which it's worthwhile.) > > __vring_new_virtqueue: Creates a virtqueue with a manually-specified > layout. This should allow mic_virtio to work much more cleanly. > > Signed-off-by: Andy Lutomirski <luto at kernel.org> > --- > drivers/virtio/virtio_ring.c | 178 +++++++++++++++++++++++++++++++++++-------- > include/linux...
2016 Feb 01
0
[PATCH v6 6/9] virtio: Add improved queue allocation API
...ueue alone for compatbility, but it adds two new improved APIs: vring_create_virtqueue: Creates a virtqueue backed by automatically allocated coherent memory. (Some day it this could be extended to support non-coherent memory, too, if there ends up being a platform on which it's worthwhile.) __vring_new_virtqueue: Creates a virtqueue with a manually-specified layout. This should allow mic_virtio to work much more cleanly. Signed-off-by: Andy Lutomirski <luto at kernel.org> --- drivers/virtio/virtio_ring.c | 178 +++++++++++++++++++++++++++++++++++-------- include/linux/virtio.h | 23 +++++-...
2020 Mar 06
1
[PATCH] virtio_ring: Fix mem leak with vring_new_virtqueue()
On 2/25/20 9:13 PM, Jason Wang wrote: > > On 2020/2/26 ??12:51, Suman Anna wrote: >> Hi Jason, >> >> On 2/24/20 11:39 PM, Jason Wang wrote: >>> On 2020/2/25 ??5:26, Suman Anna wrote: >>>> The functions vring_new_virtqueue() and __vring_new_virtqueue() are >>>> used >>>> with split rings, and any allocations within these functions are >>>> managed >>>> outside of the .we_own_ring flag. The commit cbeedb72b97a >>>> ("virtio_ring: >>>> allocate desc state for split ring...
2018 Sep 07
3
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...etach_unused_buf_packed(_vq) : > + virtqueue_detach_unused_buf_split(_vq); > } > EXPORT_SYMBOL_GPL(virtqueue_detach_unused_buf); > > @@ -954,7 +1166,8 @@ irqreturn_t vring_interrupt(int irq, void *_vq) > EXPORT_SYMBOL_GPL(vring_interrupt); > > struct virtqueue *__vring_new_virtqueue(unsigned int index, > - struct vring vring, > + union vring_union vring, > + bool packed, > struct virtio_device *vdev, > bool weak_barriers, > bool context, > @@ -962,19 +1175,22 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, >...
2018 Sep 07
3
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...etach_unused_buf_packed(_vq) : > + virtqueue_detach_unused_buf_split(_vq); > } > EXPORT_SYMBOL_GPL(virtqueue_detach_unused_buf); > > @@ -954,7 +1166,8 @@ irqreturn_t vring_interrupt(int irq, void *_vq) > EXPORT_SYMBOL_GPL(vring_interrupt); > > struct virtqueue *__vring_new_virtqueue(unsigned int index, > - struct vring vring, > + union vring_union vring, > + bool packed, > struct virtio_device *vdev, > bool weak_barriers, > bool context, > @@ -962,19 +1175,22 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, >...
2018 Sep 12
1
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...eue *vring_new_virtqueue(unsigned int index, > > > void (*callback)(struct virtqueue *vq), > > > const char *name) > > > { > > > - struct vring vring; > > > - vring_init(&vring, num, pages, vring_align); > > > - return __vring_new_virtqueue(index, vring, vdev, weak_barriers, context, > > > - notify, callback, name); > > > + union vring_union vring; > > > + bool packed; > > > + > > > + packed = virtio_has_feature(vdev, VIRTIO_F_RING_PACKED); > > > + if (packed) > > &gt...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...ON(vq->vq.num_free != (vq->packed ? vq->vring_packed.num : > + vq->vring.num)); > > END_USE(vq); > return NULL; > @@ -957,7 +1423,8 @@ irqreturn_t vring_interrupt(int irq, void *_vq) > EXPORT_SYMBOL_GPL(vring_interrupt); > > struct virtqueue *__vring_new_virtqueue(unsigned int index, > - struct vring vring, > + union vring_union vring, > + bool packed, > struct virtio_device *vdev, > bool weak_barriers, > bool context, > @@ -965,19 +1432,20 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, &g...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...ON(vq->vq.num_free != (vq->packed ? vq->vring_packed.num : > + vq->vring.num)); > > END_USE(vq); > return NULL; > @@ -957,7 +1423,8 @@ irqreturn_t vring_interrupt(int irq, void *_vq) > EXPORT_SYMBOL_GPL(vring_interrupt); > > struct virtqueue *__vring_new_virtqueue(unsigned int index, > - struct vring vring, > + union vring_union vring, > + bool packed, > struct virtio_device *vdev, > bool weak_barriers, > bool context, > @@ -965,19 +1432,20 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, &g...
2018 May 22
0
[RFC v5 2/5] virtio_ring: support creating packed ring
...LL; + return vq->packed ? virtqueue_detach_unused_buf_packed(_vq) : + virtqueue_detach_unused_buf_split(_vq); } EXPORT_SYMBOL_GPL(virtqueue_detach_unused_buf); @@ -955,7 +1167,8 @@ irqreturn_t vring_interrupt(int irq, void *_vq) EXPORT_SYMBOL_GPL(vring_interrupt); struct virtqueue *__vring_new_virtqueue(unsigned int index, - struct vring vring, + union vring_union vring, + bool packed, struct virtio_device *vdev, bool weak_barriers, bool context, @@ -963,19 +1176,22 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, void (*callback)(struct virtqueue...
2018 Jul 11
0
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...LL; + return vq->packed ? virtqueue_detach_unused_buf_packed(_vq) : + virtqueue_detach_unused_buf_split(_vq); } EXPORT_SYMBOL_GPL(virtqueue_detach_unused_buf); @@ -954,7 +1166,8 @@ irqreturn_t vring_interrupt(int irq, void *_vq) EXPORT_SYMBOL_GPL(vring_interrupt); struct virtqueue *__vring_new_virtqueue(unsigned int index, - struct vring vring, + union vring_union vring, + bool packed, struct virtio_device *vdev, bool weak_barriers, bool context, @@ -962,19 +1175,22 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, void (*callback)(struct virtqueue...
2018 Feb 23
0
[PATCH RFC 2/2] virtio_ring: support packed ring
...q->vq.num_free != vq->vring.num); + BUG_ON(vq->vq.num_free != (vq->packed ? vq->vring_packed.num : + vq->vring.num)); END_USE(vq); return NULL; @@ -957,7 +1423,8 @@ irqreturn_t vring_interrupt(int irq, void *_vq) EXPORT_SYMBOL_GPL(vring_interrupt); struct virtqueue *__vring_new_virtqueue(unsigned int index, - struct vring vring, + union vring_union vring, + bool packed, struct virtio_device *vdev, bool weak_barriers, bool context, @@ -965,19 +1432,20 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, void (*callback)(struct virtqueue...
2018 Feb 23
5
[PATCH RFC 0/2] Packed ring for virtio
Hello everyone, This RFC implements a subset of packed ring which is described at https://github.com/oasis-tcs/virtio-docs/blob/master/virtio-v1.1-packed-wd08.pdf The code was tested with DPDK vhost (testpmd/vhost-PMD) implemented by Jens at http://dpdk.org/ml/archives/dev/2018-January/089417.html Minor changes are needed for the vhost code, e.g. to kick the guest. It's not a complete
2018 May 03
6
[RFC] virtio: support VIRTIO_F_IO_BARRIER
...irtio_config.h | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 21d464a29cf8..edb565643bf4 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -996,6 +996,9 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, !context; vq->event = virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX); + if (virtio_has_feature(vdev, VIRTIO_F_IO_BARRIER)) + vq->weak_barriers = false; + /* No callback? Tell other side not to bother us. */ if (!callback) { vq->avail_flags_shadow |= V...
2018 May 03
6
[RFC] virtio: support VIRTIO_F_IO_BARRIER
...irtio_config.h | 8 +++++++- 2 files changed, 12 insertions(+), 1 deletion(-) diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 21d464a29cf8..edb565643bf4 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -996,6 +996,9 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, !context; vq->event = virtio_has_feature(vdev, VIRTIO_RING_F_EVENT_IDX); + if (virtio_has_feature(vdev, VIRTIO_F_IO_BARRIER)) + vq->weak_barriers = false; + /* No callback? Tell other side not to bother us. */ if (!callback) { vq->avail_flags_shadow |= V...
2018 Mar 16
0
[PATCH RFC 2/2] virtio_ring: support packed ring
...um_free != (vq->packed ? vq->vring_packed.num : > > + vq->vring.num)); > > END_USE(vq); > > return NULL; > > @@ -957,7 +1423,8 @@ irqreturn_t vring_interrupt(int irq, void *_vq) > > EXPORT_SYMBOL_GPL(vring_interrupt); > > struct virtqueue *__vring_new_virtqueue(unsigned int index, > > - struct vring vring, > > + union vring_union vring, > > + bool packed, > > struct virtio_device *vdev, > > bool weak_barriers, > > bool context, > > @@ -965,19 +1432,20 @@ struct virtqueue *__vring_n...
2017 Mar 29
2
[PATCH 2/6] virtio: add context flag to find vqs
...c = vp_find_vqs(vdev, nvqs, vqs, callbacks, names, ctx, desc); if (rc) return rc; diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 409aeaa..b23b5fa 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -916,6 +916,7 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, struct vring vring, struct virtio_device *vdev, bool weak_barriers, + bool context, bool (*notify)(struct virtqueue *), void (*callback)(struct virtqueue *), const char *name) @@ -1019,6 +1020,7 @@ struct virtqueue *vring_create_virtqueue(...
2017 Mar 29
2
[PATCH 2/6] virtio: add context flag to find vqs
...c = vp_find_vqs(vdev, nvqs, vqs, callbacks, names, ctx, desc); if (rc) return rc; diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c index 409aeaa..b23b5fa 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -916,6 +916,7 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, struct vring vring, struct virtio_device *vdev, bool weak_barriers, + bool context, bool (*notify)(struct virtqueue *), void (*callback)(struct virtqueue *), const char *name) @@ -1019,6 +1020,7 @@ struct virtqueue *vring_create_virtqueue(...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...m, queue, vring_align); >> Let's rename vring_init to vring_init_split() like other helpers? > The vring_init() is a public API in include/uapi/linux/virtio_ring.h. > I don't think we can rename it. I see, then this need more thoughts to unify the API. > >>> - vq = __vring_new_virtqueue(index, vring, vdev, weak_barriers, context, >>> - notify, callback, name); >>> + vq = __vring_new_virtqueue(index, vring, packed, vdev, weak_barriers, >>> + context, notify, callback, name); >>> if (!vq) { >>> vring_free_queue(vdev,...