search for: virtqueue_get_vr

Displaying 20 results from an estimated 61 matches for "virtqueue_get_vr".

2020 Apr 06
2
[PATCH v2 1/2] virtio: stop using legacy struct vring
...4 --- a/drivers/platform/mellanox/mlxbf-tmfifo.c +++ b/drivers/platform/mellanox/mlxbf-tmfifo.c @@ -287,7 +287,7 @@ static irqreturn_t mlxbf_tmfifo_irq_handler(int irq, void *arg) static struct vring_desc * mlxbf_tmfifo_get_next_desc(struct mlxbf_tmfifo_vring *vring) { - const struct vring *vr = virtqueue_get_vring(vring->vq); + const struct vring_s *vr = virtqueue_get_vring(vring->vq); struct virtio_device *vdev = vring->vq->vdev; unsigned int idx, head; @@ -308,7 +308,7 @@ mlxbf_tmfifo_get_next_desc(struct mlxbf_tmfifo_vring *vring) static void mlxbf_tmfifo_release_desc(struct mlxbf_tm...
2020 Apr 06
2
[PATCH v2 1/2] virtio: stop using legacy struct vring
...4 --- a/drivers/platform/mellanox/mlxbf-tmfifo.c +++ b/drivers/platform/mellanox/mlxbf-tmfifo.c @@ -287,7 +287,7 @@ static irqreturn_t mlxbf_tmfifo_irq_handler(int irq, void *arg) static struct vring_desc * mlxbf_tmfifo_get_next_desc(struct mlxbf_tmfifo_vring *vring) { - const struct vring *vr = virtqueue_get_vring(vring->vq); + const struct vring_s *vr = virtqueue_get_vring(vring->vq); struct virtio_device *vdev = vring->vq->vdev; unsigned int idx, head; @@ -308,7 +308,7 @@ mlxbf_tmfifo_get_next_desc(struct mlxbf_tmfifo_vring *vring) static void mlxbf_tmfifo_release_desc(struct mlxbf_tm...
2023 Mar 15
2
[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params
...esc) + const struct vring_packed_desc *desc) { u16 flags; @@ -2786,10 +2786,10 @@ EXPORT_SYMBOL_GPL(vring_transport_features); * Returns the size of the vring. This is mainly used for boasting to * userspace. Unlike other operations, this need not be serialized. */ -unsigned int virtqueue_get_vring_size(struct virtqueue *_vq) +unsigned int virtqueue_get_vring_size(const struct virtqueue *_vq) { - struct vring_virtqueue *vq = to_vvq(_vq); + const struct vring_virtqueue *vq = to_vvq(_vq); return vq->packed_ring ? vq->packed.vring.num : vq->split.vring.num; } @@ -2819,9 +2819...
2016 Feb 01
0
[PATCH v6 6/9] virtio: Add improved queue allocation API
...rn 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.used); +} +EXPORT_SYMBOL_GPL(virtqueue_get_used_addr); + +const struct vring *virtqueue_get_vring(struct virtqueue *vq) +{ + return &to_vvq(vq)->vring; } -EXPORT_SYMBOL_GPL(virtqueue_get_used); +EXPORT_SYMBOL_GPL(virtqueue_get_vring); MODULE_LICENSE("GPL"); diff --git a/include/linux/virtio.h b/include/linux/virtio.h index 8f4d4bfa6d46..d5eb5479a425 100644 --- a/include/...
2018 May 29
0
[RFC v5 2/5] virtio_ring: support creating packed ring
...cked_desc) > > + * num + align - 1) & ~(align - 1)); > > If we choose not to go uapi, maybe we can use ALIGN() macro here? Okay. > > > + vr->device = vr->driver + 1; > > +} [...] > > +/* Only available for split ring */ > > const struct vring *virtqueue_get_vring(struct virtqueue *vq) > > { > > A possible issue with this is: > > After commit d4674240f31f8c4289abba07d64291c6ddce51bc ("KVM: s390: > virtio-ccw revision 1 SET_VQ"). CCW tries to use > virtqueue_get_avail()/virtqueue_get_used(). Looks like a bug either her...
2023 Mar 10
0
[PATCH v2 3/3] virtio_ring: Use const to annotate read-only pointer params
...esc) + const struct vring_packed_desc *desc) { u16 flags; @@ -2786,10 +2786,10 @@ EXPORT_SYMBOL_GPL(vring_transport_features); * Returns the size of the vring. This is mainly used for boasting to * userspace. Unlike other operations, this need not be serialized. */ -unsigned int virtqueue_get_vring_size(struct virtqueue *_vq) +unsigned int virtqueue_get_vring_size(const struct virtqueue *_vq) { - struct vring_virtqueue *vq = to_vvq(_vq); + const struct vring_virtqueue *vq = to_vvq(_vq); return vq->packed_ring ? vq->packed.vring.num : vq->split.vring.num; } @@ -2819,9 +2819...
2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
...); > + > + 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.used); > +} > +EXPORT_SYMBOL_GPL(virtqueue_get_used_addr); > + > +const struct vring *virtqueue_get_vring(struct virtqueue *vq) > +{ > + return &to_vvq(vq)->vring; > } > -EXPORT_SYMBOL_GPL(virtqueue_get_used); > +EXPORT_SYMBOL_GPL(virtqueue_get_vring); > > MODULE_LICENSE("GPL"); > diff --git a/include/linux/virtio.h b/include/linux/virtio.h > index 8f4...
2016 Feb 02
1
[PATCH v6 6/9] virtio: Add improved queue allocation API
...); > + > + 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.used); > +} > +EXPORT_SYMBOL_GPL(virtqueue_get_used_addr); > + > +const struct vring *virtqueue_get_vring(struct virtqueue *vq) > +{ > + return &to_vvq(vq)->vring; > } > -EXPORT_SYMBOL_GPL(virtqueue_get_used); > +EXPORT_SYMBOL_GPL(virtqueue_get_vring); > > MODULE_LICENSE("GPL"); > diff --git a/include/linux/virtio.h b/include/linux/virtio.h > index 8f4...
2019 Apr 26
0
[PATCH 02/10] virtio/s390: DMA support for virtio-ccw
...ue *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 *vq) -{ - return virtqueue_get_vring(vq)->desc; -} -static inline void *virtqueue_get_avail(struct virtqueue *vq) -{ - return virtqueue_get_vring(vq)->avail; -} -static inline void *virtqueue_get_used(struct virtqueue *vq) -{ - return virtqueue_get_vring(vq)->used; -} - /** * virtio_device - representation of a device u...
2023 Feb 21
2
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...gt; > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > > > index cd9364eb2345..855338609c7f 100644 > > > --- a/drivers/virtio/virtio_ring.c > > > +++ b/drivers/virtio/virtio_ring.c > > > @@ -3172,4 +3172,96 @@ const struct vring *virtqueue_get_vring(struct virtqueue *vq) > > > } > > > EXPORT_SYMBOL_GPL(virtqueue_get_vring); > > > > > > +/** > > > + * virtio_dma_map_page - get the DMA addr of the memory for virtio device > > > + * @dev: virtio device > > > + * @page: the page o...
2023 Feb 21
2
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...gt; > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > > > index cd9364eb2345..855338609c7f 100644 > > > --- a/drivers/virtio/virtio_ring.c > > > +++ b/drivers/virtio/virtio_ring.c > > > @@ -3172,4 +3172,96 @@ const struct vring *virtqueue_get_vring(struct virtqueue *vq) > > > } > > > EXPORT_SYMBOL_GPL(virtqueue_get_vring); > > > > > > +/** > > > + * virtio_dma_map_page - get the DMA addr of the memory for virtio device > > > + * @dev: virtio device > > > + * @page: the page o...
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 Feb 20
1
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...insertions(+) > > > > diff --git a/drivers/virtio/virtio_ring.c b/drivers/virtio/virtio_ring.c > > index cd9364eb2345..855338609c7f 100644 > > --- a/drivers/virtio/virtio_ring.c > > +++ b/drivers/virtio/virtio_ring.c > > @@ -3172,4 +3172,96 @@ const struct vring *virtqueue_get_vring(struct virtqueue *vq) > > } > > EXPORT_SYMBOL_GPL(virtqueue_get_vring); > > > > +/** > > + * virtio_dma_map_page - get the DMA addr of the memory for virtio device > > + * @dev: virtio device > > + * @page: the page of the memory to DMA > > + * @...
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 May 29
2
[RFC v5 2/5] virtio_ring: support creating packed ring
...gt; - vq->vring.desc, vq->queue_dma_addr); > + vq->packed ? (void *)vq->vring_packed.desc : > + (void *)vq->vring.desc, > + vq->queue_dma_addr); > } > list_del(&_vq->list); > kfree(vq); > @@ -1185,7 +1453,7 @@ unsigned int virtqueue_get_vring_size(struct 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); > > @@ -1228,6 +1496,10 @@...
2018 May 29
2
[RFC v5 2/5] virtio_ring: support creating packed ring
...gt; - vq->vring.desc, vq->queue_dma_addr); > + vq->packed ? (void *)vq->vring_packed.desc : > + (void *)vq->vring.desc, > + vq->queue_dma_addr); > } > list_del(&_vq->list); > kfree(vq); > @@ -1185,7 +1453,7 @@ unsigned int virtqueue_get_vring_size(struct 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); > > @@ -1228,6 +1496,10 @@...
2023 Mar 02
1
[PATCH vhost 07/10] virtio_ring: add api virtio_dma_map() for advance dma
...o/virtio_ring.c b/drivers/virtio/virtio_ring.c > > > > > index cd9364eb2345..855338609c7f 100644 > > > > > --- a/drivers/virtio/virtio_ring.c > > > > > +++ b/drivers/virtio/virtio_ring.c > > > > > @@ -3172,4 +3172,96 @@ const struct vring *virtqueue_get_vring(struct virtqueue *vq) > > > > > } > > > > > EXPORT_SYMBOL_GPL(virtqueue_get_vring); > > > > > > > > > > +/** > > > > > + * virtio_dma_map_page - get the DMA addr of the memory for virtio device > > > > >...
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