aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4
diff options
context:
space:
mode:
authorTom Herbert <therbert@google.com>2014-08-31 18:12:44 -0400
committerDavid S. Miller <davem@davemloft.net>2014-09-02 00:36:28 -0400
commit884d338c041c2aa4536ade8620efa585e7c57f3c (patch)
tree32c9366b0be384255f9f8a27b1a56d902b0f496e /net/ipv4
parent2abb7cdc0dc84e99b76ef983a1ae1978922aa9b3 (diff)
gre: Add support for checksum unnecessary conversions
Call skb_checksum_try_convert and skb_gro_checksum_try_convert after checksum is found present and validated in the GRE header for normal and GRO paths respectively. In GRO path, call skb_gro_checksum_try_convert Signed-off-by: Tom Herbert <therbert@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4')
-rw-r--r--net/ipv4/gre_demux.c4
-rw-r--r--net/ipv4/gre_offload.c8
2 files changed, 10 insertions, 2 deletions
diff --git a/net/ipv4/gre_demux.c b/net/ipv4/gre_demux.c
index 0485bf7f8f03..7e0756da8737 100644
--- a/net/ipv4/gre_demux.c
+++ b/net/ipv4/gre_demux.c
@@ -125,6 +125,10 @@ static int parse_gre_header(struct sk_buff *skb, struct tnl_ptk_info *tpi,
125 *csum_err = true; 125 *csum_err = true;
126 return -EINVAL; 126 return -EINVAL;
127 } 127 }
128
129 skb_checksum_try_convert(skb, IPPROTO_GRE, 0,
130 null_compute_pseudo);
131
128 options++; 132 options++;
129 } 133 }
130 134
diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
index a4d7965fb880..d3fe2ac05167 100644
--- a/net/ipv4/gre_offload.c
+++ b/net/ipv4/gre_offload.c
@@ -172,10 +172,14 @@ static struct sk_buff **gre_gro_receive(struct sk_buff **head,
172 } 172 }
173 173
174 /* Don't bother verifying checksum if we're going to flush anyway. */ 174 /* Don't bother verifying checksum if we're going to flush anyway. */
175 if ((greh->flags & GRE_CSUM) && !NAPI_GRO_CB(skb)->flush && 175 if ((greh->flags & GRE_CSUM) && !NAPI_GRO_CB(skb)->flush) {
176 skb_gro_checksum_simple_validate(skb)) 176 if (skb_gro_checksum_simple_validate(skb))
177 goto out_unlock; 177 goto out_unlock;
178 178
179 skb_gro_checksum_try_convert(skb, IPPROTO_GRE, 0,
180 null_compute_pseudo);
181 }
182
179 flush = 0; 183 flush = 0;
180 184
181 for (p = *head; p; p = p->next) { 185 for (p = *head; p; p = p->next) {