netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Tom Herbert <therbert@google.com>
To: davem@davemloft.net, netdev@vger.kernel.org
Subject: [PATCH net-next 1/3] ipv6: Clear flush_id to make GRO work
Date: Tue,  9 Sep 2014 11:23:14 -0700	[thread overview]
Message-ID: <1410286996-302-2-git-send-email-therbert@google.com> (raw)
In-Reply-To: <1410286996-302-1-git-send-email-therbert@google.com>

In TCP gro we check flush_id which is derived from the IP identifier.
In IPv4 gro path the flush_id is set with the expectation that every
matched packet increments IP identifier. In IPv6, the flush_id is
never set and thus is uinitialized. What's worse is that in IPv6
over IPv4 encapsulation, the IP identifier is taken from the outer
header which is currently not incremented on every packet for Linux
stack, so GRO in this case never matches packets (identifier is
not increasing).

This patch clears flush_id for every time for a matched packet in
IPv6 gro_receive. We need to do this each time to overwrite the
setting that would be done in IPv4 gro_receive per the outer
header in IPv6 over Ipv4 encapsulation.

Signed-off-by: Tom Herbert <therbert@google.com>
---
 net/ipv6/ip6_offload.c | 3 +++
 1 file changed, 3 insertions(+)

diff --git a/net/ipv6/ip6_offload.c b/net/ipv6/ip6_offload.c
index 5bcda33..929bbbcd 100644
--- a/net/ipv6/ip6_offload.c
+++ b/net/ipv6/ip6_offload.c
@@ -261,6 +261,9 @@ static struct sk_buff **ipv6_gro_receive(struct sk_buff **head,
 		/* flush if Traffic Class fields are different */
 		NAPI_GRO_CB(p)->flush |= !!(first_word & htonl(0x0FF00000));
 		NAPI_GRO_CB(p)->flush |= flush;
+
+		/* Clear flush_id, there's really no concept of ID in IPv6. */
+		NAPI_GRO_CB(p)->flush_id = 0;
 	}
 
 	NAPI_GRO_CB(skb)->flush |= flush;
-- 
2.1.0.rc2.206.gedb03e5

  reply	other threads:[~2014-09-09 18:23 UTC|newest]

Thread overview: 9+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2014-09-09 18:23 [PATCH net-next 0/3] net: enable GRO for IPIP and SIT Tom Herbert
2014-09-09 18:23 ` Tom Herbert [this message]
2014-09-09 18:38   ` [PATCH net-next 1/3] ipv6: Clear flush_id to make GRO work Eric Dumazet
2014-09-09 18:52     ` Tom Herbert
2014-09-09 18:23 ` [PATCH 2/3] ipip: Add gro callbacks to ipip offload Tom Herbert
2014-09-09 18:23 ` [PATCH 3/3] sit: Add gro callbacks to sit_offload Tom Herbert
2014-09-10  3:27 ` [PATCH net-next 0/3] net: enable GRO for IPIP and SIT David Miller
2014-09-10  4:04   ` Tom Herbert
2014-09-10  4:32     ` David Miller

Reply instructions:

You may reply publicly to this message via plain-text email
using any one of the following methods:

* Save the following mbox file, import it into your mail client,
  and reply-to-all from there: mbox

  Avoid top-posting and favor interleaved quoting:
  https://en.wikipedia.org/wiki/Posting_style#Interleaved_style

* Reply using the --to, --cc, and --in-reply-to
  switches of git-send-email(1):

  git send-email \
    --in-reply-to=1410286996-302-2-git-send-email-therbert@google.com \
    --to=therbert@google.com \
    --cc=davem@davemloft.net \
    --cc=netdev@vger.kernel.org \
    /path/to/YOUR_REPLY

  https://kernel.org/pub/software/scm/git/docs/git-send-email.html

* If your mail client supports setting the In-Reply-To header
  via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line before the message body.
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).