search for: __vhost_add_used_n

Displaying 20 results from an estimated 113 matches for "__vhost_add_used_n".

2018 Dec 13
1
[PATCH net-next 1/3] vhost: generalize adding used elem
.../vhost.c | 11 +---------- > 1 file changed, 1 insertion(+), 10 deletions(-) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 3a5f81a66d34..1c54ec1b82f8 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -2164,16 +2164,7 @@ static int __vhost_add_used_n(struct vhost_virtqueue *vq, > > start = vq->last_used_idx & (vq->num - 1); > used = vq->used->ring + start; > - if (count == 1) { > - if (vhost_put_user(vq, heads[0].id, &used->id)) { > - vq_err(vq, "Failed to write used id"); > - ret...
2017 Sep 26
2
[PATCH net-next RFC 3/5] vhost: introduce vhost_add_used_idx()
...ite(vq->log_base, > + vq->log_addr + offsetof(struct vring_used, idx), > + sizeof(vq->used->idx)); > + if (vq->log_ctx) > + eventfd_signal(vq->log_ctx, 1); > + } > + return 0; > +} > +EXPORT_SYMBOL_GPL(vhost_add_used_idx); > + > static int __vhost_add_used_n(struct vhost_virtqueue *vq, > struct vring_used_elem *heads, > unsigned count) > diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h > index 16c2cb6..5dd6c05 100644 > --- a/drivers/vhost/vhost.h > +++ b/drivers/vhost/vhost.h > @@ -199,6 +199,7 @@ int __vh...
2017 Sep 26
2
[PATCH net-next RFC 3/5] vhost: introduce vhost_add_used_idx()
...ite(vq->log_base, > + vq->log_addr + offsetof(struct vring_used, idx), > + sizeof(vq->used->idx)); > + if (vq->log_ctx) > + eventfd_signal(vq->log_ctx, 1); > + } > + return 0; > +} > +EXPORT_SYMBOL_GPL(vhost_add_used_idx); > + > static int __vhost_add_used_n(struct vhost_virtqueue *vq, > struct vring_used_elem *heads, > unsigned count) > diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h > index 16c2cb6..5dd6c05 100644 > --- a/drivers/vhost/vhost.h > +++ b/drivers/vhost/vhost.h > @@ -199,6 +199,7 @@ int __vh...
2010 Apr 26
1
[PATCH v6] Add mergeable rx buffer support to vhost_net
...((void __user *)used - (void __user *)vq->used), + sizeof *used); + /* Log used index update. */ + log_write(vq->log_base, + vq->log_addr + offsetof(struct vring_used, idx), + sizeof vq->used->idx); + if (vq->log_ctx) + eventfd_signal(vq->log_ctx, 1); +} + +static int __vhost_add_used_n(struct vhost_virtqueue *vq, + struct vring_used_elem *heads, + unsigned count) +{ + struct vring_used_elem __user *used; + int start; + + start = vq->last_used_idx % vq->num; + used = vq->used->ring + start; + if (copy_to_user(used, heads, count * sizeof *used)) { + vq_err(...
2010 Apr 26
1
[PATCH v6] Add mergeable rx buffer support to vhost_net
...((void __user *)used - (void __user *)vq->used), + sizeof *used); + /* Log used index update. */ + log_write(vq->log_base, + vq->log_addr + offsetof(struct vring_used, idx), + sizeof vq->used->idx); + if (vq->log_ctx) + eventfd_signal(vq->log_ctx, 1); +} + +static int __vhost_add_used_n(struct vhost_virtqueue *vq, + struct vring_used_elem *heads, + unsigned count) +{ + struct vring_used_elem __user *used; + int start; + + start = vq->last_used_idx % vq->num; + used = vq->used->ring + start; + if (copy_to_user(used, heads, count * sizeof *used)) { + vq_err(...
2017 Sep 27
2
[PATCH net-next RFC 3/5] vhost: introduce vhost_add_used_idx()
...t; > + sizeof(vq->used->idx)); > > > + if (vq->log_ctx) > > > + eventfd_signal(vq->log_ctx, 1); > > > + } > > > + return 0; > > > +} > > > +EXPORT_SYMBOL_GPL(vhost_add_used_idx); > > > + > > > static int __vhost_add_used_n(struct vhost_virtqueue *vq, > > > struct vring_used_elem *heads, > > > unsigned count) > > > diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h > > > index 16c2cb6..5dd6c05 100644 > > > --- a/drivers/vhost/vhost.h > > >...
2017 Sep 27
2
[PATCH net-next RFC 3/5] vhost: introduce vhost_add_used_idx()
...t; > + sizeof(vq->used->idx)); > > > + if (vq->log_ctx) > > > + eventfd_signal(vq->log_ctx, 1); > > > + } > > > + return 0; > > > +} > > > +EXPORT_SYMBOL_GPL(vhost_add_used_idx); > > > + > > > static int __vhost_add_used_n(struct vhost_virtqueue *vq, > > > struct vring_used_elem *heads, > > > unsigned count) > > > diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h > > > index 16c2cb6..5dd6c05 100644 > > > --- a/drivers/vhost/vhost.h > > >...
2020 Apr 20
2
[PATCH v3] virtio: force spec specified alignment on types
...ng_desc __user *desc, - struct vring_avail __user *avail, - struct vring_used __user *used) + vring_desc_t __user *desc, + vring_avail_t __user *avail, + vring_used_t __user *used) { return access_ok(desc, vhost_get_desc_size(vq, num)) && @@ -2301,7 +2301,7 @@ static int __vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, unsigned count) { - struct vring_used_elem __user *used; + vring_used_elem_t __user *used; u16 old, new; int start; diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index f8403bd46b85..60cab4c78229 100644 --...
2020 Apr 20
2
[PATCH v3] virtio: force spec specified alignment on types
...ng_desc __user *desc, - struct vring_avail __user *avail, - struct vring_used __user *used) + vring_desc_t __user *desc, + vring_avail_t __user *avail, + vring_used_t __user *used) { return access_ok(desc, vhost_get_desc_size(vq, num)) && @@ -2301,7 +2301,7 @@ static int __vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, unsigned count) { - struct vring_used_elem __user *used; + vring_used_elem_t __user *used; u16 old, new; int start; diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index f8403bd46b85..60cab4c78229 100644 --...
2020 Apr 22
2
[PATCH v4] virtio: force spec specified alignment on types
...ng_desc __user *desc, - struct vring_avail __user *avail, - struct vring_used __user *used) + vring_desc_t __user *desc, + vring_avail_t __user *avail, + vring_used_t __user *used) { return access_ok(desc, vhost_get_desc_size(vq, num)) && @@ -2301,7 +2301,7 @@ static int __vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, unsigned count) { - struct vring_used_elem __user *used; + vring_used_elem_t __user *used; u16 old, new; int start; diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index f8403bd46b85..60cab4c78229 100644 --...
2020 Apr 22
2
[PATCH v4] virtio: force spec specified alignment on types
...ng_desc __user *desc, - struct vring_avail __user *avail, - struct vring_used __user *used) + vring_desc_t __user *desc, + vring_avail_t __user *avail, + vring_used_t __user *used) { return access_ok(desc, vhost_get_desc_size(vq, num)) && @@ -2301,7 +2301,7 @@ static int __vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, unsigned count) { - struct vring_used_elem __user *used; + vring_used_elem_t __user *used; u16 old, new; int start; diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index f8403bd46b85..60cab4c78229 100644 --...
2010 Apr 28
6
[PATCHv7] add mergeable buffers support to vhost_net
...((void __user *)used - (void __user *)vq->used), + sizeof *used); + /* Log used index update. */ + log_write(vq->log_base, + vq->log_addr + offsetof(struct vring_used, idx), + sizeof vq->used->idx); + if (vq->log_ctx) + eventfd_signal(vq->log_ctx, 1); +} + +static int __vhost_add_used_n(struct vhost_virtqueue *vq, + struct vring_used_elem *heads, + unsigned count) +{ + struct vring_used_elem __user *used; + int start; + + start = vq->last_used_idx % vq->num; + used = vq->used->ring + start; + if (copy_to_user(used, heads, count * sizeof *used)) { + vq_err(...
2010 Apr 28
6
[PATCHv7] add mergeable buffers support to vhost_net
...((void __user *)used - (void __user *)vq->used), + sizeof *used); + /* Log used index update. */ + log_write(vq->log_base, + vq->log_addr + offsetof(struct vring_used, idx), + sizeof vq->used->idx); + if (vq->log_ctx) + eventfd_signal(vq->log_ctx, 1); +} + +static int __vhost_add_used_n(struct vhost_virtqueue *vq, + struct vring_used_elem *heads, + unsigned count) +{ + struct vring_used_elem __user *used; + int start; + + start = vq->last_used_idx % vq->num; + used = vq->used->ring + start; + if (copy_to_user(used, heads, count * sizeof *used)) { + vq_err(...
2017 Sep 22
0
[PATCH net-next RFC 3/5] vhost: introduce vhost_add_used_idx()
...used)) { + /* Log used index update. */ + log_write(vq->log_base, + vq->log_addr + offsetof(struct vring_used, idx), + sizeof(vq->used->idx)); + if (vq->log_ctx) + eventfd_signal(vq->log_ctx, 1); + } + return 0; +} +EXPORT_SYMBOL_GPL(vhost_add_used_idx); + static int __vhost_add_used_n(struct vhost_virtqueue *vq, struct vring_used_elem *heads, unsigned count) diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 16c2cb6..5dd6c05 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -199,6 +199,7 @@ int __vhost_get_vq_desc(struct vhost_virtqu...
2017 Sep 27
0
[PATCH net-next RFC 3/5] vhost: introduce vhost_add_used_idx()
...t;log_addr + offsetof(struct vring_used, idx), >> + sizeof(vq->used->idx)); >> + if (vq->log_ctx) >> + eventfd_signal(vq->log_ctx, 1); >> + } >> + return 0; >> +} >> +EXPORT_SYMBOL_GPL(vhost_add_used_idx); >> + >> static int __vhost_add_used_n(struct vhost_virtqueue *vq, >> struct vring_used_elem *heads, >> unsigned count) >> diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h >> index 16c2cb6..5dd6c05 100644 >> --- a/drivers/vhost/vhost.h >> +++ b/drivers/vhost/vhost.h >&gt...
2018 Dec 13
0
[PATCH net-next 1/3] vhost: generalize adding used elem
...t redhat.com> --- drivers/vhost/vhost.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 3a5f81a66d34..1c54ec1b82f8 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -2164,16 +2164,7 @@ static int __vhost_add_used_n(struct vhost_virtqueue *vq, start = vq->last_used_idx & (vq->num - 1); used = vq->used->ring + start; - if (count == 1) { - if (vhost_put_user(vq, heads[0].id, &used->id)) { - vq_err(vq, "Failed to write used id"); - return -EFAULT; - } - if (vhost_put_...
2018 Dec 29
0
[RFC PATCH V3 1/5] vhost: generalize adding used elem
...t redhat.com> --- drivers/vhost/vhost.c | 11 +---------- 1 file changed, 1 insertion(+), 10 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 55e5aa662ad5..f179b5ee14c4 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -2174,16 +2174,7 @@ static int __vhost_add_used_n(struct vhost_virtqueue *vq, start = vq->last_used_idx & (vq->num - 1); used = vq->used->ring + start; - if (count == 1) { - if (vhost_put_user(vq, heads[0].id, &used->id)) { - vq_err(vq, "Failed to write used id"); - return -EFAULT; - } - if (vhost_put_...
2020 Jun 03
2
[PATCH RFC 07/13] vhost: format-independent API for used buffers
...st_get_avail_buf. Useful for error handling. */ > +void vhost_discard_avail_bufs(struct vhost_virtqueue *vq, > + struct vhost_buf *buf, unsigned count) > +{ > + vhost_discard_vq_desc(vq, count); > +} > +EXPORT_SYMBOL_GPL(vhost_discard_avail_bufs); > > static int __vhost_add_used_n(struct vhost_virtqueue *vq, > struct vring_used_elem *heads, > @@ -2459,6 +2471,26 @@ int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) > } > EXPORT_SYMBOL_GPL(vhost_add_used); > > +int vhost_put_used_buf(struct vhost_virtqueue *vq, struct...
2018 Dec 12
2
[PATCH net V2 4/4] vhost: log dirty page correctly
...(used - (void __user *)vq->used), > - sizeof *vhost_avail_event(vq)); > + log_used(vq, (used - (void __user *)vq->used), > + sizeof *vhost_avail_event(vq)); > if (vq->log_ctx) > eventfd_signal(vq->log_ctx, 1); > } > @@ -2191,10 +2245,8 @@ static int __vhost_add_used_n(struct vhost_virtqueue *vq, > /* Make sure data is seen before log. */ > smp_wmb(); > /* Log used ring entry write. */ > - log_write(vq->log_base, > - vq->log_addr + > - ((void __user *)used - (void __user *)vq->used), > - count * sizeof *used);...
2020 Jun 03
2
[PATCH RFC 07/13] vhost: format-independent API for used buffers
...st_get_avail_buf. Useful for error handling. */ > +void vhost_discard_avail_bufs(struct vhost_virtqueue *vq, > + struct vhost_buf *buf, unsigned count) > +{ > + vhost_discard_vq_desc(vq, count); > +} > +EXPORT_SYMBOL_GPL(vhost_discard_avail_bufs); > > static int __vhost_add_used_n(struct vhost_virtqueue *vq, > struct vring_used_elem *heads, > @@ -2459,6 +2471,26 @@ int vhost_add_used(struct vhost_virtqueue *vq, unsigned int head, int len) > } > EXPORT_SYMBOL_GPL(vhost_add_used); > > +int vhost_put_used_buf(struct vhost_virtqueue *vq, struct...