diff options
author | Jason Wang <jasowang@redhat.com> | 2016-06-30 02:45:36 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2016-07-01 05:32:17 -0400 |
commit | 1576d98605998fb59d121a39581129e134217182 (patch) | |
tree | 20949c1b4243a0e746570b3f08483b40c183ae57 /include/linux/net.h | |
parent | 08294a26e15d7baf1e14ee569e9f2bc82a7ae768 (diff) |
tun: switch to use skb array for tx
We used 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: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include/linux/net.h')
-rw-r--r-- | include/linux/net.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/net.h b/include/linux/net.h index 25aa03b51c4e..b9f0ff4d489c 100644 --- a/include/linux/net.h +++ b/include/linux/net.h | |||
@@ -185,6 +185,7 @@ struct proto_ops { | |||
185 | ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, | 185 | ssize_t (*splice_read)(struct socket *sock, loff_t *ppos, |
186 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); | 186 | struct pipe_inode_info *pipe, size_t len, unsigned int flags); |
187 | int (*set_peek_off)(struct sock *sk, int val); | 187 | int (*set_peek_off)(struct sock *sk, int val); |
188 | int (*peek_len)(struct socket *sock); | ||
188 | }; | 189 | }; |
189 | 190 | ||
190 | #define DECLARE_SOCKADDR(type, dst, src) \ | 191 | #define DECLARE_SOCKADDR(type, dst, src) \ |