search for: vhost_net_busy_poll_try_queu

Displaying 20 results from an estimated 37 matches for "vhost_net_busy_poll_try_queu".

2018 Aug 03
3
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...vhost_virtqueue *tvq, >>>>>> + bool rx) >>>>>> +{ >>>>>> + struct socket *sock = rvq->private_data; >>>>>> + >>>>>> + if (rx) >>>>>> + vhost_net_busy_poll_try_queue(net, tvq); >>>>>> + else if (sock && sk_has_rx_data(sock->sk)) >>>>>> + vhost_net_busy_poll_try_queue(net, rvq); >>>>>> + else { >>>>>> + /* On tx here, sock has no rx data, so we &gt...
2018 Aug 03
3
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...vhost_virtqueue *tvq, >>>>>> + bool rx) >>>>>> +{ >>>>>> + struct socket *sock = rvq->private_data; >>>>>> + >>>>>> + if (rx) >>>>>> + vhost_net_busy_poll_try_queue(net, tvq); >>>>>> + else if (sock && sk_has_rx_data(sock->sk)) >>>>>> + vhost_net_busy_poll_try_queue(net, rvq); >>>>>> + else { >>>>>> + /* On tx here, sock has no rx data, so we &gt...
2018 Aug 02
6
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...> + struct vhost_virtqueue *tvq, >>>> + bool rx) >>>> +{ >>>> + struct socket *sock = rvq->private_data; >>>> + >>>> + if (rx) >>>> + vhost_net_busy_poll_try_queue(net, tvq); >>>> + else if (sock && sk_has_rx_data(sock->sk)) >>>> + vhost_net_busy_poll_try_queue(net, rvq); >>>> + else { >>>> + /* On tx here, sock has no rx data, so we >>>> + * w...
2018 Aug 02
6
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...> + struct vhost_virtqueue *tvq, >>>> + bool rx) >>>> +{ >>>> + struct socket *sock = rvq->private_data; >>>> + >>>> + if (rx) >>>> + vhost_net_busy_poll_try_queue(net, tvq); >>>> + else if (sock && sk_has_rx_data(sock->sk)) >>>> + vhost_net_busy_poll_try_queue(net, rvq); >>>> + else { >>>> + /* On tx here, sock has no rx data, so we >>>> + * w...
2018 Aug 03
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t;> + bool rx) >>>>>>>> +{ >>>>>>>> + struct socket *sock = rvq->private_data; >>>>>>>> + >>>>>>>> + if (rx) >>>>>>>> + vhost_net_busy_poll_try_queue(net, tvq); >>>>>>>> + else if (sock && sk_has_rx_data(sock->sk)) >>>>>>>> + vhost_net_busy_poll_try_queue(net, rvq); >>>>>>>> + else { >>>>>>>> + /* On tx here...
2018 Aug 03
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t;> + bool rx) >>>>>>>> +{ >>>>>>>> + struct socket *sock = rvq->private_data; >>>>>>>> + >>>>>>>> + if (rx) >>>>>>>> + vhost_net_busy_poll_try_queue(net, tvq); >>>>>>>> + else if (sock && sk_has_rx_data(sock->sk)) >>>>>>>> + vhost_net_busy_poll_try_queue(net, rvq); >>>>>>>> + else { >>>>>>>> + /* On tx here...
2018 Sep 09
0
[PATCH net-next v8 3/7] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...and will be > > used for in tx path in the next patch. And with the patch, > > qemu can set differently the busyloop_timeout for rx queue. > > > > To avoid duplicate codes, introduce the helper functions: > > * sock_has_rx_data(changed from sk_has_rx_data) > > * vhost_net_busy_poll_try_queue > > > > Signed-off-by: Tonghao Zhang <xiangxia.m.yue at gmail.com> > > --- > > drivers/vhost/net.c | 111 +++++++++++++++++++++++++++++++++------------------- > > 1 file changed, 71 insertions(+), 40 deletions(-) > > > > diff --git a/drivers/vhost...
2018 Aug 03
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t;> + bool rx) >>>>>>>> +{ >>>>>>>> + struct socket *sock = rvq->private_data; >>>>>>>> + >>>>>>>> + if (rx) >>>>>>>> + vhost_net_busy_poll_try_queue(net, tvq); >>>>>>>> + else if (sock && sk_has_rx_data(sock->sk)) >>>>>>>> + vhost_net_busy_poll_try_queue(net, rvq); >>>>>>>> + else { >>>>>>>> + /* On tx here...
2018 Aug 03
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t;> + bool rx) >>>>>>>> +{ >>>>>>>> + struct socket *sock = rvq->private_data; >>>>>>>> + >>>>>>>> + if (rx) >>>>>>>> + vhost_net_busy_poll_try_queue(net, tvq); >>>>>>>> + else if (sock && sk_has_rx_data(sock->sk)) >>>>>>>> + vhost_net_busy_poll_try_queue(net, rvq); >>>>>>>> + else { >>>>>>>> + /* On tx here...
2018 Aug 02
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
On 2018?08?01? 17:52, Tonghao Zhang wrote: >>> + >>> + 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
2018 Aug 02
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
On 2018?08?01? 17:52, Tonghao Zhang wrote: >>> + >>> + 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
2018 Aug 01
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...> +static int sk_has_rx_data(struct sock *sk) > +{ > + struct socket *sock = sk->sk_socket; > + > + if (sock->ops->peek_len) > + return sock->ops->peek_len(sock); > + > + return skb_queue_empty(&sk->sk_receive_queue); > +} > + > +static void vhost_net_busy_poll_try_queue(struct vhost_net *net, > + struct vhost_virtqueue *vq) > +{ > + if (!vhost_vq_avail_empty(&net->dev, vq)) { > + vhost_poll_queue(&vq->poll); > + } else if (unlikely(vhost_enable_notify(&net->dev, vq))) { > + vhost_disable_notify(&net->dev, vq);...
2018 Aug 01
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...> +static int sk_has_rx_data(struct sock *sk) > +{ > + struct socket *sock = sk->sk_socket; > + > + if (sock->ops->peek_len) > + return sock->ops->peek_len(sock); > + > + return skb_queue_empty(&sk->sk_receive_queue); > +} > + > +static void vhost_net_busy_poll_try_queue(struct vhost_net *net, > + struct vhost_virtqueue *vq) > +{ > + if (!vhost_vq_avail_empty(&net->dev, vq)) { > + vhost_poll_queue(&vq->poll); > + } else if (unlikely(vhost_enable_notify(&net->dev, vq))) { > + vhost_disable_notify(&net->dev, vq);...
2018 Aug 03
0
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...;>>>>> + bool rx) > >>>>>> +{ > >>>>>> + struct socket *sock = rvq->private_data; > >>>>>> + > >>>>>> + if (rx) > >>>>>> + vhost_net_busy_poll_try_queue(net, tvq); > >>>>>> + else if (sock && sk_has_rx_data(sock->sk)) > >>>>>> + vhost_net_busy_poll_try_queue(net, rvq); > >>>>>> + else { > >>>>>> + /* On tx here, sock has n...
2018 Aug 01
5
[PATCH net-next v7 0/4] net: vhost: improve performance when enable busyloop
...the same time. handle_rx do that in the same way. For more performance report, see patch 4. v6->v7: fix issue and rebase codes: 1. on tx, busypoll will vhost_net_disable/enable_vq rx vq. [This is suggested by Toshiaki Makita <makita.toshiaki at lab.ntt.co.jp>] 2. introduce common helper vhost_net_busy_poll_try_queue(). v5->v6: rebase the codes. Tonghao Zhang (4): net: vhost: lock the vqs one by one net: vhost: replace magic number of lock annotation net: vhost: factor out busy polling logic to vhost_net_busy_poll() net: vhost: add rx busy polling in tx path drivers/vhost/net.c | 168 +++++++++...
2018 Aug 03
0
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...bool rx) > >>>>>>>> +{ > >>>>>>>> + struct socket *sock = rvq->private_data; > >>>>>>>> + > >>>>>>>> + if (rx) > >>>>>>>> + vhost_net_busy_poll_try_queue(net, tvq); > >>>>>>>> + else if (sock && sk_has_rx_data(sock->sk)) > >>>>>>>> + vhost_net_busy_poll_try_queue(net, rvq); > >>>>>>>> + else { > >>>>>>>> +...
2018 Aug 03
0
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...bool rx) > >>>>>>>> +{ > >>>>>>>> + struct socket *sock = rvq->private_data; > >>>>>>>> + > >>>>>>>> + if (rx) > >>>>>>>> + vhost_net_busy_poll_try_queue(net, tvq); > >>>>>>>> + else if (sock && sk_has_rx_data(sock->sk)) > >>>>>>>> + vhost_net_busy_poll_try_queue(net, rvq); > >>>>>>>> + else { > >>>>>>>> +...
2018 Aug 03
1
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...bool rx) >>>>>>>>>> +{ >>>>>>>>>> + struct socket *sock = rvq->private_data; >>>>>>>>>> + >>>>>>>>>> + if (rx) >>>>>>>>>> + vhost_net_busy_poll_try_queue(net, tvq); >>>>>>>>>> + else if (sock && sk_has_rx_data(sock->sk)) >>>>>>>>>> + vhost_net_busy_poll_try_queue(net, rvq); >>>>>>>>>> + else { >>>>>>>>>...
2018 Aug 01
0
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t vhost_net_virtqueue *nvq) nvq->done_idx = 0; } +static int sk_has_rx_data(struct sock *sk) +{ + struct socket *sock = sk->sk_socket; + + if (sock->ops->peek_len) + return sock->ops->peek_len(sock); + + return skb_queue_empty(&sk->sk_receive_queue); +} + +static void vhost_net_busy_poll_try_queue(struct vhost_net *net, + struct vhost_virtqueue *vq) +{ + if (!vhost_vq_avail_empty(&net->dev, vq)) { + vhost_poll_queue(&vq->poll); + } else if (unlikely(vhost_enable_notify(&net->dev, vq))) { + vhost_disable_notify(&net->dev, vq); + vhost_poll_queue(&vq-&...
2018 Aug 01
0
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...+ struct socket *sock = sk->sk_socket; > > + > > + if (sock->ops->peek_len) > > + return sock->ops->peek_len(sock); > > + > > + return skb_queue_empty(&sk->sk_receive_queue); > > +} > > + > > +static void vhost_net_busy_poll_try_queue(struct vhost_net *net, > > + struct vhost_virtqueue *vq) > > +{ > > + if (!vhost_vq_avail_empty(&net->dev, vq)) { > > + vhost_poll_queue(&vq->poll); > > + } else if (unlikely(vhost_enable_notify(&...