diff options
author | Vlad Yasevich <vyasevich@gmail.com> | 2015-02-03 16:36:17 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2015-02-03 23:06:43 -0800 |
commit | e3e3c423f82a415195a7bbbfa619bfa7b20d2db6 (patch) | |
tree | 5a26c4c9f88e8c070dfcc42385f98240925ec848 /drivers/net/tun.c | |
parent | 72f6510745592c87f612f62ae4f16bb002934df4 (diff) | |
download | blackbird-op-linux-e3e3c423f82a415195a7bbbfa619bfa7b20d2db6.tar.gz blackbird-op-linux-e3e3c423f82a415195a7bbbfa619bfa7b20d2db6.zip |
Revert "drivers/net: Disable UFO through virtio"
This reverts commit 3d0ad09412ffe00c9afa201d01effdb6023d09b4.
Now that GSO functionality can correctly track if the fragment
id has been selected and select a fragment id if necessary,
we can re-enable UFO on tap/macvap and virtio devices.
Signed-off-by: Vladislav Yasevich <vyasevic@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 | 19 |
1 files changed, 8 insertions, 11 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c index 5ca42b79b16f..10f9e4021b5a 100644 --- a/drivers/net/tun.c +++ b/drivers/net/tun.c @@ -186,7 +186,7 @@ struct tun_struct { struct net_device *dev; netdev_features_t set_features; #define TUN_USER_FEATURES (NETIF_F_HW_CSUM|NETIF_F_TSO_ECN|NETIF_F_TSO| \ - NETIF_F_TSO6) + NETIF_F_TSO6|NETIF_F_UFO) int vnet_hdr_sz; int sndbuf; @@ -1176,18 +1176,8 @@ static ssize_t tun_get_user(struct tun_struct *tun, struct tun_file *tfile, skb_shinfo(skb)->gso_type = SKB_GSO_TCPV6; break; case VIRTIO_NET_HDR_GSO_UDP: - { - static bool warned; - - if (!warned) { - warned = true; - netdev_warn(tun->dev, - "%s: using disabled UFO feature; please fix this program\n", - current->comm); - } skb_shinfo(skb)->gso_type = SKB_GSO_UDP; break; - } default: tun->dev->stats.rx_frame_errors++; kfree_skb(skb); @@ -1294,6 +1284,8 @@ static ssize_t tun_put_user(struct tun_struct *tun, gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV4; else if (sinfo->gso_type & SKB_GSO_TCPV6) gso.gso_type = VIRTIO_NET_HDR_GSO_TCPV6; + else if (sinfo->gso_type & SKB_GSO_UDP) + gso.gso_type = VIRTIO_NET_HDR_GSO_UDP; else { pr_err("unexpected GSO type: " "0x%x, gso_size %d, hdr_len %d\n", @@ -1742,6 +1734,11 @@ static int set_offload(struct tun_struct *tun, unsigned long arg) features |= NETIF_F_TSO6; arg &= ~(TUN_F_TSO4|TUN_F_TSO6); } + + if (arg & TUN_F_UFO) { + features |= NETIF_F_UFO; + arg &= ~TUN_F_UFO; + } } /* This gives the user a way to test for new features in future by |