Displaying 20 results from an estimated 208 matches for "vhost_net_enable_vq".
2018 Aug 03
1
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t_busy_poll_check() we
>>> need to enable vq since in that case we have no rx data and handle_rx()
>>> is not scheduled.
>>>
> Rethink about this, looks not. We enable rx wakeups in this case, so if
> there's pending data, handle_rx() will be schedule after
> vhost_net_enable_vq().
You are right, but what I wanted to say is vhost_net_enable_vq() should
be needed (I was talking about what would happen if
vhost_net_enable_vq() were removed). Also, I think we should move
vhost_net_enable_vq() from vhost_net_busy_poll() to this last "else"
block because this is the...
2017 Oct 31
2
[PATCH net-next] vhost_net: conditionally enable tx polling
...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 +1148,11 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
r = vhost_vq_init_access(vq);
if (r)
goto err_used;
- r = vhost_net_enable_vq(n, vq);
- if (r)
- goto err_used;
+ if (index == VHOST_NET_...
2017 Oct 31
2
[PATCH net-next] vhost_net: conditionally enable tx polling
...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 +1148,11 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
r = vhost_vq_init_access(vq);
if (r)
goto err_used;
- r = vhost_net_enable_vq(n, vq);
- if (r)
- goto err_used;
+ if (index == VHOST_NET_...
2017 Nov 01
2
[PATCH net-next] vhost_net: conditionally enable tx polling
...gt;>
>> 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)
> I would probably just enable it unconditionally here. Why not?
>
I thought we only care about the case of tun_sock_write_space() and for
the errors other than -EAGAIN, they have nothing to do with polling.
>>...
2017 Nov 01
2
[PATCH net-next] vhost_net: conditionally enable tx polling
...gt;>
>> 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)
> I would probably just enable it unconditionally here. Why not?
>
I thought we only care about the case of tun_sock_write_space() and for
the errors other than -EAGAIN, they have nothing to do with polling.
>>...
2016 May 30
4
[PATCH V2 0/2] vhost_net polling optimization
...g 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 +++++++++++++++++++++++++++++------------------------
1 file changed, 32...
2016 May 30
4
[PATCH V2 0/2] vhost_net polling optimization
...g 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 +++++++++++++++++++++++++++++------------------------
1 file changed, 32...
2016 Jun 01
7
[PATCH V3 0/2] vhost_net polling optimization
...g
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 ++++++++++++++++++++++++++++-------------------------
1 file changed, 36...
2016 Jun 01
7
[PATCH V3 0/2] vhost_net polling optimization
...g
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 ++++++++++++++++++++++++++++-------------------------
1 file changed, 36...
2018 Aug 02
6
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...vhost_enble_notify() is false.
>
>>>>> +
>>>>> +???????????? cpu_relax();
>>>>> +???? }
>>>>> +
>>>>> +???? preempt_enable();
>>>>> +
>>>>> +???? if (!rx)
>>>>> +???????????? vhost_net_enable_vq(net, vq);
>>>> No need to enable rx virtqueue, if we are sure handle_rx() will be
>>>> called soon.
>>> If we disable rx virtqueue in handle_tx and don't send packets from
>>> guest anymore(handle_tx is not called), so we can wake up for sock rx.
>&g...
2018 Aug 02
6
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...vhost_enble_notify() is false.
>
>>>>> +
>>>>> +???????????? cpu_relax();
>>>>> +???? }
>>>>> +
>>>>> +???? preempt_enable();
>>>>> +
>>>>> +???? if (!rx)
>>>>> +???????????? vhost_net_enable_vq(net, vq);
>>>> No need to enable rx virtqueue, if we are sure handle_rx() will be
>>>> called soon.
>>> If we disable rx virtqueue in handle_tx and don't send packets from
>>> guest anymore(handle_tx is not called), so we can wake up for sock rx.
>&g...
2018 Aug 03
3
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t; +
>>>>>>> + cpu_relax();
>>>>>>> + }
>>>>>>> +
>>>>>>> + preempt_enable();
>>>>>>> +
>>>>>>> + if (!rx)
>>>>>>> + vhost_net_enable_vq(net, vq);
>>>>>> No need to enable rx virtqueue, if we are sure handle_rx() will be
>>>>>> called soon.
>>>>> If we disable rx virtqueue in handle_tx and don't send packets from
>>>>> guest anymore(handle_tx is not called), so we...
2018 Aug 03
3
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t; +
>>>>>>> + cpu_relax();
>>>>>>> + }
>>>>>>> +
>>>>>>> + preempt_enable();
>>>>>>> +
>>>>>>> + if (!rx)
>>>>>>> + vhost_net_enable_vq(net, vq);
>>>>>> No need to enable rx virtqueue, if we are sure handle_rx() will be
>>>>>> called soon.
>>>>> If we disable rx virtqueue in handle_tx and don't send packets from
>>>>> guest anymore(handle_tx is not called), so we...
2016 May 30
1
[PATCH V2 1/2] vhost_net: stop polling socket during rx processing
...t_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);
> + struct socket *sock;
> +
> + sock = vq->private_data...
2016 May 30
1
[PATCH V2 1/2] vhost_net: stop polling socket during rx processing
...t_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);
> + struct socket *sock;
> +
> + sock = vq->private_data...
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
2012 Dec 27
3
[PATCH 1/2] vhost_net: correct error hanlding in vhost_net_set_backend()
...++++---
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 long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
vhost_net_enable_vq(n, vq);
r = vhost_init_used(vq);
- if (r)
- goto err_vq;
+ if (r) {
+ sock = NULL;
+ goto err_used;
+ }
n->tx_packets = 0;
n->tx_zcopy_err = 0;
@@ -859,8 +861,14 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
mutex_unlock(&n->d...
2012 Dec 27
3
[PATCH 1/2] vhost_net: correct error hanlding in vhost_net_set_backend()
...++++---
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 long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
vhost_net_enable_vq(n, vq);
r = vhost_init_used(vq);
- if (r)
- goto err_vq;
+ if (r) {
+ sock = NULL;
+ goto err_used;
+ }
n->tx_packets = 0;
n->tx_zcopy_err = 0;
@@ -859,8 +861,14 @@ static long vhost_net_set_backend(struct vhost_net *n, unsigned index, int fd)
mutex_unlock(&n->d...
2018 Aug 03
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...cpu_relax();
>>>>>>>>> + }
>>>>>>>>> +
>>>>>>>>> + preempt_enable();
>>>>>>>>> +
>>>>>>>>> + if (!rx)
>>>>>>>>> + vhost_net_enable_vq(net, vq);
>>>>>>>> No need to enable rx virtqueue, if we are sure handle_rx() will be
>>>>>>>> called soon.
>>>>>>> If we disable rx virtqueue in handle_tx and don't send packets from
>>>>>>> guest anymore...