search for: vhost_dev

Displaying 20 results from an estimated 977 matches for "vhost_dev".

2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...-}; - -/* Poll a file (eventfd or socket) */ -/* Note: there's nothing vhost specific about this structure. */ -struct vhost_poll { - poll_table table; - wait_queue_head_t *wqh; - wait_queue_t wait; - struct vhost_work work; - unsigned long mask; - struct vhost_dev *dev; -}; - -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, stru...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...-}; - -/* Poll a file (eventfd or socket) */ -/* Note: there's nothing vhost specific about this structure. */ -struct vhost_poll { - poll_table table; - wait_queue_head_t *wqh; - wait_queue_t wait; - struct vhost_work work; - unsigned long mask; - struct vhost_dev *dev; -}; - -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, stru...
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...ush afterwards. */ > > > @@ -111,6 +115,7 @@ void vhost_poll_stop(struct vhost_poll *poll) > > > poll->wqh = NULL; > > > } > > > } > > > +EXPORT_SYMBOL_GPL(vhost_poll_stop); > > > > > > static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, > > > unsigned seq) > > > @@ -123,7 +128,7 @@ static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, > > > return left <= 0; > > > } > > > > > > -static void vhost_work_flush(s...
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...ush afterwards. */ > > > @@ -111,6 +115,7 @@ void vhost_poll_stop(struct vhost_poll *poll) > > > poll->wqh = NULL; > > > } > > > } > > > +EXPORT_SYMBOL_GPL(vhost_poll_stop); > > > > > > static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, > > > unsigned seq) > > > @@ -123,7 +128,7 @@ static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, > > > return left <= 0; > > > } > > > > > > -static void vhost_work_flush(s...
2017 Mar 10
0
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...) */ > -/* Note: there's nothing vhost specific about this structure. */ > -struct vhost_poll { > - poll_table table; > - wait_queue_head_t *wqh; > - wait_queue_t wait; > - struct vhost_work work; > - unsigned long mask; > - struct vhost_dev *dev; > -}; > - > -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 f...
2013 Jul 07
0
[PATCH v2 03/11] vhost: Make vhost a separate module
...gt; @@ -111,6 +115,7 @@ void vhost_poll_stop(struct vhost_poll *poll) > > > > poll->wqh = NULL; > > > > } > > > > } > > > > +EXPORT_SYMBOL_GPL(vhost_poll_stop); > > > > > > > > static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, > > > > unsigned seq) > > > > @@ -123,7 +128,7 @@ static bool vhost_work_seq_done(struct vhost_dev *dev, struct vhost_work *work, > > > > return left <= 0; > > > > } > > > > > > > > -...
2013 May 03
4
[PATCH 0/3] vhost cleanups and separate module
Asias He (3): vhost: Remove vhost_enable_zcopy in vhost.h vhost: Move VHOST_NET_FEATURES to net.c vhost: Make vhost a separate module drivers/vhost/Kconfig | 8 ++++++++ drivers/vhost/Makefile | 3 ++- drivers/vhost/net.c | 6 ++++++ drivers/vhost/scsi.c | 1 - drivers/vhost/vhost.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- drivers/vhost/vhost.h | 8 ++------ 6
2013 May 03
4
[PATCH 0/3] vhost cleanups and separate module
Asias He (3): vhost: Remove vhost_enable_zcopy in vhost.h vhost: Move VHOST_NET_FEATURES to net.c vhost: Make vhost a separate module drivers/vhost/Kconfig | 8 ++++++++ drivers/vhost/Makefile | 3 ++- drivers/vhost/net.c | 6 ++++++ drivers/vhost/scsi.c | 1 - drivers/vhost/vhost.c | 50 +++++++++++++++++++++++++++++++++++++++++++++++++- drivers/vhost/vhost.h | 8 ++------ 6
2017 Dec 24
2
[PATCH] vhost: remove unused lock check flag in vhost_dev_cleanup()
In commit ea5d404655ba ("vhost: fix release path lockdep checks"), Michael added a flag to check whether we should hold a lock in vhost_dev_cleanup(), however, in commit 47283bef7ed3 ("vhost: move memory pointer to VQs"), RCU operations have been replaced by mutex, we can remove the no-longer-used `locked' parameter now. Signed-off-by: Caspar Zhang <jinli.zjl at alibaba-inc.com> --- drivers/vhost/net.c | 2 +- d...
2016 Jan 18
2
[PATCH RFC] vhost: convert pre sorted vhost memory array to interval tree
...rs/vhost/net.c +++ b/drivers/vhost/net.c @@ -968,20 +968,20 @@ static long vhost_net_reset_owner(struct vhost_net *n) struct socket *tx_sock = NULL; struct socket *rx_sock = NULL; long err; - struct vhost_memory *memory; + struct vhost_umem *umem; mutex_lock(&n->dev.mutex); err = vhost_dev_check_owner(&n->dev); if (err) goto done; - memory = vhost_dev_reset_owner_prepare(); - if (!memory) { + umem = vhost_dev_reset_owner_prepare(); + if (!umem) { err = -ENOMEM; goto done; } vhost_net_stop(n, &tx_sock, &rx_sock); vhost_net_flush(n); - vhost_dev_reset_ow...
2016 Jan 18
2
[PATCH RFC] vhost: convert pre sorted vhost memory array to interval tree
...rs/vhost/net.c +++ b/drivers/vhost/net.c @@ -968,20 +968,20 @@ static long vhost_net_reset_owner(struct vhost_net *n) struct socket *tx_sock = NULL; struct socket *rx_sock = NULL; long err; - struct vhost_memory *memory; + struct vhost_umem *umem; mutex_lock(&n->dev.mutex); err = vhost_dev_check_owner(&n->dev); if (err) goto done; - memory = vhost_dev_reset_owner_prepare(); - if (!memory) { + umem = vhost_dev_reset_owner_prepare(); + if (!umem) { err = -ENOMEM; goto done; } vhost_net_stop(n, &tx_sock, &rx_sock); vhost_net_flush(n); - vhost_dev_reset_ow...
2023 Mar 28
1
[PATCH v6 11/11] vhost: allow userspace to create workers
...ost_types.h | 15 +++ 4 files changed, 204 insertions(+), 14 deletions(-) diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c index 1fa5e9a49092..e40699e83c6d 100644 --- a/drivers/vhost/vhost.c +++ b/drivers/vhost/vhost.c @@ -271,7 +271,11 @@ EXPORT_SYMBOL_GPL(vhost_vq_work_queue); void vhost_dev_flush(struct vhost_dev *dev) { - vhost_work_flush_on(dev->worker); + struct vhost_worker *worker; + unsigned long i; + + xa_for_each(&dev->worker_xa, i, worker) + vhost_work_flush_on(worker); } EXPORT_SYMBOL_GPL(vhost_dev_flush); @@ -489,7 +493,6 @@ void vhost_dev_init(struct vhost_...
2018 Sep 09
0
[PATCH net-next v8 5/7] net: vhost: introduce bitmap for vhost_poll
On Tue, Aug 21, 2018 at 8:45 AM Jason Wang <jasowang at redhat.com> wrote: > > > > On 2018?08?19? 20:11, xiangxia.m.yue at gmail.com wrote: > > From: Tonghao Zhang <xiangxia.m.yue at gmail.com> > > > > The bitmap of vhost_dev can help us to check if the > > specified poll is scheduled. This patch will be used > > for next two patches. > > > > Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com> > > --- > > drivers/vhost/net.c | 11 +++++++++-- > > drivers/vhost/...
2016 Jan 20
1
[PATCH V2 2/3] vhost: introduce vhost_vq_more_avail()
...vhost/vhost.h | 1 + > 2 files changed, 14 insertions(+) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 163b365..4f45a03 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -1633,6 +1633,19 @@ void vhost_add_used_and_signal_n(struct vhost_dev *dev, > } > EXPORT_SYMBOL_GPL(vhost_add_used_and_signal_n); > > +bool vhost_vq_more_avail(struct vhost_dev *dev, struct vhost_virtqueue *vq) > +{ > + __virtio16 avail_idx; > + int r; > + > + r = __get_user(avail_idx, &vq->avail->idx); > + if (r) > + r...
2016 Jan 20
1
[PATCH V2 2/3] vhost: introduce vhost_vq_more_avail()
...vhost/vhost.h | 1 + > 2 files changed, 14 insertions(+) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index 163b365..4f45a03 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -1633,6 +1633,19 @@ void vhost_add_used_and_signal_n(struct vhost_dev *dev, > } > EXPORT_SYMBOL_GPL(vhost_add_used_and_signal_n); > > +bool vhost_vq_more_avail(struct vhost_dev *dev, struct vhost_virtqueue *vq) > +{ > + __virtio16 avail_idx; > + int r; > + > + r = __get_user(avail_idx, &vq->avail->idx); > + if (r) > + r...
2018 Jul 22
2
[PATCH net-next v6 1/4] net: vhost: lock the vqs one by one
...-------- > 1 file changed, 7 insertions(+), 17 deletions(-) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index a502f1a..a1c06e7 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -294,8 +294,11 @@ static void vhost_vq_meta_reset(struct vhost_dev *d) > { > int i; > > - for (i = 0; i < d->nvqs; ++i) > + for (i = 0; i < d->nvqs; ++i) { > + mutex_lock(&d->vqs[i]->mutex); > __vhost_vq_meta_reset(d->vqs[i]); > + mutex_unlock(&d->vqs[i]->mutex); > + } > } > > sta...
2018 Jul 22
2
[PATCH net-next v6 1/4] net: vhost: lock the vqs one by one
...-------- > 1 file changed, 7 insertions(+), 17 deletions(-) > > diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c > index a502f1a..a1c06e7 100644 > --- a/drivers/vhost/vhost.c > +++ b/drivers/vhost/vhost.c > @@ -294,8 +294,11 @@ static void vhost_vq_meta_reset(struct vhost_dev *d) > { > int i; > > - for (i = 0; i < d->nvqs; ++i) > + for (i = 0; i < d->nvqs; ++i) { > + mutex_lock(&d->vqs[i]->mutex); > __vhost_vq_meta_reset(d->vqs[i]); > + mutex_unlock(&d->vqs[i]->mutex); > + } > } > > sta...
2016 Jan 19
0
[PATCH RFC] vhost: convert pre sorted vhost memory array to interval tree
...@@ -968,20 +968,20 @@ static long vhost_net_reset_owner(struct vhost_net *n) > struct socket *tx_sock = NULL; > struct socket *rx_sock = NULL; > long err; > - struct vhost_memory *memory; > + struct vhost_umem *umem; > > mutex_lock(&n->dev.mutex); > err = vhost_dev_check_owner(&n->dev); > if (err) > goto done; > - memory = vhost_dev_reset_owner_prepare(); > - if (!memory) { > + umem = vhost_dev_reset_owner_prepare(); > + if (!umem) { > err = -ENOMEM; > goto done; > } > vhost_net_stop(n, &tx_sock, &rx...
2016 Mar 25
0
[RFC PATCH V2 1/2] vhost: convert pre sorted vhost memory array to interval tree
...rs/vhost/net.c +++ b/drivers/vhost/net.c @@ -968,20 +968,20 @@ static long vhost_net_reset_owner(struct vhost_net *n) struct socket *tx_sock = NULL; struct socket *rx_sock = NULL; long err; - struct vhost_memory *memory; + struct vhost_umem *umem; mutex_lock(&n->dev.mutex); err = vhost_dev_check_owner(&n->dev); if (err) goto done; - memory = vhost_dev_reset_owner_prepare(); - if (!memory) { + umem = vhost_dev_reset_owner_prepare(); + if (!umem) { err = -ENOMEM; goto done; } vhost_net_stop(n, &tx_sock, &rx_sock); vhost_net_flush(n); - vhost_dev_reset_ow...
2010 Jul 29
1
[PATCH] vhost: locking/rcu cleanup
...vers/vhost/net.c @@ -111,8 +111,9 @@ static void tx_poll_start(struct vhost_net *net, struct socket *sock) /* Expects to be always run from workqueue - which acts as * read-size critical section for our kind of RCU. */ -static void handle_tx(struct vhost_net *net) +static void handle_tx(struct vhost_dev *dev) { + struct vhost_net *net = container_of(dev, struct vhost_net, dev); struct vhost_virtqueue *vq = &net->dev.vqs[VHOST_NET_VQ_TX]; unsigned out, in, s; int head; @@ -127,7 +128,7 @@ static void handle_tx(struct vhost_net *net) size_t len, total_len = 0; int err, wmem; size...