diff options
author | Jason Wang <jasowang@redhat.com> | 2013-04-10 19:32:22 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2013-04-11 16:21:57 -0400 |
commit | c0317998c340203204ee7622d75a59f41ac13bc6 (patch) | |
tree | 8129faf92a06ed79310c70dbe307c2501f18e980 /drivers/net/tun.c | |
parent | 4fda830263c52a58bcbaedeb091cbcd421cf4858 (diff) |
tuntap: initialize vlan_features
The vlan_features was zero which prevents vlan GSO packets to be transmitted to
userspace. This is suboptimal so enable this by initialize vlan_features for
tuntap.
Netperf shows better performance of guest receiving since vlan TSO works for
tuntap:
before:
netperf -H 192.168.5.4
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.5.4 ()
port 0 AF_INET : demo
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
87380 16384 16384 10.01 2786.67
after:
netperf -H 192.168.5.4
MIGRATED TCP STREAM TEST from 0.0.0.0 (0.0.0.0) port 0 AF_INET to 192.168.5.4 ()
port 0 AF_INET : demo
Recv Send Send
Socket Socket Message Elapsed
Size Size Size Time Throughput
bytes bytes bytes secs. 10^6bits/sec
87380 16384 16384 10.00 8085.49
Signed-off-by: Jason Wang <jasowang@redhat.com>
Acked-by: Michael S. Tsirkin <mst@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r-- | drivers/net/tun.c | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 29538e6e914d..316c759bd988 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c | |||
@@ -1656,6 +1656,7 @@ static int tun_set_iff(struct net *net, struct file *file, struct ifreq *ifr) | |||
1656 | dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | | 1656 | dev->hw_features = NETIF_F_SG | NETIF_F_FRAGLIST | |
1657 | TUN_USER_FEATURES; | 1657 | TUN_USER_FEATURES; |
1658 | dev->features = dev->hw_features; | 1658 | dev->features = dev->hw_features; |
1659 | dev->vlan_features = dev->features; | ||
1659 | 1660 | ||
1660 | INIT_LIST_HEAD(&tun->disabled); | 1661 | INIT_LIST_HEAD(&tun->disabled); |
1661 | err = tun_attach(tun, file); | 1662 | err = tun_attach(tun, file); |