search for: vhost_net_disable_vq

Displaying 20 results from an estimated 126 matches for "vhost_net_disable_vq".

2018 Jul 24
3
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...} >> >> When vhost_enable_notify() returns true the avail becomes non-empty >> while we are enabling notify. We may delay the rx process if we don't >> check the return value of vhost_enable_notify(). > I got it thanks. >>>> Also it's better to care vhost_net_disable_vq()/vhost_net_enable_vq() on tx? >>> I cant find why it is better, if necessary, we can do it. >> >> The reason is pretty simple... we are busypolling the socket so we don't >> need rx wakeups during it? > OK, but one question, how about rx? do we use the > vhost_...
2018 Jul 24
3
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...} >> >> When vhost_enable_notify() returns true the avail becomes non-empty >> while we are enabling notify. We may delay the rx process if we don't >> check the return value of vhost_enable_notify(). > I got it thanks. >>>> Also it's better to care vhost_net_disable_vq()/vhost_net_enable_vq() on tx? >>> I cant find why it is better, if necessary, we can do it. >> >> The reason is pretty simple... we are busypolling the socket so we don't >> need rx wakeups during it? > OK, but one question, how about rx? do we use the > vhost_...
2016 May 30
4
[PATCH V2 0/2] vhost_net polling optimization
...timize 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. - Add a new patch for conditionally enable tx polling. Jason Wang (2): vhost_net: stop polling socket during rx processing vhost_net: conditionally enable tx polling drivers/vhost/net.c | 59 +++++++++++++++++++++++++++++----------------------...
2016 May 30
4
[PATCH V2 0/2] vhost_net polling optimization
...timize 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. - Add a new patch for conditionally enable tx polling. Jason Wang (2): vhost_net: stop polling socket during rx processing vhost_net: conditionally enable tx polling drivers/vhost/net.c | 59 +++++++++++++++++++++++++++++----------------------...
2016 Jun 01
7
[PATCH V3 0/2] vhost_net polling optimization
...necessary 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 V2: - Don't enable rx vq if we meet an err or rx vq is empty Changes from V1: - use vhost_net_disable_vq()/vhost_net_enable_vq() instead of open coding. - Add a new patch for conditionally enable tx polling. Jason Wang (2): vhost_net: stop polling socket during rx processing vhost_net: conditionally enable tx polling drivers/vhost/net.c | 67 ++++++++++++++++++++++++++++-----------------------...
2016 Jun 01
7
[PATCH V3 0/2] vhost_net polling optimization
...necessary 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 V2: - Don't enable rx vq if we meet an err or rx vq is empty Changes from V1: - use vhost_net_disable_vq()/vhost_net_enable_vq() instead of open coding. - Add a new patch for conditionally enable tx polling. Jason Wang (2): vhost_net: stop polling socket during rx processing vhost_net: conditionally enable tx polling drivers/vhost/net.c | 67 ++++++++++++++++++++++++++++-----------------------...
2016 May 30
1
[PATCH V2 1/2] vhost_net: stop polling socket during rx processing
...ff --git a/drivers/vhost/net.c b/drivers/vhost/net.c > index 10ff494..e91603b 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -301,6 +301,32 @@ static bool vhost_can_busy_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_...
2016 May 30
1
[PATCH V2 1/2] vhost_net: stop polling socket during rx processing
...ff --git a/drivers/vhost/net.c b/drivers/vhost/net.c > index 10ff494..e91603b 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -301,6 +301,32 @@ static bool vhost_can_busy_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_...
2018 Jul 23
3
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...ta(sock->sk)) { if (!vhost_vq_avail_empty(&net->dev, rvq)) { vhost_poll_queue(&rvq->poll); } else if (unlikely(vhost_enable_notify(&net->dev, rvq))) { vhost_disable_notify(&net->dev, rvq); vhost_poll_queue(&rvq->poll); } } Also it's better to care vhost_net_disable_vq()/vhost_net_enable_vq() on tx? -- Toshiaki Makita
2018 Jul 23
3
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...ta(sock->sk)) { if (!vhost_vq_avail_empty(&net->dev, rvq)) { vhost_poll_queue(&rvq->poll); } else if (unlikely(vhost_enable_notify(&net->dev, rvq))) { vhost_disable_notify(&net->dev, rvq); vhost_poll_queue(&rvq->poll); } } Also it's better to care vhost_net_disable_vq()/vhost_net_enable_vq() on tx? -- Toshiaki Makita
2016 May 30
0
[PATCH V2 1/2] vhost_net: stop polling socket during rx processing
...d, 29 insertions(+), 27 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 10ff494..e91603b 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -301,6 +301,32 @@ static bool vhost_can_busy_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_e...
2018 Jul 24
0
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t; When vhost_enable_notify() returns true the avail becomes non-empty > >> while we are enabling notify. We may delay the rx process if we don't > >> check the return value of vhost_enable_notify(). > > I got it thanks. > >>>> Also it's better to care vhost_net_disable_vq()/vhost_net_enable_vq() on tx? > >>> I cant find why it is better, if necessary, we can do it. > >> > >> The reason is pretty simple... we are busypolling the socket so we don't > >> need rx wakeups during it? > > OK, but one question, how about rx?...
2016 Jun 01
0
[PATCH V3 1/2] vhost_net: stop polling socket during rx processing
...d, 33 insertions(+), 31 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index f744eeb..1d3e45f 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -301,6 +301,32 @@ static bool vhost_can_busy_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_e...
2017 Oct 31
2
[PATCH net-next] vhost_net: conditionally enable tx polling
..., 8 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 68677d9..286c3e4 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -471,6 +471,7 @@ static void handle_tx(struct vhost_net *net) goto out; vhost_disable_notify(&net->dev, vq); + vhost_net_disable_vq(net, vq); hdr_size = nvq->vhost_hlen; zcopy = nvq->ubufs; @@ -556,6 +557,8 @@ static void handle_tx(struct vhost_net *net) % UIO_MAXIOV; } vhost_discard_vq_desc(vq, 1); + if (err == -EAGAIN) + vhost_net_enable_vq(net, vq); break; } if (err != len) @@ -1145,9...
2017 Oct 31
2
[PATCH net-next] vhost_net: conditionally enable tx polling
..., 8 insertions(+), 3 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 68677d9..286c3e4 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -471,6 +471,7 @@ static void handle_tx(struct vhost_net *net) goto out; vhost_disable_notify(&net->dev, vq); + vhost_net_disable_vq(net, vq); hdr_size = nvq->vhost_hlen; zcopy = nvq->ubufs; @@ -556,6 +557,8 @@ static void handle_tx(struct vhost_net *net) % UIO_MAXIOV; } vhost_discard_vq_desc(vq, 1); + if (err == -EAGAIN) + vhost_net_enable_vq(net, vq); break; } if (err != len) @@ -1145,9...
2018 Mar 09
0
[PATCH net 2/3] vhost_net: keep private_data and rx_ring synced
...drivers/vhost/net.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 60f1080..efb9306 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -973,6 +973,7 @@ static struct socket *vhost_net_stop_vq(struct vhost_net *n, vhost_net_disable_vq(n, vq); vq->private_data = NULL; vhost_net_buf_unproduce(nvq); + nvq->rx_ring = NULL; mutex_unlock(&vq->mutex); return sock; } @@ -1162,14 +1163,14 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd) vhost_net_disable_vq(n, vq); vq->priva...
2018 Jul 23
0
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
..., rvq); > > } > > When vhost_enable_notify() returns true the avail becomes non-empty > while we are enabling notify. We may delay the rx process if we don't > check the return value of vhost_enable_notify(). I got it thanks. > >> Also it's better to care vhost_net_disable_vq()/vhost_net_enable_vq() on tx? > > I cant find why it is better, if necessary, we can do it. > > The reason is pretty simple... we are busypolling the socket so we don't > need rx wakeups during it? OK, but one question, how about rx? do we use the vhost_net_disable_vq/vhost_net_...
2018 Mar 09
7
[PATCH net 0/3] Several fixes for vhost_net ptr_ring usage
Hi: This small series try to fix several bugs of ptr_ring usage in vhost_net. Please review. Thanks Alexander Potapenko (1): vhost_net: initialize rx_ring in vhost_net_open() Jason Wang (2): vhost_net: keep private_data and rx_ring synced vhost_net: examine pointer types during un-producing drivers/net/tun.c | 3 ++- drivers/vhost/net.c | 8 +++++--- include/linux/if_tun.h | 4
2016 Jun 07
1
[PATCH V3 2/2] vhost_net: conditionally enable tx polling
...--git a/drivers/vhost/net.c b/drivers/vhost/net.c > index 1d3e45f..e75ffcc 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -378,6 +378,7 @@ static void handle_tx(struct vhost_net *net) > goto out; > > vhost_disable_notify(&net->dev, vq); > + vhost_net_disable_vq(net, vq); > > hdr_size = nvq->vhost_hlen; > zcopy = nvq->ubufs; > @@ -459,6 +460,8 @@ static void handle_tx(struct vhost_net *net) > % UIO_MAXIOV; > } > vhost_discard_vq_desc(vq, 1); > + if (err == -EAGAIN) > + vhost_net_enable_vq(net, vq);...
2016 Jun 07
1
[PATCH V3 2/2] vhost_net: conditionally enable tx polling
...--git a/drivers/vhost/net.c b/drivers/vhost/net.c > index 1d3e45f..e75ffcc 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -378,6 +378,7 @@ static void handle_tx(struct vhost_net *net) > goto out; > > vhost_disable_notify(&net->dev, vq); > + vhost_net_disable_vq(net, vq); > > hdr_size = nvq->vhost_hlen; > zcopy = nvq->ubufs; > @@ -459,6 +460,8 @@ static void handle_tx(struct vhost_net *net) > % UIO_MAXIOV; > } > vhost_discard_vq_desc(vq, 1); > + if (err == -EAGAIN) > + vhost_net_enable_vq(net, vq);...