Displaying 20 results from an estimated 150 matches for "vhost_poll".
2018 Sep 09
0
[PATCH net-next v8 5/7] net: vhost: introduce bitmap for vhost_poll
...dex 1eff72d..23d7ffc 100644
> > --- a/drivers/vhost/net.c
> > +++ b/drivers/vhost/net.c
> > @@ -1135,8 +1135,15 @@ static int vhost_net_open(struct inode *inode, struct file *f)
> > }
> > vhost_dev_init(dev, vqs, VHOST_NET_VQ_MAX);
> >
> > - vhost_poll_init(n->poll + VHOST_NET_VQ_TX, handle_tx_net, EPOLLOUT, dev);
> > - vhost_poll_init(n->poll + VHOST_NET_VQ_RX, handle_rx_net, EPOLLIN, dev);
> > + vhost_poll_init(n->poll + VHOST_NET_VQ_TX,
> > + handle_tx_net,
> > +...
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
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
2013 Jan 06
2
[PATCH V3 0/2] handle polling errors
This is an update version of last version to fix the handling of polling errors
in vhost/vhost_net.
Currently, vhost and vhost_net ignore polling errors which can lead kernel
crashing when it tries to remove itself from waitqueue after the polling
failure. Fix this by checking the poll->wqh before the removing and report an
error when meet polling errors.
Changes from v2:
- check poll->wqh
2013 Jan 06
2
[PATCH V3 0/2] handle polling errors
This is an update version of last version to fix the handling of polling errors
in vhost/vhost_net.
Currently, vhost and vhost_net ignore polling errors which can lead kernel
crashing when it tries to remove itself from waitqueue after the polling
failure. Fix this by checking the poll->wqh before the removing and report an
error when meet polling errors.
Changes from v2:
- check poll->wqh
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...nit(struct vhost_work *work, vhost_work_fn_t fn)
> > > work->flushing = 0;
> > > work->queue_seq = work->done_seq = 0;
> > > }
> > > +EXPORT_SYMBOL_GPL(vhost_work_init);
> > >
> > > /* Init poll structure */
> > > void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn,
> > > @@ -79,6 +81,7 @@ void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn,
> > >
> > > vhost_work_init(&poll->work, fn);
> > > }
> > > +EXPORT_SYMBOL_GPL(vhost_poll_init);
>...
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...nit(struct vhost_work *work, vhost_work_fn_t fn)
> > > work->flushing = 0;
> > > work->queue_seq = work->done_seq = 0;
> > > }
> > > +EXPORT_SYMBOL_GPL(vhost_work_init);
> > >
> > > /* Init poll structure */
> > > void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn,
> > > @@ -79,6 +81,7 @@ void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn,
> > >
> > > vhost_work_init(&poll->work, fn);
> > > }
> > > +EXPORT_SYMBOL_GPL(vhost_poll_init);
>...
2012 Mar 18
3
vhost question
...s process context) when there
are frames to deliver.
How can I get my host-side tx kick handler to wake the host-side rx kick
handler to deliver frames to the guest?
Steve
--
static void
handle_rx(struct vhost_work *work)
{
int n;
unsigned out, in;
struct transmission *t;
u16 frames = 0;
struct vhost_poll *p = container_of(work, struct vhost_poll, work);
struct vhost_virtqueue *vq = container_of(p, struct vhost_virtqueue, poll);
struct vhost_node *node = container_of(vq, struct vhost_node,
vqs[WLAN_VQ_RX]);
struct vhost_dev *dev = &node->vdev;
mutex_lock(&vq->mutex);
vhost_disable_not...
2012 Mar 18
3
vhost question
...s process context) when there
are frames to deliver.
How can I get my host-side tx kick handler to wake the host-side rx kick
handler to deliver frames to the guest?
Steve
--
static void
handle_rx(struct vhost_work *work)
{
int n;
unsigned out, in;
struct transmission *t;
u16 frames = 0;
struct vhost_poll *p = container_of(work, struct vhost_poll, work);
struct vhost_virtqueue *vq = container_of(p, struct vhost_virtqueue, poll);
struct vhost_node *node = container_of(vq, struct vhost_node,
vqs[WLAN_VQ_RX]);
struct vhost_dev *dev = &node->vdev;
mutex_lock(&vq->mutex);
vhost_disable_not...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...- 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) */
-/* 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 *d...
2017 Mar 07
2
[PATCH] vhost: Move vhost.h to allow vhost driver out-of-tree compilation
...- 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) */
-/* 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 *d...
2013 Mar 07
3
[PATCH] vhost_net: remove tx polling state
...ers/vhost/net.c
@@ -64,20 +64,10 @@ enum {
VHOST_NET_VQ_MAX = 2,
};
-enum vhost_net_poll_state {
- VHOST_NET_POLL_DISABLED = 0,
- VHOST_NET_POLL_STARTED = 1,
- VHOST_NET_POLL_STOPPED = 2,
-};
-
struct vhost_net {
struct vhost_dev dev;
struct vhost_virtqueue vqs[VHOST_NET_VQ_MAX];
struct vhost_poll poll[VHOST_NET_VQ_MAX];
- /* Tells us whether we are polling a socket for TX.
- * We only do this when socket buffer fills up.
- * Protected by tx vq lock. */
- enum vhost_net_poll_state tx_poll_state;
/* Number of TX recently submitted.
* Protected by tx vq lock. */
unsigned tx_packets;
@...
2013 Mar 07
3
[PATCH] vhost_net: remove tx polling state
...ers/vhost/net.c
@@ -64,20 +64,10 @@ enum {
VHOST_NET_VQ_MAX = 2,
};
-enum vhost_net_poll_state {
- VHOST_NET_POLL_DISABLED = 0,
- VHOST_NET_POLL_STARTED = 1,
- VHOST_NET_POLL_STOPPED = 2,
-};
-
struct vhost_net {
struct vhost_dev dev;
struct vhost_virtqueue vqs[VHOST_NET_VQ_MAX];
struct vhost_poll poll[VHOST_NET_VQ_MAX];
- /* Tells us whether we are polling a socket for TX.
- * We only do this when socket buffer fills up.
- * Protected by tx vq lock. */
- enum vhost_net_poll_state tx_poll_state;
/* Number of TX recently submitted.
* Protected by tx vq lock. */
unsigned tx_packets;
@...
2010 Sep 05
0
[PATCH] vhost: fix attach to cgroups regression
.../vhost/vhost.c | 79 +++++++++++++++++++++++++++++++++++-------------
1 files changed, 57 insertions(+), 22 deletions(-)
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 4b99117..7c75dce 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -60,22 +60,25 @@ static int vhost_poll_wakeup(wait_queue_t *wait, unsigned mode, int sync,
return 0;
}
+static 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...
2010 Sep 05
0
[PATCH] vhost: fix attach to cgroups regression
.../vhost/vhost.c | 79 +++++++++++++++++++++++++++++++++++-------------
1 files changed, 57 insertions(+), 22 deletions(-)
diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
index 4b99117..7c75dce 100644
--- a/drivers/vhost/vhost.c
+++ b/drivers/vhost/vhost.c
@@ -60,22 +60,25 @@ static int vhost_poll_wakeup(wait_queue_t *wait, unsigned mode, int sync,
return 0;
}
+static 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...
2020 Sep 22
0
[PATCH 7/8] vhost: remove work arg from vhost_work_flush
...or all reqs issued before the flush to be finished */
> for (i = 0; i < VHOST_SCSI_MAX_VQ; i++)
> diff --git a/drivers/vhost/vhost.c b/drivers/vhost/vhost.c
> index 5dd9eb1..f83674e 100644
> --- a/drivers/vhost/vhost.c
> +++ b/drivers/vhost/vhost.c
> @@ -231,7 +231,7 @@ void vhost_poll_stop(struct vhost_poll *poll)
> }
> EXPORT_SYMBOL_GPL(vhost_poll_stop);
>
> -void vhost_work_flush(struct vhost_dev *dev, struct vhost_work *work)
> +void vhost_work_dev_flush(struct vhost_dev *dev)
> {
> struct vhost_flush_struct flush;
>
> @@ -243,13 +243...
2013 Jul 07
0
[PATCH v2 03/11] vhost: Make vhost a separate module
...work_fn_t fn)
> > > > work->flushing = 0;
> > > > work->queue_seq = work->done_seq = 0;
> > > > }
> > > > +EXPORT_SYMBOL_GPL(vhost_work_init);
> > > >
> > > > /* Init poll structure */
> > > > void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn,
> > > > @@ -79,6 +81,7 @@ void vhost_poll_init(struct vhost_poll *poll, vhost_work_fn_t fn,
> > > >
> > > > vhost_work_init(&poll->work, fn);
> > > > }
> > > > +EXPORT_SYMBOL_GP...
2016 May 30
1
[PATCH V2 1/2] vhost_net: stop polling socket during rx processing
..._poll(struct vhost_dev *dev,
> !vhost_has_work(dev);
> }
>
> +static void vhost_net_disable_vq(struct vhost_net *n,
> + struct vhost_virtqueue *vq)
> +{
> + struct vhost_net_virtqueue *nvq =
> + container_of(vq, struct vhost_net_virtqueue, vq);
> + struct vhost_poll *poll = n->poll + (nvq - n->vqs);
> + if (!vq->private_data)
> + return;
> + vhost_poll_stop(poll);
> +}
> +
> +static int vhost_net_enable_vq(struct vhost_net *n,
> + struct vhost_virtqueue *vq)
> +{
> + struct vhost_net_virtqueue *nvq =
> + container_of...
2016 May 30
1
[PATCH V2 1/2] vhost_net: stop polling socket during rx processing
..._poll(struct vhost_dev *dev,
> !vhost_has_work(dev);
> }
>
> +static void vhost_net_disable_vq(struct vhost_net *n,
> + struct vhost_virtqueue *vq)
> +{
> + struct vhost_net_virtqueue *nvq =
> + container_of(vq, struct vhost_net_virtqueue, vq);
> + struct vhost_poll *poll = n->poll + (nvq - n->vqs);
> + if (!vq->private_data)
> + return;
> + vhost_poll_stop(poll);
> +}
> +
> +static int vhost_net_enable_vq(struct vhost_net *n,
> + struct vhost_virtqueue *vq)
> +{
> + struct vhost_net_virtqueue *nvq =
> + container_of...
2020 May 28
0
[PATCH] vdpa: bypass waking up vhost_woker for vdpa vq kick
...968361..d3a2aca 100644
> --- a/drivers/vhost/vdpa.c
> +++ b/drivers/vhost/vdpa.c
> @@ -287,6 +287,66 @@ static long vhost_vdpa_get_vring_num(struct vhost_vdpa *v, u16 __user *argp)
>
> return 0;
> }
> +void vhost_vdpa_poll_stop(struct vhost_virtqueue *vq)
> +{
> + vhost_poll_stop(&vq->poll);
> +}
> +
> +int vhost_vdpa_poll_start(struct vhost_virtqueue *vq)
> +{
> + struct vhost_poll *poll = &vq->poll;
> + struct file *file = vq->kick;
> + __poll_t mask;
> +
> +
> + if (poll->wqh)
> + return 0;
> +
> + mask = v...