diff options
author | Tom Herbert <therbert@google.com> | 2014-11-04 12:06:56 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-11-05 16:30:03 -0500 |
commit | b17f709a24013fcbb257f6f89b4d81ac9fdf0d18 (patch) | |
tree | 2d279bf83c7bdbe770a90f784b6c3e2b78e7237d /include/net/fou.h | |
parent | c1aa8347e73e4092411fbd96cc59531fb7e76d04 (diff) |
gue: TX support for using remote checksum offload option
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>
Diffstat (limited to 'include/net/fou.h')
-rw-r--r-- | include/net/fou.h | 14 |
1 files changed, 13 insertions, 1 deletions
diff --git a/include/net/fou.h b/include/net/fou.h index cf4ce8874f92..25b26ffcf1df 100644 --- a/include/net/fou.h +++ b/include/net/fou.h | |||
@@ -20,7 +20,19 @@ static size_t fou_encap_hlen(struct ip_tunnel_encap *e) | |||
20 | 20 | ||
21 | static size_t gue_encap_hlen(struct ip_tunnel_encap *e) | 21 | static size_t gue_encap_hlen(struct ip_tunnel_encap *e) |
22 | { | 22 | { |
23 | return sizeof(struct udphdr) + sizeof(struct guehdr); | 23 | size_t len; |
24 | bool need_priv = false; | ||
25 | |||
26 | len = sizeof(struct udphdr) + sizeof(struct guehdr); | ||
27 | |||
28 | if (e->flags & TUNNEL_ENCAP_FLAG_REMCSUM) { | ||
29 | len += GUE_PLEN_REMCSUM; | ||
30 | need_priv = true; | ||
31 | } | ||
32 | |||
33 | len += need_priv ? GUE_LEN_PRIV : 0; | ||
34 | |||
35 | return len; | ||
24 | } | 36 | } |
25 | 37 | ||
26 | #endif | 38 | #endif |