diff options
author | Tom Herbert <therbert@google.com> | 2014-06-04 20:20:23 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2014-06-05 01:46:38 -0400 |
commit | 4749c09c37030ccdc44aecebe0f71b02a377fc14 (patch) | |
tree | d8bef1d48e73e2e5492765ae5348f1f0dffbad1c /net/ipv4/gre_offload.c | |
parent | 0f4f4ffa7b7c3d29d0537a126145c9f8d8ed5dbc (diff) |
gre: Call gso_make_checksum
Call gso_make_checksum. This should have the benefit of using a
checksum that may have been previously computed for the packet.
This also adds NETIF_F_GSO_GRE_CSUM to differentiate devices that
offload GRE GSO with and without the GRE checksum offloaed.
Signed-off-by: Tom Herbert <therbert@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/gre_offload.c')
-rw-r--r-- | net/ipv4/gre_offload.c | 10 |
1 files changed, 8 insertions, 2 deletions
diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c index f1d32280cb54..24deb3928b9e 100644 --- a/net/ipv4/gre_offload.c +++ b/net/ipv4/gre_offload.c | |||
@@ -42,6 +42,7 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, | |||
42 | SKB_GSO_DODGY | | 42 | SKB_GSO_DODGY | |
43 | SKB_GSO_TCP_ECN | | 43 | SKB_GSO_TCP_ECN | |
44 | SKB_GSO_GRE | | 44 | SKB_GSO_GRE | |
45 | SKB_GSO_GRE_CSUM | | ||
45 | SKB_GSO_IPIP))) | 46 | SKB_GSO_IPIP))) |
46 | goto out; | 47 | goto out; |
47 | 48 | ||
@@ -55,6 +56,8 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, | |||
55 | goto out; | 56 | goto out; |
56 | 57 | ||
57 | csum = !!(greh->flags & GRE_CSUM); | 58 | csum = !!(greh->flags & GRE_CSUM); |
59 | if (csum) | ||
60 | skb->encap_hdr_csum = 1; | ||
58 | 61 | ||
59 | if (unlikely(!pskb_may_pull(skb, ghl))) | 62 | if (unlikely(!pskb_may_pull(skb, ghl))) |
60 | goto out; | 63 | goto out; |
@@ -94,10 +97,13 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb, | |||
94 | } | 97 | } |
95 | } | 98 | } |
96 | 99 | ||
97 | greh = (struct gre_base_hdr *)(skb->data); | 100 | skb_reset_transport_header(skb); |
101 | |||
102 | greh = (struct gre_base_hdr *) | ||
103 | skb_transport_header(skb); | ||
98 | pcsum = (__be32 *)(greh + 1); | 104 | pcsum = (__be32 *)(greh + 1); |
99 | *pcsum = 0; | 105 | *pcsum = 0; |
100 | *(__sum16 *)pcsum = csum_fold(skb_checksum(skb, 0, skb->len, 0)); | 106 | *(__sum16 *)pcsum = gso_make_checksum(skb, 0); |
101 | } | 107 | } |
102 | __skb_push(skb, tnl_hlen - ghl); | 108 | __skb_push(skb, tnl_hlen - ghl); |
103 | 109 | ||