* Re: [PATCH net] ipv6: gro: fix CHECKSUM_COMPLETE support
[not found] <1400548164.5367.80.camel@edumazet-glaptop2.roam.corp.google.com>
@ 2014-05-20 4:41 ` Eric Dumazet
2014-05-20 4:56 ` [PATCH net v2] " Eric Dumazet
1 sibling, 0 replies; 3+ messages in thread
From: Eric Dumazet @ 2014-05-20 4:41 UTC (permalink / raw)
To: David Miller; +Cc: Jerry Chu, netdev, Eric Dumazet
On Mon, 2014-05-19 at 18:09 -0700, Eric Dumazet wrote:
> @@ -264,13 +263,10 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head,
>
> NAPI_GRO_CB(skb)->flush |= flush;
>
> - csum = skb->csum;
> - skb_postpull_rcsum(skb, iph, skb_network_header_len(skb));
> + skb_gro_postpull_rcsum(skb, iph, sizeof(*iph));
>
sizeof(*iph) doesn't support extension headers. nlen is more appropriate
I'll send a V2
^ permalink raw reply [flat|nested] 3+ messages in thread
* [PATCH net v2] ipv6: gro: fix CHECKSUM_COMPLETE support
[not found] <1400548164.5367.80.camel@edumazet-glaptop2.roam.corp.google.com>
2014-05-20 4:41 ` [PATCH net] ipv6: gro: fix CHECKSUM_COMPLETE support Eric Dumazet
@ 2014-05-20 4:56 ` Eric Dumazet
2014-05-21 21:20 ` David Miller
1 sibling, 1 reply; 3+ messages in thread
From: Eric Dumazet @ 2014-05-20 4:56 UTC (permalink / raw)
To: David Miller; +Cc: Jerry Chu, netdev, Eric Dumazet
From: Eric Dumazet <edumazet@google.com>
When GRE support was added in linux-3.14, CHECKSUM_COMPLETE handling
broke on GRE+IPv6 because we did not update/use the appropriate csum :
GRO layer is supposed to use/update NAPI_GRO_CB(skb)->csum instead of
skb->csum
Tested using a GRE tunnel and IPv6 traffic. GRO aggregation now happens
at the first level (ethernet device) instead of being done in gre
tunnel. Native IPv6+TCP is still properly aggregated.
Fixes: bf5a755f5e918 ("net-gre-gro: Add GRE support to the GRO stack")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Cc: Jerry Chu <hkchu@google.com>
---
v2: use nlen instead of sizeof(*iph) to support extension headers
net/ipv6/ip6_offload.c | 6 +-----
net/ipv6/tcpv6_offload.c | 2 +-
2 files changed, 2 insertions(+), 6 deletions(-)
diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c
index 59f95affceb0..b2f091566f88 100644
--- a/net/ipv6/ip6_offload.c
+++ b/net/ipv6/ip6_offload.c
@@ -196,7 +196,6 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head,
unsigned int off;
u16 flush = 1;
int proto;
- __wsum csum;
off = skb_gro_offset(skb);
hlen = off + sizeof(*iph);
@@ -264,13 +263,10 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head,
NAPI_GRO_CB(skb)->flush |= flush;
- csum = skb->csum;
- skb_postpull_rcsum(skb, iph, skb_network_header_len(skb));
+ skb_gro_postpull_rcsum(skb, iph, nlen);
pp = ops->callbacks.gro_receive(head, skb);
- skb->csum = csum;
-
out_unlock:
rcu_read_unlock();
diff --git a/net/ipv6/tcpv6_offload.c b/net/ipv6/tcpv6_offload.c
index 0d78132ff18a..8517d3cd1aed 100644
--- a/net/ipv6/tcpv6_offload.c
+++ b/net/ipv6/tcpv6_offload.c
@@ -42,7 +42,7 @@ static struct sk_buff **tcp6_gro_receive(struct sk_buff **head,
if (NAPI_GRO_CB(skb)->flush)
goto skip_csum;
- wsum = skb->csum;
+ wsum = NAPI_GRO_CB(skb)->csum;
switch (skb->ip_summed) {
case CHECKSUM_NONE:
^ permalink raw reply related [flat|nested] 3+ messages in thread
* Re: [PATCH net v2] ipv6: gro: fix CHECKSUM_COMPLETE support
2014-05-20 4:56 ` [PATCH net v2] " Eric Dumazet
@ 2014-05-21 21:20 ` David Miller
0 siblings, 0 replies; 3+ messages in thread
From: David Miller @ 2014-05-21 21:20 UTC (permalink / raw)
To: eric.dumazet; +Cc: hkchu, netdev, edumazet
From: Eric Dumazet <eric.dumazet@gmail.com>
Date: Mon, 19 May 2014 21:56:34 -0700
> From: Eric Dumazet <edumazet@google.com>
>
> When GRE support was added in linux-3.14, CHECKSUM_COMPLETE handling
> broke on GRE+IPv6 because we did not update/use the appropriate csum :
>
> GRO layer is supposed to use/update NAPI_GRO_CB(skb)->csum instead of
> skb->csum
>
> Tested using a GRE tunnel and IPv6 traffic. GRO aggregation now happens
> at the first level (ethernet device) instead of being done in gre
> tunnel. Native IPv6+TCP is still properly aggregated.
>
> Fixes: bf5a755f5e918 ("net-gre-gro: Add GRE support to the GRO stack")
> Signed-off-by: Eric Dumazet <edumazet@google.com>
> Cc: Jerry Chu <hkchu@google.com>
> ---
> v2: use nlen instead of sizeof(*iph) to support extension headers
Applied and queued up for -stable, thanks.
^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2014-05-21 21:20 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <1400548164.5367.80.camel@edumazet-glaptop2.roam.corp.google.com>
2014-05-20 4:41 ` [PATCH net] ipv6: gro: fix CHECKSUM_COMPLETE support Eric Dumazet
2014-05-20 4:56 ` [PATCH net v2] " Eric Dumazet
2014-05-21 21:20 ` David Miller
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).