search for: vring_desc_f_indirect

Displaying 20 results from an estimated 363 matches for "vring_desc_f_indirect".

2018 Dec 07
0
[RFC 3/3] virtio_ring: use new vring flags
...rtio/virtio_ring.c index cd7e755484e3..2806f69c6c9f 100644 --- a/drivers/virtio/virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -371,17 +371,17 @@ static void vring_unmap_one_split(const struct vring_virtqueue *vq, flags = virtio16_to_cpu(vq->vq.vdev, desc->flags); - if (flags & VRING_DESC_F_INDIRECT) { + if (flags & BIT(VRING_SPLIT_DESC_F_INDIRECT)) { dma_unmap_single(vring_dma_dev(vq), virtio64_to_cpu(vq->vq.vdev, desc->addr), virtio32_to_cpu(vq->vq.vdev, desc->len), - (flags & VRING_DESC_F_WRITE) ? + (flags & BIT(VRING_SPLIT_DESC_F_WRITE)) ?...
2018 Nov 30
2
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...; --- a/include/uapi/linux/virtio_ring.h > > > > > > +++ b/include/uapi/linux/virtio_ring.h > > > > > > @@ -44,6 +44,13 @@ > > > > > > /* This means the buffer contains a list of buffer descriptors. */ > > > > > > #define VRING_DESC_F_INDIRECT 4 > > > > > > +/* > > > > > > + * Mark a descriptor as available or used in packed ring. > > > > > > + * Notice: they are defined as shifts instead of shifted values. > > > > > > > > > > > > > > > T...
2018 Nov 30
2
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...; --- a/include/uapi/linux/virtio_ring.h > > > > > > +++ b/include/uapi/linux/virtio_ring.h > > > > > > @@ -44,6 +44,13 @@ > > > > > > /* This means the buffer contains a list of buffer descriptors. */ > > > > > > #define VRING_DESC_F_INDIRECT 4 > > > > > > +/* > > > > > > + * Mark a descriptor as available or used in packed ring. > > > > > > + * Notice: they are defined as shifts instead of shifted values. > > > > > > > > > > > > > > > T...
2018 Nov 30
2
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...> > > > > > > > +++ b/include/uapi/linux/virtio_ring.h > > > > > > > > @@ -44,6 +44,13 @@ > > > > > > > > /* This means the buffer contains a list of buffer descriptors. */ > > > > > > > > #define VRING_DESC_F_INDIRECT 4 > > > > > > > > +/* > > > > > > > > + * Mark a descriptor as available or used in packed ring. > > > > > > > > + * Notice: they are defined as shifts instead of shifted values. > > > > > > > > > &g...
2018 Nov 30
2
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...> > > > > > > > +++ b/include/uapi/linux/virtio_ring.h > > > > > > > > @@ -44,6 +44,13 @@ > > > > > > > > /* This means the buffer contains a list of buffer descriptors. */ > > > > > > > > #define VRING_DESC_F_INDIRECT 4 > > > > > > > > +/* > > > > > > > > + * Mark a descriptor as available or used in packed ring. > > > > > > > > + * Notice: they are defined as shifts instead of shifted values. > > > > > > > > > &g...
2018 Nov 30
4
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...inux/virtio_ring.h b/include/uapi/linux/virtio_ring.h > index 6d5d5faa989b..2414f8af26b3 100644 > --- a/include/uapi/linux/virtio_ring.h > +++ b/include/uapi/linux/virtio_ring.h > @@ -44,6 +44,13 @@ > /* This means the buffer contains a list of buffer descriptors. */ > #define VRING_DESC_F_INDIRECT 4 > > +/* > + * Mark a descriptor as available or used in packed ring. > + * Notice: they are defined as shifts instead of shifted values. This looks inconsistent to previous flags, any reason for using shifts? > + */ > +#define VRING_PACKED_DESC_F_AVAIL 7 > +#define VRI...
2018 Nov 30
4
[PATCH net-next v3 01/13] virtio: add packed ring types and macros
...inux/virtio_ring.h b/include/uapi/linux/virtio_ring.h > index 6d5d5faa989b..2414f8af26b3 100644 > --- a/include/uapi/linux/virtio_ring.h > +++ b/include/uapi/linux/virtio_ring.h > @@ -44,6 +44,13 @@ > /* This means the buffer contains a list of buffer descriptors. */ > #define VRING_DESC_F_INDIRECT 4 > > +/* > + * Mark a descriptor as available or used in packed ring. > + * Notice: they are defined as shifts instead of shifted values. This looks inconsistent to previous flags, any reason for using shifts? > + */ > +#define VRING_PACKED_DESC_F_AVAIL 7 > +#define VRI...
2015 Oct 30
1
[PATCH v4 2/6] virtio_ring: Support DMA APIs
...ma_data_direction direction) +{ + return dma_map_single(vring_dma_dev(vq), + cpu_addr, size, direction); +} + +static void vring_unmap_one(const struct vring_virtqueue *vq, + struct vring_desc *desc) +{ + u16 flags = virtio16_to_cpu(vq->vq.vdev, desc->flags); + + if (flags & VRING_DESC_F_INDIRECT) { + dma_unmap_single(vring_dma_dev(vq), + virtio64_to_cpu(vq->vq.vdev, desc->addr), + virtio32_to_cpu(vq->vq.vdev, desc->len), + (flags & VRING_DESC_F_WRITE) ? + DMA_FROM_DEVICE : DMA_TO_DEVICE); + } else { + dma_unmap_page(vring_dma_dev(vq), + virtio64_t...
2015 Oct 30
1
[PATCH v4 2/6] virtio_ring: Support DMA APIs
...= NULL; >> >> - /* Put back on free list: find end */ >> + /* Put back on free list: unmap first-level descriptors and find end */ >> i = head; >> >> - /* Free the indirect table */ >> - if (vq->vring.desc[i].flags & cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_INDIRECT)) >> - kfree(phys_to_virt(virtio64_to_cpu(vq->vq.vdev, vq->vring.desc[i].addr))); >> - >> - while (vq->vring.desc[i].flags & cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT)) { >> + while (vq->vring.desc[i].flags & nextflag) { >> + vring_unmap_o...
2015 Oct 30
1
[PATCH v4 2/6] virtio_ring: Support DMA APIs
...= NULL; >> >> - /* Put back on free list: find end */ >> + /* Put back on free list: unmap first-level descriptors and find end */ >> i = head; >> >> - /* Free the indirect table */ >> - if (vq->vring.desc[i].flags & cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_INDIRECT)) >> - kfree(phys_to_virt(virtio64_to_cpu(vq->vq.vdev, vq->vring.desc[i].addr))); >> - >> - while (vq->vring.desc[i].flags & cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_NEXT)) { >> + while (vq->vring.desc[i].flags & nextflag) { >> + vring_unmap_o...
2018 Jul 04
1
[PATCH net-next 6/8] virtio: introduce packed ring defines
...nclude/uapi/linux/virtio_ring.h > index 6d5d5fa..71c7a46 100644 > --- a/include/uapi/linux/virtio_ring.h > +++ b/include/uapi/linux/virtio_ring.h > @@ -43,6 +43,8 @@ > #define VRING_DESC_F_WRITE 2 > /* This means the buffer contains a list of buffer descriptors. */ > #define VRING_DESC_F_INDIRECT 4 > +#define VRING_DESC_F_AVAIL 7 It's better to use tab between VRING_DESC_F_AVAIL and 7. > +#define VRING_DESC_F_USED 15 Maybe it's better to define VRING_DESC_F_AVAIL and VRING_DESC_F_USED as (1 << 7) and (1 << 15) or something similar to make them consistent wi...
2018 Dec 07
7
[RFC 0/3] virtio_ring: define flags as shifts consistently
This is a follow up of the discussion in this thread: https://patchwork.ozlabs.org/patch/1001015/#2042353 Tiwei Bie (3): virtio_ring: define flags as shifts consistently virtio_ring: add VIRTIO_RING_NO_LEGACY virtio_ring: use new vring flags drivers/virtio/virtio_ring.c | 100 ++++++++++++++++++------------- include/uapi/linux/virtio_ring.h | 61 +++++++++++++------ 2 files changed,
2018 Dec 07
7
[RFC 0/3] virtio_ring: define flags as shifts consistently
This is a follow up of the discussion in this thread: https://patchwork.ozlabs.org/patch/1001015/#2042353 Tiwei Bie (3): virtio_ring: define flags as shifts consistently virtio_ring: add VIRTIO_RING_NO_LEGACY virtio_ring: use new vring flags drivers/virtio/virtio_ring.c | 100 ++++++++++++++++++------------- include/uapi/linux/virtio_ring.h | 61 +++++++++++++------ 2 files changed,
2013 Oct 02
2
Kmemleak: false-positive in vring_add_indirect ?
Hello, I have been hunting a memory-leak warning in vring_add_indirect: unreferenced object 0xffff88003d467e20 (size 32): comm "softirq", pid 0, jiffies 4295197765 (age 6.364s) hex dump (first 32 bytes): 28 19 bf 3d 00 00 00 00 0c 00 00 00 01 00 01 00 (..=............ 02 dc 51 3c 00 00 00 00 56 00 00 00 00 00 00 00 ..Q<....V....... backtrace:
2013 Oct 02
2
Kmemleak: false-positive in vring_add_indirect ?
Hello, I have been hunting a memory-leak warning in vring_add_indirect: unreferenced object 0xffff88003d467e20 (size 32): comm "softirq", pid 0, jiffies 4295197765 (age 6.364s) hex dump (first 32 bytes): 28 19 bf 3d 00 00 00 00 0c 00 00 00 01 00 01 00 (..=............ 02 dc 51 3c 00 00 00 00 56 00 00 00 00 00 00 00 ..Q<....V....... backtrace:
2014 Oct 22
1
[PATCH RFC 04/11] virtio_ring: implement endian reversal based on VERSION_1 feature.
...DESC_F_NEXT); > > desc[i-1].next = 0; > > > > - /* We're about to use a buffer */ > > - vq->vq.num_free--; > > - > > /* Use a single buffer which doesn't continue */ > > head = vq->free_head; > > - vq->vring.desc[head].flags = VRING_DESC_F_INDIRECT; > > - vq->vring.desc[head].addr = virt_to_phys(desc); > > + vq->vring.desc[head].flags = > > + cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_INDIRECT); > > + vq->vring.desc[head].addr = > > + cpu_to_virtio64(vq->vq.vdev, virt_to_phys(desc)); > > /...
2014 Oct 22
1
[PATCH RFC 04/11] virtio_ring: implement endian reversal based on VERSION_1 feature.
...DESC_F_NEXT); > > desc[i-1].next = 0; > > > > - /* We're about to use a buffer */ > > - vq->vq.num_free--; > > - > > /* Use a single buffer which doesn't continue */ > > head = vq->free_head; > > - vq->vring.desc[head].flags = VRING_DESC_F_INDIRECT; > > - vq->vring.desc[head].addr = virt_to_phys(desc); > > + vq->vring.desc[head].flags = > > + cpu_to_virtio16(vq->vq.vdev, VRING_DESC_F_INDIRECT); > > + vq->vring.desc[head].addr = > > + cpu_to_virtio64(vq->vq.vdev, virt_to_phys(desc)); > > /...
2014 Nov 24
2
[PATCH v3 26/41] vhost: virtio 1.0 endian-ness support
...->indirect, sizeof desc))) { vq_err(vq, "Failed indirect descriptor: idx %d, %zx\n", - i, (size_t)indirect->addr + i * sizeof desc); + i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); return -EINVAL; } - if (unlikely(desc.flags & VRING_DESC_F_INDIRECT)) { + if (unlikely(desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_INDIRECT))) { vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n", - i, (size_t)indirect->addr + i * sizeof desc); + i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); re...
2014 Nov 24
2
[PATCH v3 26/41] vhost: virtio 1.0 endian-ness support
...->indirect, sizeof desc))) { vq_err(vq, "Failed indirect descriptor: idx %d, %zx\n", - i, (size_t)indirect->addr + i * sizeof desc); + i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); return -EINVAL; } - if (unlikely(desc.flags & VRING_DESC_F_INDIRECT)) { + if (unlikely(desc.flags & cpu_to_vhost16(vq, VRING_DESC_F_INDIRECT))) { vq_err(vq, "Nested indirect descriptor: idx %d, %zx\n", - i, (size_t)indirect->addr + i * sizeof desc); + i, (size_t)vhost64_to_cpu(vq, indirect->addr) + i * sizeof desc); re...
2014 Aug 27
2
[PATCH 2/3] virtio_ring: Use DMA APIs
...dma_data_direction direction) > +{ > + return dma_map_page(vq->vq.vdev->dev.parent, > + sg_page(sg), sg->offset, sg->length, direction); > +} > + > +static void unmap_one(struct vring_virtqueue *vq, struct vring_desc *desc) > +{ > + if (desc->flags & VRING_DESC_F_INDIRECT) { > + dma_unmap_single(vq->vq.vdev->dev.parent, > + desc->addr, desc->len, > + (desc->flags & VRING_DESC_F_WRITE) ? > + DMA_FROM_DEVICE : DMA_TO_DEVICE); > + } else { > + dma_unmap_page(vq->vq.vdev->dev.parent, > + desc->addr,...