search for: sk_has_rx_data

Displaying 20 results from an estimated 96 matches for "sk_has_rx_data".

2017 Mar 29
2
[PATCH net-next 8/8] vhost_net: use lockless peeking for skb array during busy polling
...--git a/drivers/vhost/net.c b/drivers/vhost/net.c > index 53f09f2..41153a3 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -551,10 +551,13 @@ static int peek_head_len(struct vhost_net_virtqueue *rvq, struct sock *sk) > return len; > } > > -static int sk_has_rx_data(struct sock *sk) > +static int sk_has_rx_data(struct vhost_net_virtqueue *rvq, struct sock *sk) > { > struct socket *sock = sk->sk_socket; > > + if (rvq->rx_array) > + return !__skb_array_empty(rvq->rx_array); > + > if (sock->ops->peek_len) > ret...
2017 Mar 29
2
[PATCH net-next 8/8] vhost_net: use lockless peeking for skb array during busy polling
...--git a/drivers/vhost/net.c b/drivers/vhost/net.c > index 53f09f2..41153a3 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -551,10 +551,13 @@ static int peek_head_len(struct vhost_net_virtqueue *rvq, struct sock *sk) > return len; > } > > -static int sk_has_rx_data(struct sock *sk) > +static int sk_has_rx_data(struct vhost_net_virtqueue *rvq, struct sock *sk) > { > struct socket *sock = sk->sk_socket; > > + if (rvq->rx_array) > + return !__skb_array_empty(rvq->rx_array); > + > if (sock->ops->peek_len) > ret...
2017 Mar 30
1
[PATCH net-next 8/8] vhost_net: use lockless peeking for skb array during busy polling
...index 53f09f2..41153a3 100644 > > > --- a/drivers/vhost/net.c > > > +++ b/drivers/vhost/net.c > > > @@ -551,10 +551,13 @@ static int peek_head_len(struct vhost_net_virtqueue *rvq, struct sock *sk) > > > return len; > > > } > > > -static int sk_has_rx_data(struct sock *sk) > > > +static int sk_has_rx_data(struct vhost_net_virtqueue *rvq, struct sock *sk) > > > { > > > struct socket *sock = sk->sk_socket; > > > + if (rvq->rx_array) > > > + return !__skb_array_empty(rvq->rx_array); > > &...
2017 Mar 30
1
[PATCH net-next 8/8] vhost_net: use lockless peeking for skb array during busy polling
...index 53f09f2..41153a3 100644 > > > --- a/drivers/vhost/net.c > > > +++ b/drivers/vhost/net.c > > > @@ -551,10 +551,13 @@ static int peek_head_len(struct vhost_net_virtqueue *rvq, struct sock *sk) > > > return len; > > > } > > > -static int sk_has_rx_data(struct sock *sk) > > > +static int sk_has_rx_data(struct vhost_net_virtqueue *rvq, struct sock *sk) > > > { > > > struct socket *sock = sk->sk_socket; > > > + if (rvq->rx_array) > > > + return !__skb_array_empty(rvq->rx_array); > > &...
2018 Jul 03
2
[PATCH net-next v4 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...rs/vhost/net.c b/drivers/vhost/net.c > index 62bb8e8..2790959 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -429,6 +429,52 @@ static int vhost_net_enable_vq(struct vhost_net *n, > return vhost_poll_start(poll, sock->file); > } > > +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(struct vhost_...
2018 Jul 03
2
[PATCH net-next v4 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...rs/vhost/net.c b/drivers/vhost/net.c > index 62bb8e8..2790959 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -429,6 +429,52 @@ static int vhost_net_enable_vq(struct vhost_net *n, > return vhost_poll_start(poll, sock->file); > } > > +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(struct vhost_...
2018 Jul 23
3
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...l_empty(&net->dev, tvq)) { > + vhost_poll_queue(&tvq->poll); > + } else if (unlikely(vhost_enable_notify(&net->dev, tvq))) { > + vhost_disable_notify(&net->dev, tvq); > + vhost_poll_queue(&tvq->poll); > + } > + } else if ((sock && sk_has_rx_data(sock->sk)) && > + !vhost_vq_avail_empty(&net->dev, rvq)) { > + vhost_poll_queue(&rvq->poll); Now we wait for vq_avail for rx as well, I think you cannot skip vhost_enable_notify() on tx. Probably you might want to do: } else if (sock && sk_has_rx_data(...
2018 Jul 23
3
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...l_empty(&net->dev, tvq)) { > + vhost_poll_queue(&tvq->poll); > + } else if (unlikely(vhost_enable_notify(&net->dev, tvq))) { > + vhost_disable_notify(&net->dev, tvq); > + vhost_poll_queue(&tvq->poll); > + } > + } else if ((sock && sk_has_rx_data(sock->sk)) && > + !vhost_vq_avail_empty(&net->dev, rvq)) { > + vhost_poll_queue(&rvq->poll); Now we wait for vq_avail for rx as well, I think you cannot skip vhost_enable_notify() on tx. Probably you might want to do: } else if (sock && sk_has_rx_data(...
2018 Jul 02
1
[PATCH net-next v3 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...rs/vhost/net.c b/drivers/vhost/net.c > index 62bb8e8..458f81d 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -429,6 +429,50 @@ static int vhost_net_enable_vq(struct vhost_net *n, > return vhost_poll_start(poll, sock->file); > } > > +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(struct vhost_...
2018 Jul 03
1
[PATCH net-next v4 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...790959 100644 >>> --- a/drivers/vhost/net.c >>> +++ b/drivers/vhost/net.c >>> @@ -429,6 +429,52 @@ static int vhost_net_enable_vq(struct vhost_net *n, >>> return vhost_poll_start(poll, sock->file); >>> } >>> >>> +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_rec...
2018 Jul 24
3
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...nable_notify(&net->dev, tvq))) { >>>>> + vhost_disable_notify(&net->dev, tvq); >>>>> + vhost_poll_queue(&tvq->poll); >>>>> + } >>>>> + } else if ((sock && sk_has_rx_data(sock->sk)) && >>>>> + !vhost_vq_avail_empty(&net->dev, rvq)) { >>>>> + vhost_poll_queue(&rvq->poll); >>>> >>>> Now we wait for vq_avail for rx as well, I think you cannot skip >>>>...
2018 Jul 24
3
[PATCH net-next v6 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...nable_notify(&net->dev, tvq))) { >>>>> + vhost_disable_notify(&net->dev, tvq); >>>>> + vhost_poll_queue(&tvq->poll); >>>>> + } >>>>> + } else if ((sock && sk_has_rx_data(sock->sk)) && >>>>> + !vhost_vq_avail_empty(&net->dev, rvq)) { >>>>> + vhost_poll_queue(&rvq->poll); >>>> >>>> Now we wait for vq_avail for rx as well, I think you cannot skip >>>>...
2018 Jun 20
1
[PATCH] net: vhost: improve performance when enable busyloop
...nged, 21 insertions(+) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index e7cf7d2..9364ede 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -429,22 +429,43 @@ static int vhost_net_enable_vq(struct vhost_net *n, return vhost_poll_start(poll, sock->file); } +static int sk_has_rx_data(struct sock *sk); + static int vhost_net_tx_get_vq_desc(struct vhost_net *net, struct vhost_virtqueue *vq, struct iovec iov[], unsigned int iov_size, unsigned int *out_num, unsigned int *in_num) { unsigned long uninitialized_var(endtime); + struct vhost_net_virtqueue...
2018 Aug 02
6
[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 no rx data, so we >>>> + * will wait for sock wakeup for rx, and >>>> + * vhos...
2018 Aug 02
6
[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 no rx data, so we >>>> + * will wait for sock wakeup for rx, and >>>> + * vhos...
2018 Aug 01
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t a/drivers/vhost/net.c b/drivers/vhost/net.c > index 32c1b52..5b45463 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -440,6 +440,95 @@ static void vhost_net_signal_used(struct 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(str...
2018 Aug 01
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t a/drivers/vhost/net.c b/drivers/vhost/net.c > index 32c1b52..5b45463 100644 > --- a/drivers/vhost/net.c > +++ b/drivers/vhost/net.c > @@ -440,6 +440,95 @@ static void vhost_net_signal_used(struct 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(str...
2018 Jul 04
2
[PATCH net-next v5 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t; + sock = rvq->private_data; > + busyloop_timeout = rx ? rvq->busyloop_timeout : tvq->busyloop_timeout; > + > + preempt_disable(); > + endtime = busy_clock() + busyloop_timeout; > + while (vhost_can_busy_poll(tvq->dev, endtime) && > + !(sock && sk_has_rx_data(sock->sk)) && > + vhost_vq_avail_empty(tvq->dev, tvq)) > + cpu_relax(); > + preempt_enable(); > + > + if ((rx && !vhost_vq_avail_empty(&net->dev, vq)) || > + (!rx && (sock && sk_has_rx_data(sock->sk)))) { > + vhost_po...
2018 Jul 04
2
[PATCH net-next v5 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t; + sock = rvq->private_data; > + busyloop_timeout = rx ? rvq->busyloop_timeout : tvq->busyloop_timeout; > + > + preempt_disable(); > + endtime = busy_clock() + busyloop_timeout; > + while (vhost_can_busy_poll(tvq->dev, endtime) && > + !(sock && sk_has_rx_data(sock->sk)) && > + vhost_vq_avail_empty(tvq->dev, tvq)) > + cpu_relax(); > + preempt_enable(); > + > + if ((rx && !vhost_vq_avail_empty(&net->dev, vq)) || > + (!rx && (sock && sk_has_rx_data(sock->sk)))) { > + vhost_po...
2018 Jun 30
0
[PATCH net-next v3 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...ons(+), 39 deletions(-) diff --git a/drivers/vhost/net.c b/drivers/vhost/net.c index 62bb8e8..458f81d 100644 --- a/drivers/vhost/net.c +++ b/drivers/vhost/net.c @@ -429,6 +429,50 @@ static int vhost_net_enable_vq(struct vhost_net *n, return vhost_poll_start(poll, sock->file); } +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(struct vhost_net *net, + struct vhost_virtqueue *rvq, + s...