search for: is_used_desc_pack

Displaying 20 results from an estimated 25 matches for "is_used_desc_pack".

Did you mean: is_used_desc_packed
2019 Oct 25
1
[PATCH] virtio_ring: fix packed ring event may missing
...) { OK so trying to unpack the scenario. First you patch only affects code running when EVENT_IDX is off, so legal values for flags are enable and disable. Next point, this calculates the index at which we are going to look for the flags to change, in other words it affects the line if (is_used_desc_packed(vq, used_idx, wrap_counter)) { below. Without your patch, we simply look at the next descriptor. This is exactly what the spec says we should do: Writes of device and driver descriptors can generally be reordered, but each side (driver and device) are only required to poll (or test) a single...
2019 Oct 25
1
[PATCH] virtio_ring: fix packed ring event may missing
...= vq->packed.used_wrap_counter; > } > > if (vq->packed.event_flags_shadow == VRING_PACKED_EVENT_FLAG_DISABLE) { > @@ -1518,7 +1515,9 @@ static bool virtqueue_enable_cb_delayed_packed(struct virtqueue *_vq) > */ > virtio_mb(vq->weak_barriers); > > - if (is_used_desc_packed(vq, used_idx, wrap_counter)) { > + if (is_used_desc_packed(vq, > + vq->last_used_idx, > + vq->packed.used_wrap_counter)) { > END_USE(vq); > return false; > } > -- > 2.17.1
2019 Oct 27
1
[PATCH] virtio_ring: fix stalls for packed rings
...= vq->last_used_idx; - wrap_counter = vq->packed.used_wrap_counter; } if (vq->packed.event_flags_shadow == VRING_PACKED_EVENT_FLAG_DISABLE) { @@ -1518,7 +1515,9 @@ static bool virtqueue_enable_cb_delayed_packed(struct virtqueue *_vq) */ virtio_mb(vq->weak_barriers); - if (is_used_desc_packed(vq, used_idx, wrap_counter)) { + if (is_used_desc_packed(vq, + vq->last_used_idx, + vq->packed.used_wrap_counter)) { END_USE(vq); return false; } -- MST
2019 Oct 24
1
[PATCH] virtio_ring: fix packed ring event may missing
...FLAG_DISABLE) >>>> { >>>>> @@ -1518,7 +1515,9 @@ static bool >>>> virtqueue_enable_cb_delayed_packed(struct virtqueue *_vq) >>>>> */ >>>>> virtio_mb(vq->weak_barriers); >>>>> >>>>> - if (is_used_desc_packed(vq, used_idx, wrap_counter)) { >>>>> + if (is_used_desc_packed(vq, >>>>> + vq->last_used_idx, >>>>> + vq->packed.used_wrap_counter)) { >>>>> END_USE(vq); >>>>> return false; >>>>>...
2019 Oct 22
0
[PATCH] virtio_ring: fix packed ring event may missing
...>packed.used_wrap_counter; > } > > if (vq->packed.event_flags_shadow == VRING_PACKED_EVENT_FLAG_DISABLE) { > @@ -1518,7 +1515,9 @@ static bool virtqueue_enable_cb_delayed_packed(struct virtqueue *_vq) > */ > virtio_mb(vq->weak_barriers); > > - if (is_used_desc_packed(vq, used_idx, wrap_counter)) { > + if (is_used_desc_packed(vq, > + vq->last_used_idx, > + vq->packed.used_wrap_counter)) { > END_USE(vq); > return false; > } Hi Marvin: Two questions: 1) Do we support IN_ORDER in kernel driver? 2) Should we check IN_O...
2019 Oct 22
0
[PATCH] virtio_ring: fix packed ring event may missing
...f (vq->packed.event_flags_shadow == VRING_PACKED_EVENT_FLAG_DISABLE) >> { >>> @@ -1518,7 +1515,9 @@ static bool >> virtqueue_enable_cb_delayed_packed(struct virtqueue *_vq) >>> */ >>> virtio_mb(vq->weak_barriers); >>> >>> - if (is_used_desc_packed(vq, used_idx, wrap_counter)) { >>> + if (is_used_desc_packed(vq, >>> + vq->last_used_idx, >>> + vq->packed.used_wrap_counter)) { >>> END_USE(vq); >>> return false; >>> } >> >> Hi Marvin: >> >>...
2019 Oct 27
0
[PATCH] virtio_ring: fix packed ring event may missing
...= vq->packed.used_wrap_counter; > } > > if (vq->packed.event_flags_shadow == VRING_PACKED_EVENT_FLAG_DISABLE) { > @@ -1518,7 +1515,9 @@ static bool virtqueue_enable_cb_delayed_packed(struct virtqueue *_vq) > */ > virtio_mb(vq->weak_barriers); > > - if (is_used_desc_packed(vq, used_idx, wrap_counter)) { > + if (is_used_desc_packed(vq, > + vq->last_used_idx, > + vq->packed.used_wrap_counter)) { > END_USE(vq); > return false; > } > -- > 2.17.1
2018 Jul 11
0
[PATCH net-next v2 3/5] virtio_ring: add packed ring support
....len; + for (i = 0; i < len / sizeof(struct vring_packed_desc); + i++) + vring_unmap_desc_packed(vq, &desc[i]); + } + kfree(desc); + vq->desc_state_packed[id].indir_desc = NULL; + } else if (ctx) { + *ctx = vq->desc_state_packed[id].indir_desc; + } +} + +static inline bool is_used_desc_packed(const struct vring_virtqueue *vq, + u16 idx, bool used_wrap_counter) +{ + u16 flags; + bool avail, used; + + flags = virtio16_to_cpu(vq->vq.vdev, + vq->vring_packed.desc[idx].flags); + avail = !!(flags & VRING_DESC_F_AVAIL); + used = !!(flags & VRING_DESC_F_USED); + + r...
2018 Sep 07
1
[PATCH net-next v2 3/5] virtio_ring: add packed ring support
...packed_desc); > + i++) > + vring_unmap_desc_packed(vq, &desc[i]); > + } > + kfree(desc); > + vq->desc_state_packed[id].indir_desc = NULL; > + } else if (ctx) { > + *ctx = vq->desc_state_packed[id].indir_desc; > + } > +} > + > +static inline bool is_used_desc_packed(const struct vring_virtqueue *vq, > + u16 idx, bool used_wrap_counter) > +{ > + u16 flags; > + bool avail, used; > + > + flags = virtio16_to_cpu(vq->vq.vdev, > + vq->vring_packed.desc[idx].flags); > + avail = !!(flags & VRING_DESC_F_AVAIL); > + us...
2018 Dec 07
0
[RFC 3/3] virtio_ring: use new vring flags
...D_EVENT_F_WRAP_CTR; - event_idx = off_wrap & ~(1 << VRING_PACKED_EVENT_F_WRAP_CTR); + event_idx = off_wrap & ~BIT(VRING_PACKED_EVENT_F_WRAP_CTR); if (wrap_counter != vq->packed.avail_wrap_counter) event_idx -= vq->packed.vring.num; @@ -1321,8 +1338,8 @@ static inline bool is_used_desc_packed(const struct vring_virtqueue *vq, u16 flags; flags = le16_to_cpu(vq->packed.vring.desc[idx].flags); - avail = !!(flags & (1 << VRING_PACKED_DESC_F_AVAIL)); - used = !!(flags & (1 << VRING_PACKED_DESC_F_USED)); + avail = !!(flags & BIT(VRING_PACKED_DESC_F_AVAIL));...
2018 Sep 07
1
[PATCH net-next v2 4/5] virtio_ring: add event idx support in packed ring
..._barriers); > } > > - if (more_used_packed(vq)) { > + /* We need to update event suppression structure first > + * before re-checking for more used buffers. */ > + virtio_mb(vq->weak_barriers); > + mb is expensive. We should not do it if we changed nothing. > + if (is_used_desc_packed(vq, used_idx, wrap_counter)) { > END_USE(vq); > return false; > } > -- > 2.18.0
2018 Nov 07
2
[PATCH net-next v2 3/5] virtio_ring: add packed ring support
...packed_desc); > + i++) > + vring_unmap_desc_packed(vq, &desc[i]); > + } > + kfree(desc); > + vq->desc_state_packed[id].indir_desc = NULL; > + } else if (ctx) { > + *ctx = vq->desc_state_packed[id].indir_desc; > + } > +} > + > +static inline bool is_used_desc_packed(const struct vring_virtqueue *vq, > + u16 idx, bool used_wrap_counter) > +{ > + u16 flags; > + bool avail, used; > + > + flags = virtio16_to_cpu(vq->vq.vdev, > + vq->vring_packed.desc[idx].flags); > + avail = !!(flags & VRING_DESC_F_AVAIL); > + us...
2018 Nov 07
2
[PATCH net-next v2 3/5] virtio_ring: add packed ring support
...packed_desc); > + i++) > + vring_unmap_desc_packed(vq, &desc[i]); > + } > + kfree(desc); > + vq->desc_state_packed[id].indir_desc = NULL; > + } else if (ctx) { > + *ctx = vq->desc_state_packed[id].indir_desc; > + } > +} > + > +static inline bool is_used_desc_packed(const struct vring_virtqueue *vq, > + u16 idx, bool used_wrap_counter) > +{ > + u16 flags; > + bool avail, used; > + > + flags = virtio16_to_cpu(vq->vq.vdev, > + vq->vring_packed.desc[idx].flags); > + avail = !!(flags & VRING_DESC_F_AVAIL); > + us...
2018 Jul 09
0
[PATCH net-next v1 4/5] virtio_ring: add event idx support in packed ring
...to enable interrupts first before re-checking - * for more used buffers. */ - virtio_mb(vq->weak_barriers); } - if (more_used_packed(vq)) { + /* We need to update event suppression structure first + * before re-checking for more used buffers. */ + virtio_mb(vq->weak_barriers); + + if (is_used_desc_packed(vq, used_idx, wrap_counter)) { END_USE(vq); return false; } -- 2.18.0
2018 Jul 11
0
[PATCH net-next v2 4/5] virtio_ring: add event idx support in packed ring
...to enable interrupts first before re-checking - * for more used buffers. */ - virtio_mb(vq->weak_barriers); } - if (more_used_packed(vq)) { + /* We need to update event suppression structure first + * before re-checking for more used buffers. */ + virtio_mb(vq->weak_barriers); + + if (is_used_desc_packed(vq, used_idx, wrap_counter)) { END_USE(vq); return false; } -- 2.18.0
2018 Jul 11
15
[PATCH net-next v2 0/5] virtio: support packed ring
Hello everyone, This patch set implements packed ring support in virtio driver. Some functional tests have been done with Jason's packed ring implementation in vhost: https://lkml.org/lkml/2018/7/3/33 Both of ping and netperf worked as expected. v1 -> v2: - Use READ_ONCE() to read event off_wrap and flags together (Jason); - Add comments related to ccw (Jason); RFC (v6) -> v1: -
2018 Jul 11
15
[PATCH net-next v2 0/5] virtio: support packed ring
Hello everyone, This patch set implements packed ring support in virtio driver. Some functional tests have been done with Jason's packed ring implementation in vhost: https://lkml.org/lkml/2018/7/3/33 Both of ping and netperf worked as expected. v1 -> v2: - Use READ_ONCE() to read event off_wrap and flags together (Jason); - Add comments related to ccw (Jason); RFC (v6) -> v1: -
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,
2018 Jul 09
7
[PATCH net-next v1 0/5] virtio: support packed ring
Hello everyone, This patch set implements packed ring support in virtio driver. Some functional tests have been done with Jason's packed ring implementation in vhost: https://lkml.org/lkml/2018/7/3/33 Both of ping and netperf worked as expected. RFC (v6) -> v1: - Avoid extra virtio_wmb() in virtqueue_enable_cb_delayed_packed() when event idx is off (Jason); - Fix bufs calculation in