Displaying 20 results from an estimated 113 matches for "off_wrap".
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...; > > > Thanks
> > > Sorry, looks like the following should work, we need add vq.num if
> > > used_wrap_counter does not match:
> > >
> > > static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq,
> > > ??? ??? ??? ??? ??? ? __u16 off_wrap, __u16 new,
> > > ??? ??? ??? ??? ??? ? __u16 old)
> > > {
> > > ??? bool wrap = off_wrap >> 15;
> > > ??? int off = off_wrap & ~(1 << 15);
> > > ??? __u16 d1, d2;
> > >
> > > ??? if (wrap != vq->used_wrap_count...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...; > > > Thanks
> > > Sorry, looks like the following should work, we need add vq.num if
> > > used_wrap_counter does not match:
> > >
> > > static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq,
> > > ??? ??? ??? ??? ??? ? __u16 off_wrap, __u16 new,
> > > ??? ??? ??? ??? ??? ? __u16 old)
> > > {
> > > ??? bool wrap = off_wrap >> 15;
> > > ??? int off = off_wrap & ~(1 << 15);
> > > ??? __u16 d1, d2;
> > >
> > > ??? if (wrap != vq->used_wrap_count...
2018 May 08
1
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...rry, looks like the following should work, we need add vq.num if
> > > > > used_wrap_counter does not match:
> > > > >
> > > > > static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq,
> > > > > ??? ??? ??? ??? ??? ? __u16 off_wrap, __u16 new,
> > > > > ??? ??? ??? ??? ??? ? __u16 old)
> > > > > {
> > > > > ??? bool wrap = off_wrap >> 15;
> > > > > ??? int off = off_wrap & ~(1 << 15);
> > > > > ??? __u16 d1, d2;
> > > &...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...hout the need to try to add vq.num here.
> >
> > Thanks
>
> Sorry, looks like the following should work, we need add vq.num if
> used_wrap_counter does not match:
>
> static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq,
> ??? ??? ??? ??? ??? ? __u16 off_wrap, __u16 new,
> ??? ??? ??? ??? ??? ? __u16 old)
> {
> ??? bool wrap = off_wrap >> 15;
> ??? int off = off_wrap & ~(1 << 15);
> ??? __u16 d1, d2;
>
> ??? if (wrap != vq->used_wrap_counter)
> ??? ??? d1 = new + vq->num - off - 1;
Just to draw your attent...
2018 May 08
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...hout the need to try to add vq.num here.
> >
> > Thanks
>
> Sorry, looks like the following should work, we need add vq.num if
> used_wrap_counter does not match:
>
> static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq,
> ??? ??? ??? ??? ??? ? __u16 off_wrap, __u16 new,
> ??? ??? ??? ??? ??? ? __u16 old)
> {
> ??? bool wrap = off_wrap >> 15;
> ??? int off = off_wrap & ~(1 << 15);
> ??? __u16 d1, d2;
>
> ??? if (wrap != vq->used_wrap_counter)
> ??? ??? d1 = new + vq->num - off - 1;
Just to draw your attent...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
....c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -986,7 +986,7 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
> static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> {
> struct vring_virtqueue *vq = to_vvq(_vq);
> - u16 flags;
> + u16 new, old, off_wrap, flags;
> bool needs_kick;
> u32 snapshot;
>
> @@ -995,7 +995,12 @@ static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> * suppressions. */
> virtio_mb(vq->weak_barriers);
>
> + old = vq->next_avail_idx - vq->num_added;
> + new =...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
....c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -986,7 +986,7 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
> static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> {
> struct vring_virtqueue *vq = to_vvq(_vq);
> - u16 flags;
> + u16 new, old, off_wrap, flags;
> bool needs_kick;
> u32 snapshot;
>
> @@ -995,7 +995,12 @@ static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> * suppressions. */
> virtio_mb(vq->weak_barriers);
>
> + old = vq->next_avail_idx - vq->num_added;
> + new =...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...-986,7 +986,7 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
> > > static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> > > {
> > > struct vring_virtqueue *vq = to_vvq(_vq);
> > > - u16 flags;
> > > + u16 new, old, off_wrap, flags;
> > > bool needs_kick;
> > > u32 snapshot;
> > > @@ -995,7 +995,12 @@ static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> > > * suppressions. */
> > > virtio_mb(vq->weak_barriers);
> > > + old = vq->next...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...-986,7 +986,7 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
> > > static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> > > {
> > > struct vring_virtqueue *vq = to_vvq(_vq);
> > > - u16 flags;
> > > + u16 new, old, off_wrap, flags;
> > > bool needs_kick;
> > > u32 snapshot;
> > > @@ -995,7 +995,12 @@ static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> > > * suppressions. */
> > > virtio_mb(vq->weak_barriers);
> > > + old = vq->next...
2018 Sep 07
1
[PATCH net-next v2 4/5] virtio_ring: add event idx support in packed ring
...g.c
> +++ b/drivers/virtio/virtio_ring.c
> @@ -1050,7 +1050,7 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
> static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> {
> struct vring_virtqueue *vq = to_vvq(_vq);
> - u16 flags;
> + u16 new, old, off_wrap, flags, wrap_counter, event_idx;
> bool needs_kick;
> u32 snapshot;
>
> @@ -1059,9 +1059,19 @@ static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> * suppressions. */
> virtio_mb(vq->weak_barriers);
>
> + old = vq->next_avail_idx - vq->num...
2018 May 29
0
[RFC V5 PATCH 8/8] vhost: event suppression for packed ring
...= &vq->device_event->flags;
+ log_write(vq->log_base, vq->log_addr +
+ (flags - (void __user *)vq->device_event),
+ sizeof(vq->device_event->flags));
+ if (vq->log_ctx)
+ eventfd_signal(vq->log_ctx, 1);
+ }
+ return 0;
+}
+
+static int vhost_update_device_off_wrap(struct vhost_virtqueue *vq,
+ __virtio16 device_off_wrap)
+{
+ void __user *off_wrap;
+
+ if (vhost_put_user(vq, device_off_wrap, &vq->device_event->off_wrap,
+ VHOST_ADDR_USED) < 0)
+ return -EFAULT;
+ if (unlikely(vq->log_used)) {
+ /* Make sure the flag is seen before...
2018 Jul 03
0
[PATCH net-next 8/8] vhost: event suppression for packed ring
...= &vq->device_event->flags;
+ log_write(vq->log_base, vq->log_addr +
+ (flags - (void __user *)vq->device_event),
+ sizeof(vq->device_event->flags));
+ if (vq->log_ctx)
+ eventfd_signal(vq->log_ctx, 1);
+ }
+ return 0;
+}
+
+static int vhost_update_device_off_wrap(struct vhost_virtqueue *vq,
+ __virtio16 device_off_wrap)
+{
+ void __user *off_wrap;
+
+ if (vhost_put_user(vq, device_off_wrap, &vq->device_event->off_wrap,
+ VHOST_ADDR_USED) < 0)
+ return -EFAULT;
+ if (unlikely(vq->log_used)) {
+ /* Make sure the flag is seen before...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...packed(struct virtqueue *_vq,
> > > > > static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> > > > > {
> > > > > struct vring_virtqueue *vq = to_vvq(_vq);
> > > > > - u16 flags;
> > > > > + u16 new, old, off_wrap, flags;
> > > > > bool needs_kick;
> > > > > u32 snapshot;
> > > > > @@ -995,7 +995,12 @@ static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> > > > > * suppressions. */
> > > > > virtio_mb(vq->...
2018 May 02
2
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...packed(struct virtqueue *_vq,
> > > > > static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> > > > > {
> > > > > struct vring_virtqueue *vq = to_vvq(_vq);
> > > > > - u16 flags;
> > > > > + u16 new, old, off_wrap, flags;
> > > > > bool needs_kick;
> > > > > u32 snapshot;
> > > > > @@ -995,7 +995,12 @@ static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> > > > > * suppressions. */
> > > > > virtio_mb(vq->...
2018 May 30
2
[RFC V5 PATCH 8/8] vhost: event suppression for packed ring
..._write(vq->log_base, vq->log_addr +
> + (flags - (void __user *)vq->device_event),
> + sizeof(vq->device_event->flags));
> + if (vq->log_ctx)
> + eventfd_signal(vq->log_ctx, 1);
> + }
> + return 0;
> +}
> +
> +static int vhost_update_device_off_wrap(struct vhost_virtqueue *vq,
> + __virtio16 device_off_wrap)
> +{
> + void __user *off_wrap;
> +
> + if (vhost_put_user(vq, device_off_wrap, &vq->device_event->off_wrap,
> + VHOST_ADDR_USED) < 0)
> + return -EFAULT;
> + if (unlikely(vq->log_used)) {...
2018 May 30
2
[RFC V5 PATCH 8/8] vhost: event suppression for packed ring
..._write(vq->log_base, vq->log_addr +
> + (flags - (void __user *)vq->device_event),
> + sizeof(vq->device_event->flags));
> + if (vq->log_ctx)
> + eventfd_signal(vq->log_ctx, 1);
> + }
> + return 0;
> +}
> +
> +static int vhost_update_device_off_wrap(struct vhost_virtqueue *vq,
> + __virtio16 device_off_wrap)
> +{
> + void __user *off_wrap;
> +
> + if (vhost_put_user(vq, device_off_wrap, &vq->device_event->off_wrap,
> + VHOST_ADDR_USED) < 0)
> + return -EFAULT;
> + if (unlikely(vq->log_used)) {...
2018 Apr 17
2
[RFC v2] virtio: support packed ring
...gt; > packed ring. So I'll take your suggestion. Thanks!
> >
> > [...]
> > > > +static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> > > > +{
> > > > + struct vring_virtqueue *vq = to_vvq(_vq);
> > > > + u16 new, old, off_wrap;
> > > > + bool needs_kick;
> > > > +
> > > > + START_USE(vq);
> > > > + /* We need to expose the new flags value before checking notification
> > > > + * suppressions. */
> > > > + virtio_mb(vq->weak_barriers);
> > &...
2018 Apr 17
2
[RFC v2] virtio: support packed ring
...gt; > packed ring. So I'll take your suggestion. Thanks!
> >
> > [...]
> > > > +static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
> > > > +{
> > > > + struct vring_virtqueue *vq = to_vvq(_vq);
> > > > + u16 new, old, off_wrap;
> > > > + bool needs_kick;
> > > > +
> > > > + START_USE(vq);
> > > > + /* We need to expose the new flags value before checking notification
> > > > + * suppressions. */
> > > > + virtio_mb(vq->weak_barriers);
> > &...
2018 May 08
0
[RFC v3 4/5] virtio_ring: add event idx support in packed ring
...t;> Thanks
>>>> Sorry, looks like the following should work, we need add vq.num if
>>>> used_wrap_counter does not match:
>>>>
>>>> static bool vhost_vring_packed_need_event(struct vhost_virtqueue *vq,
>>>> ??? ??? ??? ??? ??? ? __u16 off_wrap, __u16 new,
>>>> ??? ??? ??? ??? ??? ? __u16 old)
>>>> {
>>>> ??? bool wrap = off_wrap >> 15;
>>>> ??? int off = off_wrap & ~(1 << 15);
>>>> ??? __u16 d1, d2;
>>>>
>>>> ??? if (wrap != vq-&...
2018 Jul 09
0
[PATCH net-next v1 4/5] virtio_ring: add event idx support in packed ring
...644
--- a/drivers/virtio/virtio_ring.c
+++ b/drivers/virtio/virtio_ring.c
@@ -1050,7 +1050,7 @@ static inline int virtqueue_add_packed(struct virtqueue *_vq,
static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
{
struct vring_virtqueue *vq = to_vvq(_vq);
- u16 flags;
+ u16 new, old, off_wrap, flags, wrap_counter, event_idx;
bool needs_kick;
u32 snapshot;
@@ -1059,9 +1059,19 @@ static bool virtqueue_kick_prepare_packed(struct virtqueue *_vq)
* suppressions. */
virtio_mb(vq->weak_barriers);
+ old = vq->next_avail_idx - vq->num_added;
+ new = vq->next_avail_idx;
+...