search for: virtqueue_get_desc_addr

Displaying 20 results from an estimated 66 matches for "virtqueue_get_desc_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); return READ_ONCE(vq->broken); } @@ -2868,9 +2868,9 @@ void __virtio_unbreak_device(struct virtio_device *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)...
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); return READ_ONCE(vq->broken); } @@ -2868,9 +2868,9 @@ void __virtio_unbreak_device(struct virtio_device *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)...
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
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.
2016 Feb 01
0
[PATCH v6 6/9] virtio: Add improved queue allocation API
...->queue_dma_addr); + } + list_del(&_vq->list); + kfree(vq); } EXPORT_SYMBOL_GPL(vring_del_virtqueue); @@ -1007,20 +1094,51 @@ void virtio_break_device(struct virtio_device *dev) } EXPORT_SYMBOL_GPL(virtio_break_device); -void *virtqueue_get_avail(struct virtqueue *_vq) +dma_addr_t virtqueue_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_...
2019 Apr 08
1
[RFC PATCH 01/12] virtio/s390: use vring_create_virtqueue
...size. */ > dev_warn(&vcdev->cdev->dev, "no vq\n"); > @@ -534,15 +523,17 @@ static struct virtqueue *virtio_ccw_setup_vq(struct virtio_device *vdev, > goto out_err; > } > > + Extra blank line :) > /* Register it with the host. */ > + queue = virtqueue_get_desc_addr(vq); > if (vcdev->revision == 0) { > - info->info_block->l.queue = (__u64)info->queue; > + info->info_block->l.queue = queue; > info->info_block->l.align = KVM_VIRTIO_CCW_RING_ALIGN; > info->info_block->l.index = i; > info->info_block-...
2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
...list); > + kfree(vq); > } > EXPORT_SYMBOL_GPL(vring_del_virtqueue); > > @@ -1007,20 +1094,51 @@ void virtio_break_device(struct virtio_device *dev) > } > EXPORT_SYMBOL_GPL(virtio_break_device); > > -void *virtqueue_get_avail(struct virtqueue *_vq) > +dma_addr_t virtqueue_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(virtq...
2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
...list); > + kfree(vq); > } > EXPORT_SYMBOL_GPL(vring_del_virtqueue); > > @@ -1007,20 +1094,51 @@ void virtio_break_device(struct virtio_device *dev) > } > EXPORT_SYMBOL_GPL(virtio_break_device); > > -void *virtqueue_get_avail(struct virtqueue *_vq) > +dma_addr_t virtqueue_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(virtq...
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
2016 Jan 29
18
[PATCH v5 00/10] 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 Jan 29
18
[PATCH v5 00/10] 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
2015 Oct 30
13
[PATCH v4 0/6] virtio core DMA API conversion
This switches virtio to use the DMA API unconditionally. I'm sure it breaks things, but it seems to work on x86 using virtio-pci, with and without Xen, and using both the modern 1.0 variant and the legacy variant. This appears to work on native and Xen x86_64 using both modern and legacy virtio-pci. It also appears to work on arm and arm64. It definitely won't work as-is on s390x, and
2015 Oct 30
13
[PATCH v4 0/6] virtio core DMA API conversion
This switches virtio to use the DMA API unconditionally. I'm sure it breaks things, but it seems to work on x86 using virtio-pci, with and without Xen, and using both the modern 1.0 variant and the legacy variant. This appears to work on native and Xen x86_64 using both modern and legacy virtio-pci. It also appears to work on arm and arm64. It definitely won't work as-is on s390x, and
2019 Apr 26
0
[PATCH 01/10] virtio/s390: use vring_create_virtqueue
...q) { /* For now, we fail if we can't get the requested size. */ dev_warn(&vcdev->cdev->dev, "no vq\n"); err = -ENOMEM; goto out_err; } + /* it may have been reduced */ + info->num = virtqueue_get_vring_size(vq); /* Register it with the host. */ + queue = virtqueue_get_desc_addr(vq); if (vcdev->revision == 0) { - info->info_block->l.queue = (__u64)info->queue; + info->info_block->l.queue = queue; info->info_block->l.align = KVM_VIRTIO_CCW_RING_ALIGN; info->info_block->l.index = i; info->info_block->l.num = info->num; c...
2019 Apr 26
0
[PATCH 02/10] virtio/s390: DMA support for virtio-ccw
...lease = virtio_ccw_release_dev; vcdev->vdev.config = &virtio_ccw_config_ops; vcdev->cdev = cdev; diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 673fe3ef3607..15f906e4a748 100644 --- a/include/linux/virtio.h +++ b/include/linux/virtio.h @@ -90,23 +90,6 @@ dma_addr_t virtqueue_get_desc_addr(struct virtqueue *vq); dma_addr_t virtqueue_get_avail_addr(struct virtqueue *vq); dma_addr_t virtqueue_get_used_addr(struct virtqueue *vq); -/* - * Legacy accessors -- in almost all cases, these are the wrong functions - * to use. - */ -static inline void *virtqueue_get_desc(struct virtqueue *v...
2016 Feb 03
14
[PATCH v7 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 03
14
[PATCH v7 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
...ruct virtqueue *_vq) > > struct vring_virtqueue *vq = to_vvq(_vq); > > - return vq->vring.num; > + 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 */ 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) > { >...