search for: peek_len

Displaying 20 results from an estimated 46 matches for "peek_len".

2016 Jun 15
7
[PATCH net-next V2] tun: introduce tx skb ring
...equires spinlocks to synchronize between producer and consumer. This patch tries to address this by: - introduce a new mode which will be only enabled with IFF_TX_ARRAY set and switch from sk_receive_queue to a fixed size of skb array with 256 entries in this mode. - introduce a new proto_ops peek_len which was used for peeking the skb length. - implement a tun version of peek_len for vhost_net to use and convert vhost_net to use peek_len if possible. Pktgen test shows about 18% improvement on guest receiving pps for small buffers: Before: ~1220000pps After : ~1440000pps The reason why I...
2016 Jun 15
7
[PATCH net-next V2] tun: introduce tx skb ring
...equires spinlocks to synchronize between producer and consumer. This patch tries to address this by: - introduce a new mode which will be only enabled with IFF_TX_ARRAY set and switch from sk_receive_queue to a fixed size of skb array with 256 entries in this mode. - introduce a new proto_ops peek_len which was used for peeking the skb length. - implement a tun version of peek_len for vhost_net to use and convert vhost_net to use peek_len if possible. Pktgen test shows about 18% improvement on guest receiving pps for small buffers: Before: ~1220000pps After : ~1440000pps The reason why I...
2018 Jul 03
2
[PATCH net-next v4 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...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_net *net, > + struct vhost_virtqueue *rvq, > + struct vhost_virtqueue *tvq, > + bool rx) > +{ &...
2018 Jul 03
2
[PATCH net-next v4 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...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_net *net, > + struct vhost_virtqueue *rvq, > + struct vhost_virtqueue *tvq, > + bool rx) > +{ &...
2016 Jun 30
0
[PATCH net-next V3 6/6] tun: switch to use skb array for tx
...to queue tx packets in sk_receive_queue, this is less efficient since it requires spinlocks to synchronize between producer and consumer. This patch tries to address this by: - switch from sk_receive_queue to a skb_array, and resize it when tx_queue_len was changed. - introduce a new proto_ops peek_len which was used for peeking the skb length. - implement a tun version of peek_len for vhost_net to use and convert vhost_net to use peek_len if possible. Pktgen test shows about 15.3% improvement on guest receiving pps for small buffers: Before: ~1300000pps After : ~1500000pps Signed-off-by:...
2016 Jun 17
0
[PATCH net-next V2] tun: introduce tx skb ring
...producer > and consumer. > > This patch tries to address this by: > > - introduce a new mode which will be only enabled with IFF_TX_ARRAY > set and switch from sk_receive_queue to a fixed size of skb > array with 256 entries in this mode. > - introduce a new proto_ops peek_len which was used for peeking the > skb length. > - implement a tun version of peek_len for vhost_net to use and convert > vhost_net to use peek_len if possible. > > Pktgen test shows about 18% improvement on guest receiving pps for small > buffers: > > Before: ~1220000pp...
2017 Mar 29
2
[PATCH net-next 8/8] vhost_net: use lockless peeking for skb array during busy polling
...ic 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) > return sock->ops->peek_len(sock); > I don't see which patch adds __skb_array_empty. > @@ -579,7 +582,7 @@ static int vhost_net_rx_peek_head_len(struct vhost_net *net, > endtime = busy_clock() + vq->busyloop_timeout; > > while (vhost_can_busy_poll(&am...
2017 Mar 29
2
[PATCH net-next 8/8] vhost_net: use lockless peeking for skb array during busy polling
...ic 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) > return sock->ops->peek_len(sock); > I don't see which patch adds __skb_array_empty. > @@ -579,7 +582,7 @@ static int vhost_net_rx_peek_head_len(struct vhost_net *net, > endtime = busy_clock() + vq->busyloop_timeout; > > while (vhost_can_busy_poll(&am...
2018 Jul 02
1
[PATCH net-next v3 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...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, > + struct vhost_virtqueue *tvq, > + bool rx) > +{ &...
2018 Jul 03
1
[PATCH net-next v4 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...t 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, >>> +...
2018 Aug 01
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
.../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(struct vhost_net *net, > + struct vhost_virtqueue *vq) > +{ > + if (!vhost_vq_avail_empty(&net->d...
2018 Aug 01
2
[PATCH net-next v7 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
.../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(struct vhost_net *net, > + struct vhost_virtqueue *vq) > +{ > + if (!vhost_vq_avail_empty(&net->d...
2017 Mar 30
1
[PATCH net-next 8/8] vhost_net: use lockless peeking for skb array during busy polling
...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) > > > return sock->ops->peek_len(sock); > > I don't see which patch adds __skb_array_empty. > > This is not something new, it was introduced by ad69f35d1dc0a ("skb_array: > array based FIFO for skbs"). > > Thanks Same comment about a compile...
2017 Mar 30
1
[PATCH net-next 8/8] vhost_net: use lockless peeking for skb array during busy polling
...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) > > > return sock->ops->peek_len(sock); > > I don't see which patch adds __skb_array_empty. > > This is not something new, it was introduced by ad69f35d1dc0a ("skb_array: > array based FIFO for skbs"). > > Thanks Same comment about a compile...
2016 Jun 30
9
[PATCH net-next V3 0/6] switch to use tx skb array in tun
...ps Changes from V2: - add multiple rings resizing support for ptr_ring/skb_array - add zero length ring support - introdce a NETDEV_CHANGE_TX_QUEUE_LEN - drop new flags Changes from V1: - switch to use skb array instead of a customized circular buffer - add non-blocking support - rename .peek to .peek_len - drop lockless peeking since test show very minor improvement Jason Wang (5): ptr_ring: support zero length ring skb_array: minor tweak skb_array: add wrappers for resizing net: introduce NETDEV_CHANGE_TX_QUEUE_LEN tun: switch to use skb array for tx Michael S. Tsirkin (1): ptr_ring:...
2016 Jun 30
9
[PATCH net-next V3 0/6] switch to use tx skb array in tun
...ps Changes from V2: - add multiple rings resizing support for ptr_ring/skb_array - add zero length ring support - introdce a NETDEV_CHANGE_TX_QUEUE_LEN - drop new flags Changes from V1: - switch to use skb array instead of a customized circular buffer - add non-blocking support - rename .peek to .peek_len - drop lockless peeking since test show very minor improvement Jason Wang (5): ptr_ring: support zero length ring skb_array: minor tweak skb_array: add wrappers for resizing net: introduce NETDEV_CHANGE_TX_QUEUE_LEN tun: switch to use skb array for tx Michael S. Tsirkin (1): ptr_ring:...
2018 Jun 30
0
[PATCH net-next v3 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...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, + struct vhost_virtqueue *tvq, + bool rx) +{ + unsigned long uninitialized_var(endtime); + struc...
2018 Jul 02
0
[PATCH net-next v4 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...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_net *net, + struct vhost_virtqueue *rvq, + struct vhost_virtqueue *tvq, + bool rx) +{ + unsigned long uninitialized_var(endtime); + unsig...
2018 Jul 04
0
[PATCH net-next v5 3/4] net: vhost: factor out busy polling logic to vhost_net_busy_poll()
...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_net *net, + struct vhost_virtqueue *rvq, + struct vhost_virtqueue *tvq, + bool rx) +{ + unsigned long uninitialized_var(endtime); + unsig...
2018 Jul 02
5
[PATCH net-next v4 0/4] net: vhost: improve performance when enable busyloop
From: Tonghao Zhang <xiangxia.m.yue at gmail.com> This patches improve the guest receive and transmit performance. On the handle_tx side, we poll the sock receive queue at the same time. handle_rx do that in the same way. For more performance report, see patch 4. v3 -> v4: fix some issues v2 -> v3: This patches are splited from previous big patch: