diff options
author | Jason Wang <jasowang@redhat.com> | 2017-08-11 19:41:16 +0800 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2017-08-13 19:56:07 -0700 |
commit | 66ccbc9c87c2ae96585f9aa5f733609e6f4acf25 (patch) | |
tree | f4b65889e63df18f839a8dac57eca5769c141b1c /net/core | |
parent | d0225784be6c9bdfb05149ebc30bf9fc1fdbce3a (diff) | |
download | linux-66ccbc9c87c2ae96585f9aa5f733609e6f4acf25.tar.bz2 |
tap: use build_skb() for small packet
We use tun_alloc_skb() which calls sock_alloc_send_pskb() to allocate
skb in the past. This socket based method is not suitable for high
speed userspace like virtualization which usually:
- ignore sk_sndbuf (INT_MAX) and expect to receive the packet as fast as
possible
- don't want to be block at sendmsg()
To eliminate the above overheads, this patch tries to use build_skb()
for small packet. We will do this only when the following conditions
are all met:
- TAP instead of TUN
- sk_sndbuf is INT_MAX
- caller don't want to be blocked
- zerocopy is not used
- packet size is smaller enough to use build_skb()
Pktgen from guest to host shows ~11% improvement for rx pps of tap:
Before: ~1.70Mpps
After : ~1.88Mpps
What's more important, this makes it possible to implement XDP for tap
before creating skbs.
Signed-off-by: Jason Wang <jasowang@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/core')
0 files changed, 0 insertions, 0 deletions