search for: virtqueue_get_avail_addr

Displaying 20 results from an estimated 83 matches for "virtqueue_get_avail_addr".

2023 Mar 15
2
[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params
...st 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_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 *_v...
2023 Mar 10
0
[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params
...st 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_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 *_v...
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
2019 Apr 26
0
[PATCH 02/10] virtio/s390: DMA support for virtio-ccw
...info_block->s.desc = queue; info->info_block->s.index = i; 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...
2016 Feb 01
0
[PATCH v6 6/9] virtio: Add improved queue allocation API
...tqueue_get_desc_addr(struct virtqueue *_vq) +{ + struct vring_virtqueue *vq = to_vvq(_vq); + + BUG_ON(!vq->we_own_ring); + + if (vring_use_dma_api(vq)) + return vq->queue_dma_addr; + else + return virt_to_phys(vq->vring.desc); +} +EXPORT_SYMBOL_GPL(virtqueue_get_desc_addr); + +dma_addr_t virtqueue_get_avail_addr(struct virtqueue *_vq) { struct vring_virtqueue *vq = to_vvq(_vq); - return vq->vring.avail; + BUG_ON(!vq->we_own_ring); + + if (vring_use_dma_api(vq)) + return vq->queue_dma_addr + + ((char *)vq->vring.avail - (char *)vq->vring.desc); + else + return virt_to_phys(vq->vri...
2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
...vring_virtqueue *vq = to_vvq(_vq); > + > + BUG_ON(!vq->we_own_ring); > + > + if (vring_use_dma_api(vq)) > + return vq->queue_dma_addr; > + else > + return virt_to_phys(vq->vring.desc); > +} > +EXPORT_SYMBOL_GPL(virtqueue_get_desc_addr); > + > +dma_addr_t virtqueue_get_avail_addr(struct virtqueue *_vq) > { > struct vring_virtqueue *vq = to_vvq(_vq); > > - return vq->vring.avail; > + BUG_ON(!vq->we_own_ring); > + > + if (vring_use_dma_api(vq)) > + return vq->queue_dma_addr + > + ((char *)vq->vring.avail - (char *)vq->vring.de...
2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
...vring_virtqueue *vq = to_vvq(_vq); > + > + BUG_ON(!vq->we_own_ring); > + > + if (vring_use_dma_api(vq)) > + return vq->queue_dma_addr; > + else > + return virt_to_phys(vq->vring.desc); > +} > +EXPORT_SYMBOL_GPL(virtqueue_get_desc_addr); > + > +dma_addr_t virtqueue_get_avail_addr(struct virtqueue *_vq) > { > struct vring_virtqueue *vq = to_vvq(_vq); > > - return vq->vring.avail; > + BUG_ON(!vq->we_own_ring); > + > + if (vring_use_dma_api(vq)) > + return vq->queue_dma_addr + > + ((char *)vq->vring.avail - (char *)vq->vring.de...
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
...> @@ -1224,6 +1744,7 @@ dma_addr_t virtqueue_get_desc_addr(struct virtqueue *_vq) > } > EXPORT_SYMBOL_GPL(virtqueue_get_desc_addr); > > +/* Only available for split ring */ Interesting, I think we need this for correctly configure pci. e.g in setup_vq()? > dma_addr_t virtqueue_get_avail_addr(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 vi...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...> @@ -1224,6 +1744,7 @@ dma_addr_t virtqueue_get_desc_addr(struct virtqueue *_vq) > } > EXPORT_SYMBOL_GPL(virtqueue_get_desc_addr); > > +/* Only available for split ring */ Interesting, I think we need this for correctly configure pci. e.g in setup_vq()? > dma_addr_t virtqueue_get_avail_addr(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 vi...
2018 Sep 12
1
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...o_vvq(_vq); > > > > > > - return vq->vring.num; > > > + return vq->packed ? vq->vring_packed.num : vq->vring.num; > > > } > > > EXPORT_SYMBOL_GPL(virtqueue_get_vring_size); > > > > > > @@ -1227,6 +1495,10 @@ dma_addr_t virtqueue_get_avail_addr(struct virtqueue *_vq) > > > > > > BUG_ON(!vq->we_own_ring); > > > > > > + if (vq->packed) > > > + return vq->queue_dma_addr + ((char *)vq->vring_packed.driver - > > > + (char *)vq->vring_packed.desc); > > > + &...
2019 Apr 09
0
[RFC PATCH 02/12] virtio/s390: DMA support for virtio-ccw
...ueue; > info->info_block->s.index = i; > 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; > @@ -769,10 +770,8 @@ static u64 virtio_ccw_get_features(struct virtio_device *vdev) > static void...
2018 Feb 23
0
[PATCH RFC 2/2] virtio_ring: support packed ring
...+ return vq->packed ? vq->vring_packed.num : vq->vring.num; } EXPORT_SYMBOL_GPL(virtqueue_get_vring_size); @@ -1224,6 +1744,7 @@ dma_addr_t virtqueue_get_desc_addr(struct virtqueue *_vq) } EXPORT_SYMBOL_GPL(virtqueue_get_desc_addr); +/* Only available for split ring */ dma_addr_t virtqueue_get_avail_addr(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)...
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 Mar 16
0
[PATCH RFC 2/2] virtio_ring: support packed ring
..._desc_addr); > > +/* Only available for split ring */ > > Interesting, I think we need this for correctly configure pci. e.g in > setup_vq()? Yes. The setup_vq() should be updated. But it requires QEMU change, so I just kept it as is in this RFC patch. > > > dma_addr_t virtqueue_get_avail_addr(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 *...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...gt; +/* Only available for split ring */ >> Interesting, I think we need this for correctly configure pci. e.g in >> setup_vq()? > Yes. The setup_vq() should be updated. But it requires > QEMU change, so I just kept it as is in this RFC patch. Ok. > >>> dma_addr_t virtqueue_get_avail_addr(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 avai...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...gt; +/* Only available for split ring */ >> Interesting, I think we need this for correctly configure pci. e.g in >> setup_vq()? > Yes. The setup_vq() should be updated. But it requires > QEMU change, so I just kept it as is in this RFC patch. Ok. > >>> dma_addr_t virtqueue_get_avail_addr(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 avai...