summaryrefslogtreecommitdiffstats
path: root/drivers/net/tun.c
diff options
context:
space:
mode:
authorAndrew Melnychenko <andrew@daynix.com>2022-12-07 13:35:55 +0200
committerDavid S. Miller <davem@davemloft.net>2022-12-12 09:29:56 +0000
commit399e0827642f6a8bcae24277fe08e80e7e4bb891 (patch)
tree83b02eafcc846244c1dafcc4af1d5a6a1b4f0111 /drivers/net/tun.c
parentb22bbdd17a5af2cc99cf42048970b9355dcbec8b (diff)
downloadlinux-399e0827642f6a8bcae24277fe08e80e7e4bb891.tar.gz
linux-399e0827642f6a8bcae24277fe08e80e7e4bb891.tar.bz2
linux-399e0827642f6a8bcae24277fe08e80e7e4bb891.zip
driver/net/tun: Added features for USO.
Added support for USO4 and USO6. For now, to "enable" USO, it's required to set both USO4 and USO6 simultaneously. USO enables NETIF_F_GSO_UDP_L4. Signed-off-by: Andrew Melnychenko <andrew@daynix.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'drivers/net/tun.c')
-rw-r--r--drivers/net/tun.c8
1 files changed, 7 insertions, 1 deletions
diff --git a/drivers/net/tun.c b/drivers/net/tun.c
index b4baa2001a63..a7d17c680f4a 100644
--- a/drivers/net/tun.c
+++ b/drivers/net/tun.c
@@ -185,7 +185,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_GSO_UDP_L4)
int align;
int vnet_hdr_sz;
@@ -2878,6 +2878,12 @@ static int set_offload(struct tun_struct *tun, unsigned long arg)
}
arg &= ~TUN_F_UFO;
+
+ /* TODO: for now USO4 and USO6 should work simultaneously */
+ if (arg & TUN_F_USO4 && arg & TUN_F_USO6) {
+ features |= NETIF_F_GSO_UDP_L4;
+ arg &= ~(TUN_F_USO4 | TUN_F_USO6);
+ }
}
/* This gives the user a way to test for new features in future by