search for: virtqueue_get_used_addr

Displaying 20 results from an estimated 97 matches for "virtqueue_get_used_addr".

2023 Mar 15
2
[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params
...struct virtqueue *_vq) { - struct vring_virtqueue *vq = to_vvq(_vq); + const struct vring_virtqueue *vq = to_vvq(_vq); BUG_ON(!vq->we_own_ring); @@ -2895,9 +2895,9 @@ dma_addr_t virtqueue_get_avail_addr(struct virtqueue *_vq) } EXPORT_SYMBOL_GPL(virtqueue_get_avail_addr); -dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq) +dma_addr_t virtqueue_get_used_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); @@ -2910,7 +2910,7 @@ dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq)...
2023 Mar 10
0
[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params
...struct virtqueue *_vq) { - struct vring_virtqueue *vq = to_vvq(_vq); + const struct vring_virtqueue *vq = to_vvq(_vq); BUG_ON(!vq->we_own_ring); @@ -2895,9 +2895,9 @@ dma_addr_t virtqueue_get_avail_addr(struct virtqueue *_vq) } EXPORT_SYMBOL_GPL(virtqueue_get_avail_addr); -dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq) +dma_addr_t virtqueue_get_used_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); @@ -2910,7 +2910,7 @@ dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq)...
2023 Mar 07
3
[PATCH 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 Remove unnecessary num zero check, which performs in power_of_2. Patch-2 Avoid using inline for small functions.
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 Sep 12
1
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...char *)vq->vring_packed.driver - > > > + (char *)vq->vring_packed.desc); > > > + > > > return vq->queue_dma_addr + > > > ((char *)vq->vring.avail - (char *)vq->vring.desc); > > > } > > > @@ -1238,11 +1510,16 @@ dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq) > > > > > > BUG_ON(!vq->we_own_ring); > > > > > > + if (vq->packed) > > > + return vq->queue_dma_addr + ((char *)vq->vring_packed.device - > > > + (char *)vq->vring_packed.desc); > > > + &...
2019 Apr 26
0
[PATCH 02/10] virtio/s390: DMA support for virtio-ccw
...info->info_block->s.num = info->num; - info->info_block->s.avail = (__u64)virtqueue_get_avail(vq); - info->info_block->s.used = (__u64)virtqueue_get_used(vq); + info->info_block->s.avail = (__u64)virtqueue_get_avail_addr(vq); + info->info_block->s.used = (__u64)virtqueue_get_used_addr(vq); ccw->count = sizeof(info->info_block->s); } ccw->cmd_code = CCW_CMD_SET_VQ; @@ -772,10 +773,8 @@ static u64 virtio_ccw_get_features(struct virtio_device *vdev) static void ccw_transport_features(struct virtio_device *vdev) { /* - * Packed ring isn't enabled on virti...
2016 Feb 01
0
[PATCH v6 6/9] virtio: Add improved queue allocation API
...+ return vq->queue_dma_addr + + ((char *)vq->vring.avail - (char *)vq->vring.desc); + else + return virt_to_phys(vq->vring.avail); } -EXPORT_SYMBOL_GPL(virtqueue_get_avail); +EXPORT_SYMBOL_GPL(virtqueue_get_avail_addr); -void *virtqueue_get_used(struct virtqueue *_vq) +dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq) { struct vring_virtqueue *vq = to_vvq(_vq); - return vq->vring.used; + BUG_ON(!vq->we_own_ring); + + if (vring_use_dma_api(vq)) + return vq->queue_dma_addr + + ((char *)vq->vring.used - (char *)vq->vring.desc); + else + return virt_to_phys(vq->vring...
2023 Feb 14
1
[PATCH vhost 10/10] virtio_ring: introduce virtqueue_reset()
...ble for split ring */ struct virtqueue *vring_new_virtqueue(unsigned int index, unsigned int num, diff --git a/include/linux/virtio.h b/include/linux/virtio.h index d0e707d744a0..cf4c157e4e75 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -106,6 +106,8 @@ dma_addr_t virtqueue_get_used_addr(struct virtqueue *vq); int virtqueue_resize(struct virtqueue *vq, u32 num, void (*recycle)(struct virtqueue *vq, void *buf)); +int virtqueue_reset(struct virtqueue *vq, + void (*recycle)(struct virtqueue *vq, void *buf)); /** * struct virtio_device - representation of a device...
2023 Feb 02
1
[PATCH 06/33] virtio_ring: introduce virtqueue_reset()
...ble for split ring */ struct virtqueue *vring_new_virtqueue(unsigned int index, unsigned int num, diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 3ebb346ebb7c..3ca2edb1aef3 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -105,6 +105,8 @@ dma_addr_t virtqueue_get_used_addr(struct virtqueue *vq); int virtqueue_resize(struct virtqueue *vq, u32 num, void (*recycle)(struct virtqueue *vq, void *buf)); +int virtqueue_reset(struct virtqueue *vq, + void (*recycle)(struct virtqueue *vq, void *buf)); /** * struct virtio_device - representation of a device...
2020 Apr 06
2
[PATCH v2 1/2] virtio: stop using legacy struct vring
...64,7 @@ struct virtqueue *vring_new_virtqueue(unsigned int index, void (*callback)(struct virtqueue *vq), const char *name) { - struct vring vring; + struct vring_s vring; if (virtio_has_feature(vdev, VIRTIO_F_RING_PACKED)) return NULL; @@ -2320,7 +2320,7 @@ dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq) EXPORT_SYMBOL_GPL(virtqueue_get_used_addr); /* Only available for split ring */ -const struct vring *virtqueue_get_vring(struct virtqueue *vq) +const struct vring_s *virtqueue_get_vring(struct virtqueue *vq) { return &to_vvq(vq)->split.vring; } diff --git a/inc...
2020 Apr 06
2
[PATCH v2 1/2] virtio: stop using legacy struct vring
...64,7 @@ struct virtqueue *vring_new_virtqueue(unsigned int index, void (*callback)(struct virtqueue *vq), const char *name) { - struct vring vring; + struct vring_s vring; if (virtio_has_feature(vdev, VIRTIO_F_RING_PACKED)) return NULL; @@ -2320,7 +2320,7 @@ dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq) EXPORT_SYMBOL_GPL(virtqueue_get_used_addr); /* Only available for split ring */ -const struct vring *virtqueue_get_vring(struct virtqueue *vq) +const struct vring_s *virtqueue_get_vring(struct virtqueue *vq) { return &to_vvq(vq)->split.vring; } diff --git a/inc...
2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
...char *)vq->vring.avail - (char *)vq->vring.desc); > + else > + return virt_to_phys(vq->vring.avail); > } > -EXPORT_SYMBOL_GPL(virtqueue_get_avail); > +EXPORT_SYMBOL_GPL(virtqueue_get_avail_addr); > > -void *virtqueue_get_used(struct virtqueue *_vq) > +dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq) > { > struct vring_virtqueue *vq = to_vvq(_vq); > > - return vq->vring.used; > + BUG_ON(!vq->we_own_ring); > + > + if (vring_use_dma_api(vq)) > + return vq->queue_dma_addr + > + ((char *)vq->vring.used - (char *)vq->vring.desc...
2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
...char *)vq->vring.avail - (char *)vq->vring.desc); > + else > + return virt_to_phys(vq->vring.avail); > } > -EXPORT_SYMBOL_GPL(virtqueue_get_avail); > +EXPORT_SYMBOL_GPL(virtqueue_get_avail_addr); > > -void *virtqueue_get_used(struct virtqueue *_vq) > +dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq) > { > struct vring_virtqueue *vq = to_vvq(_vq); > > - return vq->vring.used; > + BUG_ON(!vq->we_own_ring); > + > + if (vring_use_dma_api(vq)) > + return vq->queue_dma_addr + > + ((char *)vq->vring.used - (char *)vq->vring.desc...
2018 Sep 10
0
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...urn vq->queue_dma_addr + ((char *)vq->vring_packed.driver - > > + (char *)vq->vring_packed.desc); > > + > > return vq->queue_dma_addr + > > ((char *)vq->vring.avail - (char *)vq->vring.desc); > > } > > @@ -1238,11 +1510,16 @@ dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq) > > > > BUG_ON(!vq->we_own_ring); > > > > + if (vq->packed) > > + return vq->queue_dma_addr + ((char *)vq->vring_packed.device - > > + (char *)vq->vring_packed.desc); > > + > > return vq->queue_dma_...
2018 Sep 07
3
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...if (vq->packed) > + return vq->queue_dma_addr + ((char *)vq->vring_packed.driver - > + (char *)vq->vring_packed.desc); > + > return vq->queue_dma_addr + > ((char *)vq->vring.avail - (char *)vq->vring.desc); > } > @@ -1238,11 +1510,16 @@ dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq) > > BUG_ON(!vq->we_own_ring); > > + if (vq->packed) > + return vq->queue_dma_addr + ((char *)vq->vring_packed.device - > + (char *)vq->vring_packed.desc); > + > return vq->queue_dma_addr + > ((char *)vq->vring.use...
2018 Sep 07
3
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...if (vq->packed) > + return vq->queue_dma_addr + ((char *)vq->vring_packed.driver - > + (char *)vq->vring_packed.desc); > + > return vq->queue_dma_addr + > ((char *)vq->vring.avail - (char *)vq->vring.desc); > } > @@ -1238,11 +1510,16 @@ dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq) > > BUG_ON(!vq->we_own_ring); > > + if (vq->packed) > + return vq->queue_dma_addr + ((char *)vq->vring_packed.device - > + (char *)vq->vring_packed.desc); > + > return vq->queue_dma_addr + > ((char *)vq->vring.use...
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
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...dr(struct virtqueue *_vq) > { > struct vring_virtqueue *vq = to_vvq(_vq); > @@ -1235,6 +1756,7 @@ dma_addr_t virtqueue_get_avail_addr(struct virtqueue *_vq) > } > EXPORT_SYMBOL_GPL(virtqueue_get_avail_addr); > > +/* Only available for split ring */ > dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq) Maybe it's better to rename this to get_device_addr(). Thanks > { > struct vring_virtqueue *vq = to_vvq(_vq); > @@ -1246,6 +1768,7 @@ dma_addr_t virtqueue_get_used_addr(struct virtqueue *_vq) > } > EXPORT_SYMBOL_GPL(virtqueue_get_used_addr); &gt...