Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp806124pxb; Thu, 5 Nov 2020 13:33:56 -0800 (PST) X-Google-Smtp-Source: ABdhPJxAXdqYRJV7rytA+DjFlgQkyMKJY5RjGDOdIklZZMGklw3Ip4hynPjVl9SsqsI/S2ZGe3kB X-Received: by 2002:aa7:c617:: with SMTP id h23mr4690268edq.154.1604612036339; Thu, 05 Nov 2020 13:33:56 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604612036; cv=none; d=google.com; s=arc-20160816; b=sonT2cbah2P1yEG2co3emHj/UC6KlPggDHlSlfmFeDxk/K8SG7USfdCSm8FGSOa4ow 9lZGKywbdI1j0YyIpC15x5E6eazGMFnXUy4EL5psKLb/hM2bnUXwsBTaqu+WhLHyg/+g YmrvEL9tMnmtTU/vFld6EHlVwqR7uWQaPkmxZmIK6VsmzEDKqnKhALa+95szTlfDBeUY +H7v7ZelQ3YzXatvqd5RTOTXhsheCuMysHl/7avHsn1w2V0N0AbeQqO5/AcevLbEvh2/ QuS2dPIopL0yfKA9TMh2UOoR7KBFW3SQL5Qkr3oAbr0abeVgn0CQZFaiDxZPsnvbUe0p tKBQ== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=google.com; s=arc-20160816; h=list-id:precedence:content-transfer-encoding:mime-version :message-id:subject:reply-to:cc:from:to:dkim-signature:date; bh=TlTCVc4GsAeJhqQaL3Nb2ua0fbsIOLGFOUjiApOTEkY=; b=Mwf0RUEsEn2pxsu1Rm/LG/JDUKtprMMnSA5t8t07P3JwJRiwgBAYGbuMXPO67kyMFC j8fXpXHnZkhYLCjxEXNGxiUPhlE+gprH76VOOFNcTnT6ys4MDQYPsMGsIufJSmmNWnrM hiHy9i3g9lx1YF50bpepuqxUSpNcC/KWh3KcvCHoSSuxlqVSg08fErj/VlJd3HwFh+4G kKp5yXbDSWivXYw+JPm+GDeK2MRgdChf+GIlIjRjmACADDgazfY3oV5/875GqvqA4Dnq HaHftqhwsn9X1yqBVzx/+BxUf9n5vVW8E1NHBN8EVrayWx3ZVut2vWtywvHzWV9bGwHl jZEw== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b="Qj0/1xbD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id s18si1866497ejd.220.2020.11.05.13.33.32; Thu, 05 Nov 2020 13:33:56 -0800 (PST) Received-SPF: pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) client-ip=23.128.96.18; Authentication-Results: mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b="Qj0/1xbD"; spf=pass (google.com: domain of linux-kernel-owner@vger.kernel.org designates 23.128.96.18 as permitted sender) smtp.mailfrom=linux-kernel-owner@vger.kernel.org; dmarc=pass (p=QUARANTINE sp=QUARANTINE dis=NONE) header.from=pm.me Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1732482AbgKEV3N (ORCPT + 99 others); Thu, 5 Nov 2020 16:29:13 -0500 Received: from mail-40136.protonmail.ch ([185.70.40.136]:14646 "EHLO mail-40136.protonmail.ch" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730973AbgKEV3M (ORCPT ); Thu, 5 Nov 2020 16:29:12 -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 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: quoted-printable X-Spam-Status: No, score=-1.2 required=10.0 tests=ALL_TRUSTED,DKIM_SIGNED, DKIM_VALID,DKIM_VALID_AU,DKIM_VALID_EF shortcircuit=no autolearn=disabled version=3.4.4 X-Spam-Checker-Version: SpamAssassin 3.4.4 (2020-01-24) on mailout.protonmail.ch Precedence: bulk List-ID: X-Mailing-List: linux-kernel@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) =09=09goto err_free; =20 =09skb_reset_network_header(skb); -=09skb_reset_transport_header(skb); =09skb_reset_mac_len(skb); =20 +=09if (!skb_transport_header_was_set(skb)) +=09=09skb_reset_transport_header(skb); + =09return skb; =20 err_free: --=20 2.29.2