netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] net: skb_vlan_untag(): don't reset transport offset if set by GRO layer
@ 2020-11-05 21:29 Alexander Lobakin
  2020-11-09 23:29 ` Jakub Kicinski
  0 siblings, 1 reply; 3+ messages in thread
From: Alexander Lobakin @ 2020-11-05 21:29 UTC (permalink / raw)
  To: David S. Miller, Jakub Kicinski
  Cc: Eric Dumazet, Miaohe Lin, Martin Varghese, Pravin B Shelar,
	Willem de Bruijn, Guillaume Nault, Al Viro, Florian Westphal,
	Steffen Klassert, Paolo Abeni, Yadu Kishore, Vladimir Oltean,
	Alexander Lobakin, netdev, linux-kernel

Similar to commit fda55eca5a33f
("net: introduce skb_transport_header_was_set()"), avoid resetting
transport offsets that were already set by GRO layer. This not only
mirrors the behavior of __netif_receive_skb_core(), but also makes
sense when it comes to UDP GSO fraglists forwarding: transport offset
of such skbs is set only once by GRO receive callback and remains
untouched and correct up to the xmitting driver in 1:1 case, but
becomes junk after untagging in ingress VLAN case and breaks UDP
GSO offload. This does not happen after this change, and all types
of forwarding of UDP GSO fraglists work as expected.

Signed-off-by: Alexander Lobakin <alobakin@pm.me>
---
 net/core/skbuff.c | 4 +++-
 1 file changed, 3 insertions(+), 1 deletion(-)

diff --git a/net/core/skbuff.c b/net/core/skbuff.c
index c5e6c0b83a92..39c13b9cf79d 100644
--- a/net/core/skbuff.c
+++ b/net/core/skbuff.c
@@ -5441,9 +5441,11 @@ struct sk_buff *skb_vlan_untag(struct sk_buff *skb)
 		goto err_free;
 
 	skb_reset_network_header(skb);
-	skb_reset_transport_header(skb);
 	skb_reset_mac_len(skb);
 
+	if (!skb_transport_header_was_set(skb))
+		skb_reset_transport_header(skb);
+
 	return skb;
 
 err_free:
-- 
2.29.2



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

end of thread, other threads:[~2020-11-09 23:38 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2020-11-05 21:29 [PATCH net-next] net: skb_vlan_untag(): don't reset transport offset if set by GRO layer Alexander Lobakin
2020-11-09 23:29 ` Jakub Kicinski
2020-11-09 23:38   ` Alexander Lobakin

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