search for: vhost_work_fn_t

Displaying 20 results from an estimated 116 matches for "vhost_work_fn_t".

2018 Jan 09
1
[PATCH] vhost: Remove the unused variable.
...host.c | 1 - drivers/vhost/vhost.h | 4 ---- 2 files changed, 5 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 33ac2b186b85..9b04cad91d65 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -181,7 +181,6 @@ void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) { clear_bit(VHOST_WORK_QUEUED, &work->flags); work->fn = fn; - init_waitqueue_head(&work->done); } EXPORT_SYMBOL_GPL(vhost_work_init); diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 79c6e7a60a5e..749fe13e061c 100644 --- a/drivers/vhost/vhost.h +++ b/d...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...include <linux/mm.h> -#include <linux/mutex.h> -#include <linux/poll.h> -#include <linux/file.h> -#include <linux/uio.h> -#include <linux/virtio_config.h> -#include <linux/virtio_ring.h> -#include <linux/atomic.h> - -struct vhost_work; -typedef void (*vhost_work_fn_t)(struct vhost_work *work); - -#define VHOST_WORK_QUEUED 1 -struct vhost_work { - struct llist_node node; - vhost_work_fn_t fn; - wait_queue_head_t done; - int flushing; - unsigned queue_seq; - unsigned done_seq; - unsigned long flags; -}; - -/* Poll a file (eventfd or socket) */...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...include <linux/mm.h> -#include <linux/mutex.h> -#include <linux/poll.h> -#include <linux/file.h> -#include <linux/uio.h> -#include <linux/virtio_config.h> -#include <linux/virtio_ring.h> -#include <linux/atomic.h> - -struct vhost_work; -typedef void (*vhost_work_fn_t)(struct vhost_work *work); - -#define VHOST_WORK_QUEUED 1 -struct vhost_work { - struct llist_node node; - vhost_work_fn_t fn; - wait_queue_head_t done; - int flushing; - unsigned queue_seq; - unsigned done_seq; - unsigned long flags; -}; - -/* Poll a file (eventfd or socket) */...
2018 Sep 09
0
[PATCH net-next v8 5/7] net: vhost: introduce bitmap for vhost_poll
...f->private_data = n; > > > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > > index a1c06e7..dc88a60 100644 > > --- a/drivers/vhost/vhost.c > > +++ b/drivers/vhost/vhost.c > > @@ -186,7 +186,7 @@ void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) > > > > /* Init poll structure */ > > void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, > > - __poll_t mask, struct vhost_dev *dev) > > + __u8 poll_id, __poll_t mask, struct vhost_dev *dev) > > { > &g...
2016 Apr 26
2
[PATCH 1/2] vhost: simplify work flushing
...{ + struct vhost_flush_struct *s; + + s = container_of(work, struct vhost_flush_struct, work); + complete(&s->wait_event); +} + static void vhost_poll_func(struct file *file, wait_queue_head_t *wqh, poll_table *pt) { @@ -158,8 +171,6 @@ void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) INIT_LIST_HEAD(&work->node); work->fn = fn; init_waitqueue_head(&work->done); - work->flushing = 0; - work->queue_seq = work->done_seq = 0; } EXPORT_SYMBOL_GPL(vhost_work_init); @@ -211,31 +222,17 @@ void vhost_poll_stop(struct vhost_poll *poll) } EXPORT_SY...
2016 Apr 26
2
[PATCH 1/2] vhost: simplify work flushing
...{ + struct vhost_flush_struct *s; + + s = container_of(work, struct vhost_flush_struct, work); + complete(&s->wait_event); +} + static void vhost_poll_func(struct file *file, wait_queue_head_t *wqh, poll_table *pt) { @@ -158,8 +171,6 @@ void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) INIT_LIST_HEAD(&work->node); work->fn = fn; init_waitqueue_head(&work->done); - work->flushing = 0; - work->queue_seq = work->done_seq = 0; } EXPORT_SYMBOL_GPL(vhost_work_init); @@ -211,31 +222,17 @@ void vhost_poll_stop(struct vhost_poll *poll) } EXPORT_SY...
2017 Mar 10
0
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...x/mutex.h> > -#include <linux/poll.h> > -#include <linux/file.h> > -#include <linux/uio.h> > -#include <linux/virtio_config.h> > -#include <linux/virtio_ring.h> > -#include <linux/atomic.h> > - > -struct vhost_work; > -typedef void (*vhost_work_fn_t)(struct vhost_work *work); > - > -#define VHOST_WORK_QUEUED 1 > -struct vhost_work { > - struct llist_node node; > - vhost_work_fn_t fn; > - wait_queue_head_t done; > - int flushing; > - unsigned queue_seq; > - unsigned done_seq; > - unsigned long f...
2020 Apr 26
3
[PATCH V2 1/2] vdpa: Support config interrupt in vhost_vdpa
...ctx_fdget(f.fd); > if (IS_ERR(ctx)) { > r = PTR_ERR(ctx); > break; > diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h > index 1813821..8663139 100644 > --- a/drivers/vhost/vhost.h > +++ b/drivers/vhost/vhost.h > @@ -18,6 +18,8 @@ > typedef void (*vhost_work_fn_t)(struct vhost_work *work); > > #define VHOST_WORK_QUEUED 1 > +#define VHOST_FILE_UNBIND -1 I think it's better to document this in uapi. > + > struct vhost_work { > struct llist_node node; > vhost_work_fn_t fn; > diff --git a/include/uapi/linux/vhos...
2020 Apr 26
3
[PATCH V2 1/2] vdpa: Support config interrupt in vhost_vdpa
...ctx_fdget(f.fd); > if (IS_ERR(ctx)) { > r = PTR_ERR(ctx); > break; > diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h > index 1813821..8663139 100644 > --- a/drivers/vhost/vhost.h > +++ b/drivers/vhost/vhost.h > @@ -18,6 +18,8 @@ > typedef void (*vhost_work_fn_t)(struct vhost_work *work); > > #define VHOST_WORK_QUEUED 1 > +#define VHOST_FILE_UNBIND -1 I think it's better to document this in uapi. > + > struct vhost_work { > struct llist_node node; > vhost_work_fn_t fn; > diff --git a/include/uapi/linux/vhos...
2010 Jul 29
1
[PATCH] vhost: locking/rcu cleanup
...ex e05557d..daa95c8 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -60,22 +60,27 @@ static int vhost_poll_wakeup(wait_queue_t *wait, unsigned mode, int sync, return 0; } +/* Must be called for each vq before vhost_dev_init. */ +void vhost_work_set_fn(struct vhost_work *work, vhost_work_fn_t fn) +{ + work->fn = fn; +} + +static void vhost_work_init(struct vhost_work *work) +{ + atomic_set(&work->queue_seq, 0); + work->done_seq = 0; +} + /* Init poll structure */ -void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, +void vhost_poll_init(struct vhost_poll *pol...
2010 Jul 29
1
[PATCH] vhost: locking/rcu cleanup
...ex e05557d..daa95c8 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -60,22 +60,27 @@ static int vhost_poll_wakeup(wait_queue_t *wait, unsigned mode, int sync, return 0; } +/* Must be called for each vq before vhost_dev_init. */ +void vhost_work_set_fn(struct vhost_work *work, vhost_work_fn_t fn) +{ + work->fn = fn; +} + +static void vhost_work_init(struct vhost_work *work) +{ + atomic_set(&work->queue_seq, 0); + work->done_seq = 0; +} + /* Init poll structure */ -void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, +void vhost_poll_init(struct vhost_poll *pol...
2023 Mar 28
1
[PATCH v6 02/11] vhost, vhost-net: add helper to check if vq has work
...rk); void vhost_poll_queue(struct vhost_poll *poll) { diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index e72b665ba3a5..0dde119fb0ee 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -45,7 +45,6 @@ struct vhost_poll { void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn); void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work); -bool vhost_has_work(struct vhost_dev *dev); void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, __poll_t mask, struct vhost_dev *dev); @@ -195,6 +194,7 @@ int vhost_get_vq_desc(struct vhost_virtqu...
2018 Jan 09
0
[PATCH v2] vhost: Remove the unused variable.
...host.c | 1 - drivers/vhost/vhost.h | 4 ---- 2 files changed, 5 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 33ac2b186b85..9b04cad91d65 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -181,7 +181,6 @@ void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) { clear_bit(VHOST_WORK_QUEUED, &work->flags); work->fn = fn; - init_waitqueue_head(&work->done); } EXPORT_SYMBOL_GPL(vhost_work_init); diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 79c6e7a60a5e..749fe13e061c 100644 --- a/drivers/vhost/vhost.h +++ b/d...
2016 Apr 26
0
[PATCH 2/2] vhost: lockless enqueuing
...letions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 73dd16d..0061a7b 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -168,7 +168,7 @@ static int vhost_poll_wakeup(wait_queue_t *wait, unsigned mode, int sync, void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) { - INIT_LIST_HEAD(&work->node); + clear_bit(VHOST_WORK_QUEUED, &work->flags); work->fn = fn; init_waitqueue_head(&work->done); } @@ -246,15 +246,16 @@ EXPORT_SYMBOL_GPL(vhost_poll_flush); void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work) {...
2015 Oct 22
4
[PATCH net-next RFC 1/2] vhost: introduce vhost_has_work()
...oll *poll) { vhost_work_queue(poll->dev, &poll->work); diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 4772862..ea0327d 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -37,6 +37,7 @@ struct vhost_poll { void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn); void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work); +bool vhost_has_work(struct vhost_dev *dev); void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, unsigned long mask, struct vhost_dev *dev); -- 1.8.3.1
2015 Oct 22
4
[PATCH net-next RFC 1/2] vhost: introduce vhost_has_work()
...oll *poll) { vhost_work_queue(poll->dev, &poll->work); diff --git a/drivers/vhost/vhost.h b/drivers/vhost/vhost.h index 4772862..ea0327d 100644 --- a/drivers/vhost/vhost.h +++ b/drivers/vhost/vhost.h @@ -37,6 +37,7 @@ struct vhost_poll { void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn); void vhost_work_queue(struct vhost_dev *dev, struct vhost_work *work); +bool vhost_has_work(struct vhost_dev *dev); void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn, unsigned long mask, struct vhost_dev *dev); -- 1.8.3.1
2016 Apr 26
2
[PATCH 2/2] vhost: lockless enqueuing
...ost/vhost.c b/drivers/vhost/vhost.c > index 73dd16d..0061a7b 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -168,7 +168,7 @@ static int vhost_poll_wakeup(wait_queue_t *wait, unsigned > mode, int sync, > > void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) > { > - INIT_LIST_HEAD(&work->node); > + clear_bit(VHOST_WORK_QUEUED, &work->flags); > work->fn = fn; > init_waitqueue_head(&work->done); > } > @@ -246,15 +246,16 @@ EXPORT_SYMBOL_GPL(vhost_poll_flush); > > void vhost_work_queue(struct...
2016 Apr 26
2
[PATCH 2/2] vhost: lockless enqueuing
...ost/vhost.c b/drivers/vhost/vhost.c > index 73dd16d..0061a7b 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -168,7 +168,7 @@ static int vhost_poll_wakeup(wait_queue_t *wait, unsigned > mode, int sync, > > void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) > { > - INIT_LIST_HEAD(&work->node); > + clear_bit(VHOST_WORK_QUEUED, &work->flags); > work->fn = fn; > init_waitqueue_head(&work->done); > } > @@ -246,15 +246,16 @@ EXPORT_SYMBOL_GPL(vhost_poll_flush); > > void vhost_work_queue(struct...
2014 Aug 10
0
[PATCH] vhost: Add polling mode
...of virtqueue after this many jiffies of no work."); > > enum { > VHOST_MEMORY_MAX_NREGIONS = 64, > @@ -58,27 +66,28 @@ static int vhost_poll_wakeup(wait_queue_t *wait, unsigned mode, int sync, > return 0; > } > > -void vhost_work_init(struct vhost_work *work, vhost_work_fn_t fn) > +void vhost_work_init(struct vhost_work *work, struct vhost_virtqueue *vq, > + vhost_work_fn_t fn) > { > INIT_LIST_HEAD(&work->node); > work->fn = fn; > init_waitqueue_head(&work->done); > work->flushing = 0; > work->queue_seq =...
2012 Dec 27
3
[PATCH 1/2] vhost_net: correct error hanlding in vhost_net_set_backend()
Fix the leaking of oldubufs and fd refcnt when fail to initialized used ring. Signed-off-by: Jason Wang <jasowang at redhat.com> --- drivers/vhost/net.c | 14 +++++++++++--- 1 files changed, 11 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index ebd08b2..629d6b5 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -834,8 +834,10 @@ static