netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] gre: Fix regression in gretap TSO support
@ 2014-10-30  3:26 alexander.duyck
  2014-10-30  5:14 ` Pravin Shelar
  0 siblings, 1 reply; 8+ messages in thread
From: alexander.duyck @ 2014-10-30  3:26 UTC (permalink / raw)
  To: netdev, davem
  Cc: H.K. Jerry Chu, Eric Dumazet, Alexander Duyck, Neal Cardwell,
	Pravin B Shelar

From: Alexander Duyck <alexander.h.duyck@redhat.com>

On recent kernels I found that TSO on gretap interfaces didn't work.  After
bisecting it I found that commit b884b1a4 had introduced a regression in
which the Ethernet header was being included in the GRE header length.

This change corrects that by basing the GRE header length on the inner mac
header in the case of GRE tunnels using transparent Ethernet bridging, and
uses the network header for all other GRE tunnel types.

Fixes: b884b1a4 ("gre_offload: simplify GRE header length calculation in gre_gso_segment()")
Cc: Neal Cardwell <ncardwell@google.com>
Cc: Eric Dumazet <edumazet@google.com>
Cc: H.K. Jerry Chu <hkchu@google.com>
Cc: Pravin B Shelar <pshelar@nicira.com>
Signed-off-by: Alexander Duyck <alexander.h.duyck@redhat.com>
---
 net/ipv4/gre_offload.c |    5 ++++-
 1 file changed, 4 insertions(+), 1 deletion(-)

diff --git a/net/ipv4/gre_offload.c b/net/ipv4/gre_offload.c
index f6e345c..67a1f66 100644
--- a/net/ipv4/gre_offload.c
+++ b/net/ipv4/gre_offload.c
@@ -47,7 +47,10 @@ static struct sk_buff *gre_gso_segment(struct sk_buff *skb,
 
 	greh = (struct gre_base_hdr *)skb_transport_header(skb);
 
-	ghl = skb_inner_network_header(skb) - skb_transport_header(skb);
+	if (greh->protocol == htons(ETH_P_TEB))
+		ghl = skb_inner_mac_header(skb) - skb_transport_header(skb);
+	else
+		ghl = skb_inner_network_header(skb) - skb_transport_header(skb);
 	if (unlikely(ghl < sizeof(*greh)))
 		goto out;
 

^ permalink raw reply related	[flat|nested] 8+ messages in thread

end of thread, other threads:[~2014-10-30 15:32 UTC | newest]

Thread overview: 8+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2014-10-30  3:26 [PATCH net] gre: Fix regression in gretap TSO support alexander.duyck
2014-10-30  5:14 ` Pravin Shelar
2014-10-30 13:51   ` Neal Cardwell
2014-10-30 14:30     ` Alexander Duyck
2014-10-30 15:00       ` Eric Dumazet
2014-10-30 15:05       ` Tom Herbert
2014-10-30 15:32         ` Tom Herbert
2014-10-30 15:32         ` Alexander Duyck

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).