netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net] ipv6: sr: remove SKB_GSO_IPXIP6 on End.D* actions
@ 2020-01-20  4:48 Yuki Taguchi
  2020-01-21  9:19 ` David Miller
  0 siblings, 1 reply; 2+ messages in thread
From: Yuki Taguchi @ 2020-01-20  4:48 UTC (permalink / raw)
  To: netdev; +Cc: davem, kuznet, yoshfuji, dlebrun, david.lebrun, Yuki Taguchi

After LRO/GRO is applied, SRv6 encapsulated packets have
SKB_GSO_IPXIP6 feature flag, and this flag must be removed right after
decapulation procedure.

Currently, SKB_GSO_IPXIP6 flag is not removed on End.D* actions, which
creates inconsistent packet state, that is, a normal TCP/IP packets
have the SKB_GSO_IPXIP6 flag. This behavior can cause unexpected
fallback to GSO on routing to netdevices that do not support
SKB_GSO_IPXIP6. For example, on inter-VRF forwarding, decapsulated
packets separated into small packets by GSO because VRF devices do not
support TSO for packets with SKB_GSO_IPXIP6 flag, and this degrades
forwarding performance.

This patch removes encapsulation related GSO flags from the skb right
after the End.D* action is applied.

Fixes: d7a669dd2f8b ("ipv6: sr: add helper functions for seg6local")
Signed-off-by: Yuki Taguchi <tagyounit@gmail.com>
---
 net/ipv6/seg6_local.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/ipv6/seg6_local.c b/net/ipv6/seg6_local.c
index 85a5447a3e8d..7cbc19731997 100644
--- a/net/ipv6/seg6_local.c
+++ b/net/ipv6/seg6_local.c
@@ -23,6 +23,7 @@
 #include <net/addrconf.h>
 #include <net/ip6_route.h>
 #include <net/dst_cache.h>
+#include <net/ip_tunnels.h>
 #ifdef CONFIG_IPV6_SEG6_HMAC
 #include <net/seg6_hmac.h>
 #endif
@@ -135,7 +136,8 @@ static bool decap_and_validate(struct sk_buff *skb, int proto)
 
 	skb_reset_network_header(skb);
 	skb_reset_transport_header(skb);
-	skb->encapsulation = 0;
+	if (iptunnel_pull_offloads(skb))
+		return false;
 
 	return true;
 }
-- 
2.20.1 (Apple Git-117)


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

* Re: [PATCH net] ipv6: sr: remove SKB_GSO_IPXIP6 on End.D* actions
  2020-01-20  4:48 [PATCH net] ipv6: sr: remove SKB_GSO_IPXIP6 on End.D* actions Yuki Taguchi
@ 2020-01-21  9:19 ` David Miller
  0 siblings, 0 replies; 2+ messages in thread
From: David Miller @ 2020-01-21  9:19 UTC (permalink / raw)
  To: tagyounit; +Cc: netdev, kuznet, yoshfuji, dlebrun, david.lebrun

From: Yuki Taguchi <tagyounit@gmail.com>
Date: Mon, 20 Jan 2020 13:48:37 +0900

> After LRO/GRO is applied, SRv6 encapsulated packets have
> SKB_GSO_IPXIP6 feature flag, and this flag must be removed right after
> decapulation procedure.
> 
> Currently, SKB_GSO_IPXIP6 flag is not removed on End.D* actions, which
> creates inconsistent packet state, that is, a normal TCP/IP packets
> have the SKB_GSO_IPXIP6 flag. This behavior can cause unexpected
> fallback to GSO on routing to netdevices that do not support
> SKB_GSO_IPXIP6. For example, on inter-VRF forwarding, decapsulated
> packets separated into small packets by GSO because VRF devices do not
> support TSO for packets with SKB_GSO_IPXIP6 flag, and this degrades
> forwarding performance.
> 
> This patch removes encapsulation related GSO flags from the skb right
> after the End.D* action is applied.
> 
> Fixes: d7a669dd2f8b ("ipv6: sr: add helper functions for seg6local")
> Signed-off-by: Yuki Taguchi <tagyounit@gmail.com>

Applied and queued up for -stable, thanks.

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

end of thread, other threads:[~2020-01-21  9:21 UTC | newest]

Thread overview: 2+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-01-20  4:48 [PATCH net] ipv6: sr: remove SKB_GSO_IPXIP6 on End.D* actions Yuki Taguchi
2020-01-21  9:19 ` 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).