search for: vring_desc_f_us

Displaying 20 results from an estimated 78 matches for "vring_desc_f_us".

Did you mean: vring_desc_f_used
2018 Jul 04
1
[PATCH net-next 6/8] virtio: introduce packed ring defines
...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 with VRING_DESC_F_NEXT (1 << 0), VRING_DESC_F_WRITE (1 << 1) and VRING_DESC_F_INDIRECT (1 << 2). I plan to define belo...
2018 May 29
2
[RFC v5 3/5] virtio_ring: add packed ring support
...ICE : DMA_FROM_DEVICE); > + if (vring_mapping_error(vq, addr)) > + goto unmap_release; > + > + flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT | > + (n < out_sgs ? 0 : VRING_DESC_F_WRITE) | > + VRING_DESC_F_AVAIL(vq->avail_wrap_counter) | > + VRING_DESC_F_USED(!vq->avail_wrap_counter)); > + if (!indirect && i == head) > + head_flags = flags; > + else > + desc[i].flags = flags; > + > + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); > + desc[i].len = cpu_to_virtio32(_vq->vdev, sg->length); > +...
2018 May 29
2
[RFC v5 3/5] virtio_ring: add packed ring support
...ICE : DMA_FROM_DEVICE); > + if (vring_mapping_error(vq, addr)) > + goto unmap_release; > + > + flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT | > + (n < out_sgs ? 0 : VRING_DESC_F_WRITE) | > + VRING_DESC_F_AVAIL(vq->avail_wrap_counter) | > + VRING_DESC_F_USED(!vq->avail_wrap_counter)); > + if (!indirect && i == head) > + head_flags = flags; > + else > + desc[i].flags = flags; > + > + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); > + desc[i].len = cpu_to_virtio32(_vq->vdev, sg->length); > +...
2018 Apr 25
0
[RFC v3 3/5] virtio_ring: add packed ring support
...sg, n < out_sgs ? + DMA_TO_DEVICE : DMA_FROM_DEVICE); + if (vring_mapping_error(vq, addr)) + goto unmap_release; + + flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT | + (n < out_sgs ? 0 : VRING_DESC_F_WRITE) | + VRING_DESC_F_AVAIL(vq->wrap_counter) | + VRING_DESC_F_USED(!vq->wrap_counter)); + if (!indirect && i == head) + head_flags = flags; + else + desc[i].flags = flags; + + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); + desc[i].len = cpu_to_virtio32(_vq->vdev, sg->length); + i++; + if (!indirect && i >= vq-...
2018 Jul 05
0
[PATCH net-next 6/8] virtio: introduce packed ring defines
...> +++ 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 >> +#define VRING_DESC_F_USED??? 15 > > For consistency, you may want to make VRING_DESC_F_AVAIL and > VRING_DESC_F_USED to represent the bit mask and not the bit position, > as done for VRING_DESC_F_WRITE and VRING_DESC_F_INDIRECT. > > Regards, > Maxime Yes, Tiwei has the same comment. Will fix this....
2018 May 22
0
[RFC v5 3/5] virtio_ring: add packed ring support
...; out_sgs ? + DMA_TO_DEVICE : DMA_FROM_DEVICE); + if (vring_mapping_error(vq, addr)) + goto unmap_release; + + flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT | + (n < out_sgs ? 0 : VRING_DESC_F_WRITE) | + VRING_DESC_F_AVAIL(vq->avail_wrap_counter) | + VRING_DESC_F_USED(!vq->avail_wrap_counter)); + if (!indirect && i == head) + head_flags = flags; + else + desc[i].flags = flags; + + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); + desc[i].len = cpu_to_virtio32(_vq->vdev, sg->length); + i++; + if (!indirect) { + vq->d...
2018 May 16
0
[RFC v4 3/5] virtio_ring: add packed ring support
...sg, n < out_sgs ? + DMA_TO_DEVICE : DMA_FROM_DEVICE); + if (vring_mapping_error(vq, addr)) + goto unmap_release; + + flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT | + (n < out_sgs ? 0 : VRING_DESC_F_WRITE) | + VRING_DESC_F_AVAIL(vq->wrap_counter) | + VRING_DESC_F_USED(!vq->wrap_counter)); + if (!indirect && i == head) + head_flags = flags; + else + desc[i].flags = flags; + + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); + desc[i].len = cpu_to_virtio32(_vq->vdev, sg->length); + i++; + if (!indirect && i >= vq-...
2018 Sep 07
2
[PATCH net-next v2 1/5] virtio: add packed ring definitions
...t; +++ b/include/uapi/linux/virtio_ring.h > @@ -44,6 +44,10 @@ > /* This means the buffer contains a list of buffer descriptors. */ > #define VRING_DESC_F_INDIRECT 4 > > +/* Mark a descriptor as available or used. */ > +#define VRING_DESC_F_AVAIL (1ul << 7) > +#define VRING_DESC_F_USED (1ul << 15) > + > /* The Host uses this in used->flags to advise the Guest: don't kick me when > * you add a buffer. It's unreliable, so it's simply an optimization. Guest > * will still kick if it's out of buffers. */ > @@ -53,6 +57,17 @@ > * o...
2018 Sep 07
2
[PATCH net-next v2 1/5] virtio: add packed ring definitions
...t; +++ b/include/uapi/linux/virtio_ring.h > @@ -44,6 +44,10 @@ > /* This means the buffer contains a list of buffer descriptors. */ > #define VRING_DESC_F_INDIRECT 4 > > +/* Mark a descriptor as available or used. */ > +#define VRING_DESC_F_AVAIL (1ul << 7) > +#define VRING_DESC_F_USED (1ul << 15) > + > /* The Host uses this in used->flags to advise the Guest: don't kick me when > * you add a buffer. It's unreliable, so it's simply an optimization. Guest > * will still kick if it's out of buffers. */ > @@ -53,6 +57,17 @@ > * o...
2018 May 29
0
[RFC v5 3/5] virtio_ring: add packed ring support
...d, flags; > > + u8 avail, used; > > + > > + last_used = vq->last_used_idx; > > + flags = virtio16_to_cpu(vq->vq.vdev, > > + vq->vring_packed.desc[last_used].flags); > > + avail = !!(flags & VRING_DESC_F_AVAIL(1)); > > + used = !!(flags & VRING_DESC_F_USED(1)); > > + > > + return avail == used && used == vq->used_wrap_counter; > > Spec does not check avail == used? So there's probably a bug in either of > the two places. > > In what condition that avail != used but used == vq_used_wrap_counter? A > bug...
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 May 16
2
[RFC v4 3/5] virtio_ring: add packed ring support
...MA_TO_DEVICE : DMA_FROM_DEVICE); > + if (vring_mapping_error(vq, addr)) > + goto unmap_release; > + > + flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT | > + (n < out_sgs ? 0 : VRING_DESC_F_WRITE) | > + VRING_DESC_F_AVAIL(vq->wrap_counter) | > + VRING_DESC_F_USED(!vq->wrap_counter)); > + if (!indirect && i == head) > + head_flags = flags; > + else > + desc[i].flags = flags; > + > + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); > + desc[i].len = cpu_to_virtio32(_vq->vdev, sg->length); > + i++;...
2018 May 16
2
[RFC v4 3/5] virtio_ring: add packed ring support
...MA_TO_DEVICE : DMA_FROM_DEVICE); > + if (vring_mapping_error(vq, addr)) > + goto unmap_release; > + > + flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT | > + (n < out_sgs ? 0 : VRING_DESC_F_WRITE) | > + VRING_DESC_F_AVAIL(vq->wrap_counter) | > + VRING_DESC_F_USED(!vq->wrap_counter)); > + if (!indirect && i == head) > + head_flags = flags; > + else > + desc[i].flags = flags; > + > + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); > + desc[i].len = cpu_to_virtio32(_vq->vdev, sg->length); > + i++;...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...>>> + if (vring_mapping_error(vq, addr)) >>> + goto unmap_release; >>> + >>> + flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT | >>> + VRING_DESC_F_WRITE | >>> + VRING_DESC_F_AVAIL(vq->wrap_counter) | >>> + VRING_DESC_F_USED(!vq->wrap_counter)); >>> + if (!indirect && i == head) >>> + head_flags = flags; >>> + else >>> + desc[i].flags = flags; >>> + >>> + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); >>> + desc[i].len = cpu_...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...>>> + if (vring_mapping_error(vq, addr)) >>> + goto unmap_release; >>> + >>> + flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT | >>> + VRING_DESC_F_WRITE | >>> + VRING_DESC_F_AVAIL(vq->wrap_counter) | >>> + VRING_DESC_F_USED(!vq->wrap_counter)); >>> + if (!indirect && i == head) >>> + head_flags = flags; >>> + else >>> + desc[i].flags = flags; >>> + >>> + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); >>> + desc[i].len = cpu_...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...r)) >>>>> + goto unmap_release; >>>>> + >>>>> + flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT | >>>>> + VRING_DESC_F_WRITE | >>>>> + VRING_DESC_F_AVAIL(vq->wrap_counter) | >>>>> + VRING_DESC_F_USED(!vq->wrap_counter)); >>>>> + if (!indirect && i == head) >>>>> + head_flags = flags; >>>>> + else >>>>> + desc[i].flags = flags; >>>>> + >>>>> + desc[i].addr = cpu_to_virtio64(_vq->...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...r)) >>>>> + goto unmap_release; >>>>> + >>>>> + flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT | >>>>> + VRING_DESC_F_WRITE | >>>>> + VRING_DESC_F_AVAIL(vq->wrap_counter) | >>>>> + VRING_DESC_F_USED(!vq->wrap_counter)); >>>>> + if (!indirect && i == head) >>>>> + head_flags = flags; >>>>> + else >>>>> + desc[i].flags = flags; >>>>> + >>>>> + desc[i].addr = cpu_to_virtio64(_vq->...
2018 Feb 27
3
[PATCH RFC 1/2] virtio: introduce packed ring defines
...eef72 100644 >--- a/include/uapi/linux/virtio_ring.h >+++ b/include/uapi/linux/virtio_ring.h >@@ -44,6 +44,9 @@ > /* This means the buffer contains a list of buffer descriptors. */ > #define VRING_DESC_F_INDIRECT 4 > >+#define VRING_DESC_F_AVAIL(b) ((b) << 7) >+#define VRING_DESC_F_USED(b) ((b) << 15) >+ > /* The Host uses this in used->flags to advise the Guest: don't kick me when > * you add a buffer. It's unreliable, so it's simply an optimization. Guest > * will still kick if it's out of buffers. */ >@@ -104,6 +107,36 @@ struct vri...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...sg = sg_next(sg)) { > + dma_addr_t addr = vring_map_one_sg(vq, sg, DMA_TO_DEVICE); > + if (vring_mapping_error(vq, addr)) > + goto unmap_release; > + > + flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT | > + VRING_DESC_F_AVAIL(vq->wrap_counter) | > + VRING_DESC_F_USED(!vq->wrap_counter)); > + if (!indirect && i == head) > + head_flags = flags; > + else > + desc[i].flags = flags; > + > + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); > + desc[i].len = cpu_to_virtio32(_vq->vdev, sg->length); > + desc[...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...sg = sg_next(sg)) { > + dma_addr_t addr = vring_map_one_sg(vq, sg, DMA_TO_DEVICE); > + if (vring_mapping_error(vq, addr)) > + goto unmap_release; > + > + flags = cpu_to_virtio16(_vq->vdev, VRING_DESC_F_NEXT | > + VRING_DESC_F_AVAIL(vq->wrap_counter) | > + VRING_DESC_F_USED(!vq->wrap_counter)); > + if (!indirect && i == head) > + head_flags = flags; > + else > + desc[i].flags = flags; > + > + desc[i].addr = cpu_to_virtio64(_vq->vdev, addr); > + desc[i].len = cpu_to_virtio32(_vq->vdev, sg->length); > + desc[...