search for: avail_idx_shadow

Displaying 20 results from an estimated 109 matches for "avail_idx_shadow".

2015 Nov 11
2
[PATCH] virtio_ring: Shadow available ring flags & index
...virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -80,6 +80,12 @@ struct vring_virtqueue { /* Last used index we've seen. */ u16 last_used_idx; + /* Last written value to avail->flags */ + u16 avail_flags_shadow; + + /* Last written value to avail->idx in guest byte order */ + u16 avail_idx_shadow; + /* How to notify other side. FIXME: commonalize hcalls! */ bool (*notify)(struct virtqueue *vq); @@ -235,13 +241,14 @@ static inline int virtqueue_add(struct virtqueue *_vq, /* Put entry in available array (but don't update avail->idx until they * do sync). */ - avail = virti...
2015 Nov 11
2
[PATCH] virtio_ring: Shadow available ring flags & index
...virtio_ring.c +++ b/drivers/virtio/virtio_ring.c @@ -80,6 +80,12 @@ struct vring_virtqueue { /* Last used index we've seen. */ u16 last_used_idx; + /* Last written value to avail->flags */ + u16 avail_flags_shadow; + + /* Last written value to avail->idx in guest byte order */ + u16 avail_idx_shadow; + /* How to notify other side. FIXME: commonalize hcalls! */ bool (*notify)(struct virtqueue *vq); @@ -235,13 +241,14 @@ static inline int virtqueue_add(struct virtqueue *_vq, /* Put entry in available array (but don't update avail->idx until they * do sync). */ - avail = virti...
2015 Nov 11
0
[PATCH] virtio_ring: Shadow available ring flags & index
...g.c > @@ -80,6 +80,12 @@ struct vring_virtqueue { > /* Last used index we've seen. */ > u16 last_used_idx; > > + /* Last written value to avail->flags */ > + u16 avail_flags_shadow; > + > + /* Last written value to avail->idx in guest byte order */ > + u16 avail_idx_shadow; > + > /* How to notify other side. FIXME: commonalize hcalls! */ > bool (*notify)(struct virtqueue *vq); > > @@ -235,13 +241,14 @@ static inline int virtqueue_add(struct virtqueue *_vq, > > /* Put entry in available array (but don't update avail->idx until the...
2018 May 29
2
[RFC v5 2/5] virtio_ring: support creating packed ring
...value to avail->flags */ > - u16 avail_flags_shadow; > + union { > + /* Available for split ring */ > + struct { > + /* Actual memory layout for this queue. */ > + struct vring vring; > > - /* Last written value to avail->idx in guest byte order */ > - u16 avail_idx_shadow; > + /* Last written value to avail->flags */ > + u16 avail_flags_shadow; > + > + /* Last written value to avail->idx in > + * guest byte order. */ > + u16 avail_idx_shadow; > + }; > + > + /* Available for packed ring */ > + struct { > + /* Act...
2018 May 29
2
[RFC v5 2/5] virtio_ring: support creating packed ring
...value to avail->flags */ > - u16 avail_flags_shadow; > + union { > + /* Available for split ring */ > + struct { > + /* Actual memory layout for this queue. */ > + struct vring vring; > > - /* Last written value to avail->idx in guest byte order */ > - u16 avail_idx_shadow; > + /* Last written value to avail->flags */ > + u16 avail_flags_shadow; > + > + /* Last written value to avail->idx in > + * guest byte order. */ > + u16 avail_idx_shadow; > + }; > + > + /* Available for packed ring */ > + struct { > + /* Act...
2018 May 22
0
[RFC v5 2/5] virtio_ring: support creating packed ring
...n. */ u16 last_used_idx; - /* Last written value to avail->flags */ - u16 avail_flags_shadow; + union { + /* Available for split ring */ + struct { + /* Actual memory layout for this queue. */ + struct vring vring; - /* Last written value to avail->idx in guest byte order */ - u16 avail_idx_shadow; + /* Last written value to avail->flags */ + u16 avail_flags_shadow; + + /* Last written value to avail->idx in + * guest byte order. */ + u16 avail_idx_shadow; + }; + + /* Available for packed ring */ + struct { + /* Actual memory layout for this queue. */ + struct vring_p...
2018 Jul 11
0
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...n. */ u16 last_used_idx; - /* Last written value to avail->flags */ - u16 avail_flags_shadow; + union { + /* Available for split ring */ + struct { + /* Actual memory layout for this queue. */ + struct vring vring; - /* Last written value to avail->idx in guest byte order */ - u16 avail_idx_shadow; + /* Last written value to avail->flags */ + u16 avail_flags_shadow; + + /* Last written value to avail->idx in + * guest byte order. */ + u16 avail_idx_shadow; + }; + + /* Available for packed ring */ + struct { + /* Actual memory layout for this queue. */ + struct vring_p...
2017 Nov 29
0
[PATCH v18 06/10] virtio_ring: add a new API, virtqueue_add_one_desc
...b/drivers/virtio/virtio_ring.c @@ -257,6 +257,79 @@ static struct vring_desc *alloc_indirect(struct virtqueue *_vq, return desc; } +static void vring_set_avail(struct virtqueue *_vq, + unsigned int i) +{ + struct vring_virtqueue *vq = to_vvq(_vq); + unsigned int avail; + + avail = vq->avail_idx_shadow & (vq->vring.num - 1); + vq->vring.avail->ring[avail] = cpu_to_virtio16(_vq->vdev, i); + + /* + * Descriptors and available array need to be set before we expose the + * new available array entries. + */ + virtio_wmb(vq->weak_barriers); + vq->avail_idx_shadow++; + vq->vr...
2018 Sep 07
3
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...n value to avail->flags */ > - u16 avail_flags_shadow; > + union { > + /* Available for split ring */ > + struct { > + /* Actual memory layout for this queue. */ > + struct vring vring; > > - /* Last written value to avail->idx in guest byte order */ > - u16 avail_idx_shadow; > + /* Last written value to avail->flags */ > + u16 avail_flags_shadow; > + > + /* Last written value to avail->idx in > + * guest byte order. */ > + u16 avail_idx_shadow; > + }; Name this field split so it's easier to detect misuse of e.g. packed field...
2018 Sep 07
3
[PATCH net-next v2 2/5] virtio_ring: support creating packed ring
...n value to avail->flags */ > - u16 avail_flags_shadow; > + union { > + /* Available for split ring */ > + struct { > + /* Actual memory layout for this queue. */ > + struct vring vring; > > - /* Last written value to avail->idx in guest byte order */ > - u16 avail_idx_shadow; > + /* Last written value to avail->flags */ > + u16 avail_flags_shadow; > + > + /* Last written value to avail->idx in > + * guest byte order. */ > + u16 avail_idx_shadow; > + }; Name this field split so it's easier to detect misuse of e.g. packed field...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...> @@ -87,11 +87,28 @@ struct vring_virtqueue { > /* Last used index we've seen. */ > u16 last_used_idx; > > - /* Last written value to avail->flags */ > - u16 avail_flags_shadow; > - > - /* Last written value to avail->idx in guest byte order */ > - u16 avail_idx_shadow; > + union { > + /* Available for split ring */ > + struct { > + /* Actual memory layout for this queue */ > + struct vring vring; > + > + /* Last written value to avail->flags */ > + u16 avail_flags_shadow; > + > + /* Last written value to avail->idx...
2018 Mar 16
2
[PATCH RFC 2/2] virtio_ring: support packed ring
...> @@ -87,11 +87,28 @@ struct vring_virtqueue { > /* Last used index we've seen. */ > u16 last_used_idx; > > - /* Last written value to avail->flags */ > - u16 avail_flags_shadow; > - > - /* Last written value to avail->idx in guest byte order */ > - u16 avail_idx_shadow; > + union { > + /* Available for split ring */ > + struct { > + /* Actual memory layout for this queue */ > + struct vring vring; > + > + /* Last written value to avail->flags */ > + u16 avail_flags_shadow; > + > + /* Last written value to avail->idx...
2018 Apr 17
2
[RFC v2] virtio: support packed ring
...;t aware of it. I saw split ring decrease vring.avail->idx after detaching an unused desc, so I thought detaching unused desc also needs to make sure that the ring state will be updated correspondingly. If there is no such requirement, do you think it's OK to remove below two lines: vq->avail_idx_shadow--; vq->vring.avail->idx = cpu_to_virtio16(_vq->vdev, vq->avail_idx_shadow); from virtqueue_detach_unused_buf(), and we could have one generic function to handle both rings: void *virtqueue_detach_unused_buf(struct virtqueue *_vq) { struct vring_virtqueue *vq = to_vvq(_vq); unsigned...
2018 Apr 17
2
[RFC v2] virtio: support packed ring
...;t aware of it. I saw split ring decrease vring.avail->idx after detaching an unused desc, so I thought detaching unused desc also needs to make sure that the ring state will be updated correspondingly. If there is no such requirement, do you think it's OK to remove below two lines: vq->avail_idx_shadow--; vq->vring.avail->idx = cpu_to_virtio16(_vq->vdev, vq->avail_idx_shadow); from virtqueue_detach_unused_buf(), and we could have one generic function to handle both rings: void *virtqueue_detach_unused_buf(struct virtqueue *_vq) { struct vring_virtqueue *vq = to_vvq(_vq); unsigned...
2017 Nov 30
1
[PATCH v18 06/10] virtio_ring: add a new API, virtqueue_add_one_desc
...@ static struct vring_desc *alloc_indirect(struct virtqueue *_vq, > return desc; > } > > +static void vring_set_avail(struct virtqueue *_vq, > + unsigned int i) > +{ > + struct vring_virtqueue *vq = to_vvq(_vq); > + unsigned int avail; > + > + avail = vq->avail_idx_shadow & (vq->vring.num - 1); > + vq->vring.avail->ring[avail] = cpu_to_virtio16(_vq->vdev, i); > + > + /* > + * Descriptors and available array need to be set before we expose the > + * new available array entries. > + */ > + virtio_wmb(vq->weak_barriers); >...
2017 Nov 30
1
[PATCH v18 06/10] virtio_ring: add a new API, virtqueue_add_one_desc
...@ static struct vring_desc *alloc_indirect(struct virtqueue *_vq, > return desc; > } > > +static void vring_set_avail(struct virtqueue *_vq, > + unsigned int i) > +{ > + struct vring_virtqueue *vq = to_vvq(_vq); > + unsigned int avail; > + > + avail = vq->avail_idx_shadow & (vq->vring.num - 1); > + vq->vring.avail->ring[avail] = cpu_to_virtio16(_vq->vdev, i); > + > + /* > + * Descriptors and available array need to be set before we expose the > + * new available array entries. > + */ > + virtio_wmb(vq->weak_barriers); >...
2018 Feb 23
0
[PATCH RFC 2/2] virtio_ring: support packed ring
...we use weak barriers? */ bool weak_barriers; @@ -87,11 +87,28 @@ struct vring_virtqueue { /* Last used index we've seen. */ u16 last_used_idx; - /* Last written value to avail->flags */ - u16 avail_flags_shadow; - - /* Last written value to avail->idx in guest byte order */ - u16 avail_idx_shadow; + union { + /* Available for split ring */ + struct { + /* Actual memory layout for this queue */ + struct vring vring; + + /* Last written value to avail->flags */ + u16 avail_flags_shadow; + + /* Last written value to avail->idx in + * guest byte order */ + u16 avail_idx_s...
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 Mar 16
0
[PATCH RFC 2/2] virtio_ring: support packed ring
...ruct vring_virtqueue { > > /* Last used index we've seen. */ > > u16 last_used_idx; > > - /* Last written value to avail->flags */ > > - u16 avail_flags_shadow; > > - > > - /* Last written value to avail->idx in guest byte order */ > > - u16 avail_idx_shadow; > > + union { > > + /* Available for split ring */ > > + struct { > > + /* Actual memory layout for this queue */ > > + struct vring vring; > > + > > + /* Last written value to avail->flags */ > > + u16 avail_flags_shadow; > > + &g...
2018 May 22
9
[RFC v5 0/5] virtio: support packed ring
Hello everyone, This RFC implements packed ring support in virtio driver. Some simple functional tests have been done with Jason's packed ring implementation in vhost (RFC v4): https://lkml.org/lkml/2018/5/16/501 Both of ping and netperf worked as expected w/ EVENT_IDX disabled. Ping worked as expected w/ EVENT_IDX enabled, but netperf didn't (A hack has been added in the driver to