search for: vhost_poll_stop

Displaying 20 results from an estimated 107 matches for "vhost_poll_stop".

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
2018 Mar 27
4
[PATCH net V2] vhost: correctly remove wait queue during poll failure
We tried to remove vq poll from wait queue, but do not check whether or not it was in a list before. This will lead double free. Fixing this by switching to use vhost_poll_stop() which zeros poll->wqh after removing poll from waitqueue to make sure it won't be freed twice. Cc: Darren Kenny <darren.kenny at oracle.com> Reported-by: syzbot+c0272972b01b872e604a at syzkaller.appspotmail.com Fixes: 2b8b328b61c79 ("vhost_net: handle polling errors when settin...
2018 Mar 27
4
[PATCH net V2] vhost: correctly remove wait queue during poll failure
We tried to remove vq poll from wait queue, but do not check whether or not it was in a list before. This will lead double free. Fixing this by switching to use vhost_poll_stop() which zeros poll->wqh after removing poll from waitqueue to make sure it won't be freed twice. Cc: Darren Kenny <darren.kenny at oracle.com> Reported-by: syzbot+c0272972b01b872e604a at syzkaller.appspotmail.com Fixes: 2b8b328b61c79 ("vhost_net: handle polling errors when settin...
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 Mar 07
3
[PATCH] vhost_net: remove tx polling state
...vq lock. */ unsigned tx_packets; @@ -155,28 +145,6 @@ static void copy_iovec_hdr(const struct iovec *from, struct iovec *to, } } -/* Caller must have TX VQ lock */ -static void tx_poll_stop(struct vhost_net *net) -{ - if (likely(net->tx_poll_state != VHOST_NET_POLL_STARTED)) - return; - vhost_poll_stop(net->poll + VHOST_NET_VQ_TX); - net->tx_poll_state = VHOST_NET_POLL_STOPPED; -} - -/* Caller must have TX VQ lock */ -static int tx_poll_start(struct vhost_net *net, struct socket *sock) -{ - int ret; - - if (unlikely(net->tx_poll_state != VHOST_NET_POLL_STOPPED)) - return 0; - ret = vhos...
2013 Mar 07
3
[PATCH] vhost_net: remove tx polling state
...vq lock. */ unsigned tx_packets; @@ -155,28 +145,6 @@ static void copy_iovec_hdr(const struct iovec *from, struct iovec *to, } } -/* Caller must have TX VQ lock */ -static void tx_poll_stop(struct vhost_net *net) -{ - if (likely(net->tx_poll_state != VHOST_NET_POLL_STARTED)) - return; - vhost_poll_stop(net->poll + VHOST_NET_VQ_TX); - net->tx_poll_state = VHOST_NET_POLL_STOPPED; -} - -/* Caller must have TX VQ lock */ -static int tx_poll_start(struct vhost_net *net, struct socket *sock) -{ - int ret; - - if (unlikely(net->tx_poll_state != VHOST_NET_POLL_STOPPED)) - return 0; - ret = vhos...
2018 Mar 27
1
[PATCH net] vhost: correctly remove wait queue during poll failure
...h to make sure it was in a list. > > This text seems at odds with the code below, instead of checking > poll-whq, you are removing that check... > > Maybe the text needs rewording? Yes, I admit it's bad, thanks for pointing out. How about: "Fixing this by switching to use vhost_poll_stop() which zeros poll->wqh after removing poll from waitqueue to make sure it won't be freed twice." Thanks > > Thanks, > > Darren. > >> >> Reported-by: syzbot+c0272972b01b872e604a at syzkaller.appspotmail.com >> Fixes: 2b8b328b61c79 ("vhost_net: ha...
2013 Apr 11
1
[PATCH] vhost_net: remove tx polling state
...vq lock. */ unsigned tx_packets; @@ -155,28 +145,6 @@ static void copy_iovec_hdr(const struct iovec *from, struct iovec *to, } } -/* Caller must have TX VQ lock */ -static void tx_poll_stop(struct vhost_net *net) -{ - if (likely(net->tx_poll_state != VHOST_NET_POLL_STARTED)) - return; - vhost_poll_stop(net->poll + VHOST_NET_VQ_TX); - net->tx_poll_state = VHOST_NET_POLL_STOPPED; -} - -/* Caller must have TX VQ lock */ -static int tx_poll_start(struct vhost_net *net, struct socket *sock) -{ - int ret; - - if (unlikely(net->tx_poll_state != VHOST_NET_POLL_STOPPED)) - return 0; - ret = vhos...
2013 Apr 11
1
[PATCH] vhost_net: remove tx polling state
...vq lock. */ unsigned tx_packets; @@ -155,28 +145,6 @@ static void copy_iovec_hdr(const struct iovec *from, struct iovec *to, } } -/* Caller must have TX VQ lock */ -static void tx_poll_stop(struct vhost_net *net) -{ - if (likely(net->tx_poll_state != VHOST_NET_POLL_STARTED)) - return; - vhost_poll_stop(net->poll + VHOST_NET_VQ_TX); - net->tx_poll_state = VHOST_NET_POLL_STOPPED; -} - -/* Caller must have TX VQ lock */ -static int tx_poll_start(struct vhost_net *net, struct socket *sock) -{ - int ret; - - if (unlikely(net->tx_poll_state != VHOST_NET_POLL_STOPPED)) - return 0; - ret = vhos...
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,13 @...
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...; > > vhost_work_init(&poll->work, fn); > > > } > > > +EXPORT_SYMBOL_GPL(vhost_poll_init); > > > > > > /* Start polling a file. We add ourselves to file's wait queue. The caller must > > > * keep a reference to a file until after vhost_poll_stop is called. */ > > > @@ -101,6 +104,7 @@ int vhost_poll_start(struct vhost_poll *poll, struct file *file) > > > > > > return ret; > > > } > > > +EXPORT_SYMBOL_GPL(vhost_poll_start); > > > > > > /* Stop polling a file. After this...
2013 Jul 07
2
[PATCH v2 03/11] vhost: Make vhost a separate module
...; > > vhost_work_init(&poll->work, fn); > > > } > > > +EXPORT_SYMBOL_GPL(vhost_poll_init); > > > > > > /* Start polling a file. We add ourselves to file's wait queue. The caller must > > > * keep a reference to a file until after vhost_poll_stop is called. */ > > > @@ -101,6 +104,7 @@ int vhost_poll_start(struct vhost_poll *poll, struct file *file) > > > > > > return ret; > > > } > > > +EXPORT_SYMBOL_GPL(vhost_poll_start); > > > > > > /* Stop polling a file. After this...
2016 May 30
1
[PATCH V2 1/2] vhost_net: stop polling socket during rx processing
..._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(vq, struct vhost_net_virtqueue, vq); > + struct vhost_poll *poll = n->poll + (nvq - n->vqs); > + st...
2016 May 30
1
[PATCH V2 1/2] vhost_net: stop polling socket during rx processing
..._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(vq, struct vhost_net_virtqueue, vq); > + struct vhost_poll *poll = n->poll + (nvq - n->vqs); > + st...
2016 May 30
4
[PATCH V2 0/2] vhost_net polling optimization
Hi: This series tries to optimize vhost_net polling at two points: - Stop rx polling for reduicng the unnecessary wakeups during handle_rx(). - Conditonally enable tx polling for reducing the unnecessary traversing and spinlock touching. Test shows about 17% improvement on rx pps. Please review Changes from V1: - use vhost_net_disable_vq()/vhost_net_enable_vq() instead of open coding. -
2016 May 30
4
[PATCH V2 0/2] vhost_net polling optimization
Hi: This series tries to optimize vhost_net polling at two points: - Stop rx polling for reduicng the unnecessary wakeups during handle_rx(). - Conditonally enable tx polling for reducing the unnecessary traversing and spinlock touching. Test shows about 17% improvement on rx pps. Please review Changes from V1: - use vhost_net_disable_vq()/vhost_net_enable_vq() instead of open coding. -
2013 Jul 07
0
[PATCH v2 03/11] vhost: Make vhost a separate module
...init(&poll->work, fn); > > > > } > > > > +EXPORT_SYMBOL_GPL(vhost_poll_init); > > > > > > > > /* Start polling a file. We add ourselves to file's wait queue. The caller must > > > > * keep a reference to a file until after vhost_poll_stop is called. */ > > > > @@ -101,6 +104,7 @@ int vhost_poll_start(struct vhost_poll *poll, struct file *file) > > > > > > > > return ret; > > > > } > > > > +EXPORT_SYMBOL_GPL(vhost_poll_start); > > > > > > > >...
2014 Aug 15
2
[PATCH net-next] vhost_net: stop rx net polling when possible
...ck, *rxsock; struct vhost_net_ubuf_ref *uninitialized_var(ubufs); - bool zcopy, zcopy_used; + bool zcopy, zcopy_used, poll = false; mutex_lock(&vq->mutex); + mutex_lock(&rx_vq->mutex); sock = vq->private_data; + rxsock = rx_vq->private_data; if (!sock) goto out; + vhost_poll_stop(rx_poll); vhost_disable_notify(&net->dev, vq); hdr_size = nvq->vhost_hlen; @@ -451,11 +456,17 @@ static void handle_tx(struct vhost_net *net) total_len += len; vhost_net_tx_packet(net); if (unlikely(total_len >= VHOST_NET_WEIGHT)) { - vhost_poll_queue(&vq->poll)...