From patchwork Thu Nov 5 21:29:01 2020 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Alexander Lobakin X-Patchwork-Id: 319757 Return-Path: X-Spam-Checker-Version: SpamAssassin 3.4.0 (2014-02-07) on aws-us-west-2-korg-lkml-1.web.codeaurora.org X-Spam-Level: X-Spam-Status: No, score=-9.8 required=3.0 tests=BAYES_00,DKIM_SIGNED, DKIM_VALID, DKIM_VALID_AU, HEADER_FROM_DIFFERENT_DOMAINS, INCLUDES_PATCH, MAILING_LIST_MULTI, SIGNED_OFF_BY, SPF_HELO_NONE, SPF_PASS, URIBL_BLOCKED autolearn=unavailable autolearn_force=no version=3.4.0 Received: from mail.kernel.org (mail.kernel.org [198.145.29.99]) by smtp.lore.kernel.org (Postfix) with ESMTP id 8B6D3C55178 for ; Thu, 5 Nov 2020 21:29:17 +0000 (UTC) Received: from vger.kernel.org (vger.kernel.org [23.128.96.18]) by mail.kernel.org (Postfix) with ESMTP id 1A0A420756 for ; Thu, 5 Nov 2020 21:29:17 +0000 (UTC) Authentication-Results: mail.kernel.org; dkim=pass (2048-bit key) header.d=pm.me header.i=@pm.me header.b="Qj0/1xbD" Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732562AbgKEV3Q (ORCPT ); Thu, 5 Nov 2020 16:29:16 -0500 Received: from mail2.protonmail.ch ([185.70.40.22]:11060 "EHLO mail2.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1732090AbgKEV3N (ORCPT ); Thu, 5 Nov 2020 16:29:13 -0500 Date: Thu, 05 Nov 2020 21:29:01 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1604611750; bh=TlTCVc4GsAeJhqQaL3Nb2ua0fbsIOLGFOUjiApOTEkY=; h=Date:To:From:Cc:Reply-To:Subject:From; b=Qj0/1xbD/DgV5a4CaDmO/eF3yFtVAiacxsFsvvWc92lHdbDAPBmdJqPQxViInw66w gsbbwwWdSgO/r5aBPmTCABQYgyDvshldXrPnrN1soieb/uaENRiXiMxwxRtUhd3fvo gXJUS8r+HTsS6MCqnXwCik+K+RvAV73elV40HgjLAPjsWlDjqDJ5Pg44RL0mxlrxGX 9m6aVUGjvZh2yP7f3tDAgNeZmsGBjRf/ocpD6LmZwWoD959VqmncrFFqZyjg5ea4Zl 7PxkBSCR1NodfrzQoVt7attstz4x+Q7OCtD04NQ6L5PBY8DAdaP3HRoePV+R5xMoU6 lmOtgOE5/JaIw== To: "David S. Miller" , Jakub Kicinski From: Alexander Lobakin 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@vger.kernel.org, linux-kernel@vger.kernel.org Reply-To: Alexander Lobakin Subject: [PATCH net-next] net: skb_vlan_untag(): don't reset transport offset if set by GRO layer Message-ID: MIME-Version: 1.0 Precedence: bulk List-ID: X-Mailing-List: netdev@vger.kernel.org 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 --- 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: