search for: vring_desc_f_avail

Displaying 20 results from an estimated 87 matches for "vring_desc_f_avail".

2018 Jul 04
1
[PATCH net-next 6/8] virtio: introduce packed ring defines
...ndex 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 with VRING_DESC_F_NEXT (1 << 0)...
2018 May 29
2
[RFC v5 3/5] virtio_ring: add packed ring support
...one_sg(vq, 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->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...
2018 May 29
2
[RFC v5 3/5] virtio_ring: add packed ring support
...one_sg(vq, 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->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...
2018 Jul 05
0
[PATCH net-next 6/8] virtio: introduce packed ring defines
...--- 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 >> +#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, Tiw...
2018 Apr 25
0
[RFC v3 3/5] virtio_ring: add packed ring support
...)) { + dma_addr_t addr = vring_map_one_sg(vq, 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); +...
2018 May 22
0
[RFC v5 3/5] virtio_ring: add packed ring support
...{ + dma_addr_t addr = vring_map_one_sg(vq, 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->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->...
2018 May 16
0
[RFC v4 3/5] virtio_ring: add packed ring support
...)) { + dma_addr_t addr = vring_map_one_sg(vq, 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); +...
2018 Sep 07
2
[PATCH net-next v2 1/5] virtio: add packed ring definitions
...644 > --- a/include/uapi/linux/virtio_ring.h > +++ 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...
2018 Sep 07
2
[PATCH net-next v2 1/5] virtio: add packed ring definitions
...644 > --- a/include/uapi/linux/virtio_ring.h > +++ 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...
2018 May 29
0
[RFC v5 3/5] virtio_ring: add packed ring support
...gt; { > > - return false; > > + u16 last_used, 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 ava...
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
...p_one_sg(vq, 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_vir...
2018 May 16
2
[RFC v4 3/5] virtio_ring: add packed ring support
...p_one_sg(vq, 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_vir...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...dma_addr_t addr = vring_map_one_sg(vq, sg, DMA_FROM_DEVICE); >>> + 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_virtio6...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...dma_addr_t addr = vring_map_one_sg(vq, sg, DMA_FROM_DEVICE); >>> + 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_virtio6...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...ROM_DEVICE); >>>>> + 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; >>>>>...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...ROM_DEVICE); >>>>> + 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; >>>>>...
2018 Feb 27
3
[PATCH RFC 1/2] virtio: introduce packed ring defines
.../linux/virtio_ring.h >index 6d5d5faa989b..77b1d4aeef72 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 o...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...n < out_sgs; n++) { > + for (sg = sgs[n]; sg; 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_vir...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...n < out_sgs; n++) { > + for (sg = sgs[n]; sg; 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_vir...