gue: TX support for using remote checksum offload option
authorTom Herbert <therbert@google.com>
Tue, 4 Nov 2014 17:06:56 +0000 (09:06 -0800)
committerDavid S. Miller <davem@davemloft.net>
Wed, 5 Nov 2014 21:30:03 +0000 (16:30 -0500)
Add if_tunnel flag TUNNEL_ENCAP_FLAG_REMCSUM to configure
remote checksum offload on an IP tunnel. Add logic in gue_build_header
to insert remote checksum offload option.

Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/fou.h
include/uapi/linux/if_tunnel.h
net/ipv4/fou.c

index cf4ce88..25b26ff 100644 (file)
@@ -20,7 +20,19 @@ static size_t fou_encap_hlen(struct ip_tunnel_encap *e)
 
 static size_t gue_encap_hlen(struct ip_tunnel_encap *e)
 {
-       return sizeof(struct udphdr) + sizeof(struct guehdr);
+       size_t len;
+       bool need_priv = false;
+
+       len = sizeof(struct udphdr) + sizeof(struct guehdr);
+
+       if (e->flags & TUNNEL_ENCAP_FLAG_REMCSUM) {
+               len += GUE_PLEN_REMCSUM;
+               need_priv = true;
+       }
+
+       len += need_priv ? GUE_LEN_PRIV : 0;
+
+       return len;
 }
 
 #endif
Simple merge
diff --cc net/ipv4/fou.c
Simple merge