search for: we_own_r

Displaying 20 results from an estimated 59 matches for "we_own_r".

2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
.../drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -95,6 +95,11 @@ struct vring_virtqueue { > /* How to notify other side. FIXME: commonalize hcalls! */ > bool (*notify)(struct virtqueue *vq); > > + /* DMA, allocation, and size information */ > + bool we_own_ring; > + size_t queue_size_in_bytes; > + dma_addr_t queue_dma_addr; > + > #ifdef DEBUG > /* They're supposed to lock for us. */ > unsigned int in_use; > @@ -878,36 +883,31 @@ irqreturn_t vring_interrupt(int irq, void *_vq) > } > EXPORT_SYMBOL_GPL(vring_interrupt...
2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
.../drivers/virtio/virtio_ring.c > +++ b/drivers/virtio/virtio_ring.c > @@ -95,6 +95,11 @@ struct vring_virtqueue { > /* How to notify other side. FIXME: commonalize hcalls! */ > bool (*notify)(struct virtqueue *vq); > > + /* DMA, allocation, and size information */ > + bool we_own_ring; > + size_t queue_size_in_bytes; > + dma_addr_t queue_dma_addr; > + > #ifdef DEBUG > /* They're supposed to lock for us. */ > unsigned int in_use; > @@ -878,36 +883,31 @@ irqreturn_t vring_interrupt(int irq, void *_vq) > } > EXPORT_SYMBOL_GPL(vring_interrupt...
2016 Feb 01
0
[PATCH v6 6/9] virtio: Add improved queue allocation API
...1e96b9ff..cf2840c7e500 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -95,6 +95,11 @@ struct vring_virtqueue { /* How to notify other side. FIXME: commonalize hcalls! */ bool (*notify)(struct virtqueue *vq); + /* DMA, allocation, and size information */ + bool we_own_ring; + size_t queue_size_in_bytes; + dma_addr_t queue_dma_addr; + #ifdef DEBUG /* They're supposed to lock for us. */ unsigned int in_use; @@ -878,36 +883,31 @@ irqreturn_t vring_interrupt(int irq, void *_vq) } EXPORT_SYMBOL_GPL(vring_interrupt); -struct virtqueue *vring_new_virtqueue(u...
2023 Mar 15
2
[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params
...ice *dev) } EXPORT_SYMBOL_GPL(__virtio_unbreak_device); -dma_addr_t virtqueue_get_desc_addr(struct virtqueue *_vq) +dma_addr_t virtqueue_get_desc_addr(const struct virtqueue *_vq) { - struct vring_virtqueue *vq = to_vvq(_vq); + const struct vring_virtqueue *vq = to_vvq(_vq); BUG_ON(!vq->we_own_ring); @@ -2881,9 +2881,9 @@ dma_addr_t virtqueue_get_desc_addr(struct virtqueue *_vq) } EXPORT_SYMBOL_GPL(virtqueue_get_desc_addr); -dma_addr_t virtqueue_get_avail_addr(struct virtqueue *_vq) +dma_addr_t virtqueue_get_avail_addr(const struct virtqueue *_vq) { - struct vring_virtqueue *vq = to...
2020 Mar 06
1
[PATCH] virtio_ring: Fix mem leak with vring_new_virtqueue()
...>>> 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 separately") allocates the desc >>>> state >>>> within the __vring_new_virtqueue() but frees it only when the >>>> .we_own_ring >>...
2018 Sep 12
1
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...dev, weak_barriers, > > > + context, notify, callback, name); > > > } > > > EXPORT_SYMBOL_GPL(vring_new_virtqueue); > > > > > > @@ -1142,7 +1408,9 @@ void vring_del_virtqueue(struct virtqueue *_vq) > > > > > > if (vq->we_own_ring) { > > > vring_free_queue(vq->vq.vdev, vq->queue_size_in_bytes, > > > - vq->vring.desc, vq->queue_dma_addr); > > > + vq->packed ? (void *)vq->vring_packed.desc : > > > + (void *)vq->vring.desc, > > > + vq-...
2023 Mar 10
0
[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params
...ice *dev) } EXPORT_SYMBOL_GPL(__virtio_unbreak_device); -dma_addr_t virtqueue_get_desc_addr(struct virtqueue *_vq) +dma_addr_t virtqueue_get_desc_addr(const struct virtqueue *_vq) { - struct vring_virtqueue *vq = to_vvq(_vq); + const struct vring_virtqueue *vq = to_vvq(_vq); BUG_ON(!vq->we_own_ring); @@ -2881,9 +2881,9 @@ dma_addr_t virtqueue_get_desc_addr(struct virtqueue *_vq) } EXPORT_SYMBOL_GPL(virtqueue_get_desc_addr); -dma_addr_t virtqueue_get_avail_addr(struct virtqueue *_vq) +dma_addr_t virtqueue_get_avail_addr(const struct virtqueue *_vq) { - struct vring_virtqueue *vq = to...
2018 Sep 07
3
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...P_KERNEL); > if (!vq) > return NULL; > > - vq->vring = vring; > vq->vq.callback = callback; > vq->vq.vdev = vdev; > vq->vq.name = name; > - vq->vq.num_free = vring.num; > + vq->vq.num_free = num; > vq->vq.index = index; > vq->we_own_ring = false; > vq->queue_dma_addr = 0; > @@ -983,9 +1199,8 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, > vq->weak_barriers = weak_barriers; > vq->broken = false; > vq->last_used_idx = 0; > - vq->avail_flags_shadow = 0; > - vq->avail_i...
2018 Sep 07
3
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...P_KERNEL); > if (!vq) > return NULL; > > - vq->vring = vring; > vq->vq.callback = callback; > vq->vq.vdev = vdev; > vq->vq.name = name; > - vq->vq.num_free = vring.num; > + vq->vq.num_free = num; > vq->vq.index = index; > vq->we_own_ring = false; > vq->queue_dma_addr = 0; > @@ -983,9 +1199,8 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, > vq->weak_barriers = weak_barriers; > vq->broken = false; > vq->last_used_idx = 0; > - vq->avail_flags_shadow = 0; > - vq->avail_i...
2018 Sep 10
0
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...w_virtqueue(index, vring, packed, vdev, weak_barriers, > > + context, notify, callback, name); > > } > > EXPORT_SYMBOL_GPL(vring_new_virtqueue); > > > > @@ -1142,7 +1408,9 @@ void vring_del_virtqueue(struct virtqueue *_vq) > > > > if (vq->we_own_ring) { > > vring_free_queue(vq->vq.vdev, vq->queue_size_in_bytes, > > - vq->vring.desc, vq->queue_dma_addr); > > + vq->packed ? (void *)vq->vring_packed.desc : > > + (void *)vq->vring.desc, > > + vq->queue_dma_addr); >...
2016 Feb 01
14
[PATCH v6 0/9] virtio DMA API, yet again
This switches virtio to use the DMA API on Xen and if requested by module option. This fixes virtio on Xen, and it should break anything because it's off by default on everything except Xen PV on x86. To the Xen people: is this okay? If it doesn't work on other Xen variants (PVH? HVM?), can you submit follow-up patches to fix it? To everyone else: we've waffled on this for way too
2016 Feb 01
14
[PATCH v6 0/9] virtio DMA API, yet again
This switches virtio to use the DMA API on Xen and if requested by module option. This fixes virtio on Xen, and it should break anything because it's off by default on everything except Xen PV on x86. To the Xen people: is this okay? If it doesn't work on other Xen variants (PVH? HVM?), can you submit follow-up patches to fix it? To everyone else: we've waffled on this for way too
2023 Feb 14
1
[PATCH vhost 10/10] virtio_ring: introduce virtqueue_reset()
...or device not supported + * -EPERM: Operation not permitted + */ +int virtqueue_reset(struct virtqueue *_vq, + void (*recycle)(struct virtqueue *vq, void *buf)) +{ + struct vring_virtqueue *vq = to_vvq(_vq); + struct virtio_device *vdev = vq->vq.vdev; + void *buf; + int err; + + if (!vq->we_own_ring) + return -EPERM; + + if (!vdev->config->disable_vq_and_reset) + return -ENOENT; + + if (!vdev->config->enable_vq_after_reset) + return -ENOENT; + + err = vdev->config->disable_vq_and_reset(_vq); + if (err) + return err; + + while ((buf = virtqueue_detach_unused_buf(_vq)) !...
2023 Feb 02
1
[PATCH 06/33] virtio_ring: introduce virtqueue_reset()
...or device not supported + * -EPERM: Operation not permitted + */ +int virtqueue_reset(struct virtqueue *_vq, + void (*recycle)(struct virtqueue *vq, void *buf)) +{ + struct vring_virtqueue *vq = to_vvq(_vq); + struct virtio_device *vdev = vq->vq.vdev; + void *buf; + int err; + + if (!vq->we_own_ring) + return -EPERM; + + if (!vdev->config->disable_vq_and_reset) + return -ENOENT; + + if (!vdev->config->enable_vq_after_reset) + return -ENOENT; + + err = vdev->config->disable_vq_and_reset(_vq); + if (err) + return err; + + while ((buf = virtqueue_detach_unused_buf(_vq)) !...
2023 Mar 15
4
[PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci
This patch series performs a clean up of the code in virtio_ring and virtio_pci, modifying it to conform with the Linux kernel coding style guidance [1]. The modifications ensure the code easy to read and understand. This small series does few short cleanups in the code. Patch-1 Allow non power of 2 sizes for packed virtqueues. Patch-2 Avoid using inline for small functions. Patch-3 Use const to
2023 Mar 10
4
[PATCH v2 0/3] virtio_ring: Clean up code for virtio ring and pci
This patch series performs a clean up of the code in virtio_ring and virtio_pci, modifying it to conform with the Linux kernel coding style guidance [1]. The modifications ensure the code easy to read and understand. This small series does few short cleanups in the code. Patch-1 Allow non power of 2 sizes for virtqueues Patch-2 Avoid using inline for small functions. Patch-3 Use const to annotate
2018 Nov 21
19
[PATCH net-next v3 00/13] virtio: support packed ring
Hi, This patch set implements packed ring support in virtio driver. A performance test between pktgen (pktgen_sample03_burst_single_flow.sh) and DPDK vhost (testpmd/rxonly/vhost-PMD) has been done, I saw ~30% performance gain in packed ring in this case. To make this patch set work with below patch set for vhost, some hacks are needed to set the _F_NEXT flag in indirect descriptors (this should
2018 Nov 21
19
[PATCH net-next v3 00/13] virtio: support packed ring
Hi, This patch set implements packed ring support in virtio driver. A performance test between pktgen (pktgen_sample03_burst_single_flow.sh) and DPDK vhost (testpmd/rxonly/vhost-PMD) has been done, I saw ~30% performance gain in packed ring in this case. To make this patch set work with below patch set for vhost, some hacks are needed to set the _F_NEXT flag in indirect descriptors (this should
2018 May 22
0
[RFC v5 2/5] virtio_ring: support creating packed ring
...ng_desc_state); + + vq = kmalloc(sizeof(*vq) + size, GFP_KERNEL); if (!vq) return NULL; - vq->vring = vring; vq->vq.callback = callback; vq->vq.vdev = vdev; vq->vq.name = name; - vq->vq.num_free = vring.num; + vq->vq.num_free = num; vq->vq.index = index; vq->we_own_ring = false; vq->queue_dma_addr = 0; @@ -984,9 +1200,8 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, vq->weak_barriers = weak_barriers; vq->broken = false; vq->last_used_idx = 0; - vq->avail_flags_shadow = 0; - vq->avail_idx_shadow = 0; vq->num_added =...
2018 Jul 11
0
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...ng_desc_state); + + vq = kmalloc(sizeof(*vq) + size, GFP_KERNEL); if (!vq) return NULL; - vq->vring = vring; vq->vq.callback = callback; vq->vq.vdev = vdev; vq->vq.name = name; - vq->vq.num_free = vring.num; + vq->vq.num_free = num; vq->vq.index = index; vq->we_own_ring = false; vq->queue_dma_addr = 0; @@ -983,9 +1199,8 @@ struct virtqueue *__vring_new_virtqueue(unsigned int index, vq->weak_barriers = weak_barriers; vq->broken = false; vq->last_used_idx = 0; - vq->avail_flags_shadow = 0; - vq->avail_idx_shadow = 0; vq->num_added =...