Received: by 2002:a05:6a10:16a7:0:0:0:0 with SMTP id gp39csp3595004pxb; Mon, 9 Nov 2020 15:49:17 -0800 (PST) X-Google-Smtp-Source: ABdhPJz8QVIgraEmuVs+2Jotnm1nHmOLb++vTeN7T9RVOd1rZcvUVcqNWDzvBaSxerJW6olFbNZj X-Received: by 2002:aa7:c5d0:: with SMTP id h16mr18534834eds.7.1604965757139; Mon, 09 Nov 2020 15:49:17 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1604965757; cv=none; d=google.com; s=arc-20160816; b=McNd2W3d6J4j5xjQmP74hEyKNI9L+i8Ank4HYF492Cxakq6Cva5/aUluKDiavRPIxl UgudwRmVSNyAmGygzIaGcmQq0O+uv4GqM8RHaEkVjYBVyW3nBywasdlky77AbZjpZYfH Xf0Xyu2cf1BKfZMuhPqukAmo3TAm1rtzFLDANC6v7xVqdQBx7gdBxoRhNxP6KWPrG7w6 YXna+NbYvtUQlESrhkaZOZkbURMLyojX8qhnB5tTc4K3x2kx8EYQeVFvKTuiL6dKXq/d a1Big8PQ4i+bvlwyteSNHBB5zpVQWf/H47pN2LWask+P71Fbbk2enIPJFlXPaLsYQ3tN 08Og== 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=uYN8M4VNUEQtV4L58BW2W4twRUw/8B/3sQ69oqzf5Ik=; b=OmnUChx9KJMG+/xzPeTV5RUUL4M7yhs47lwUzS57vk1z3El8yGyKKUp9bXednGlDT2 5kaovNeVmD90QiGFEjX+Ua6HlBxd3EbBVKNy8Wx3HbysKT4GFmOTq/IxVV1yOxz6p5K3 SqNrFshUnyCli83eyHI16baKvJ22L0NMPYYJCqJfwlhsiWOe31nSZO2kCZX8aWasRPjQ rMjy55teJELelAtSToQ0CzmpMD8XGzVwF6PyVJNf5pnFZmwJ5ZZb9Chu81I5v5Aht4X7 WGlVgvvW+zeRv2ChEV0OqBEnZM3tba0Rw9L26wZMnGblvaHB0nqAMrGUh/2ZgcerIxl4 zF5Q== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@pm.me header.s=protonmail header.b=l7C3WflO; 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 p25si8789032edq.230.2020.11.09.15.48.54; Mon, 09 Nov 2020 15:49:17 -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=l7C3WflO; 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 S1730695AbgKIXra (ORCPT + 99 others); Mon, 9 Nov 2020 18:47:30 -0500 Received: from mail-02.mail-europe.com ([51.89.119.103]:53964 "EHLO mail-02.mail-europe.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1729452AbgKIXra (ORCPT ); Mon, 9 Nov 2020 18:47:30 -0500 Date: Mon, 09 Nov 2020 23:47:23 +0000 DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=pm.me; s=protonmail; t=1604965646; bh=uYN8M4VNUEQtV4L58BW2W4twRUw/8B/3sQ69oqzf5Ik=; h=Date:To:From:Cc:Reply-To:Subject:From; b=l7C3WflOqe8XWnTmLJY+5gpnzVnH/Mjgx398KZnT/BnobLVmztvbroExU0Dp1Tio+ RW9bmknOO7ODew6S59iR0JKK3T4mVRpiP4/WWVzZ5ip2x5+IGleQIV5jJdyQxNiex3 svHiWc6NUOCSszEawyMOelTTyAiLaZmqMYOr+OUCRqNI9A+Pe4+v+znt5uxWS3vaRP pQZ3Vo1y9JzyGHEJftnTMFxbV0l2mIbIpYLq7r25dGVVrwqTNYNP5l/jMoZbU/JNSb rQMlFRiUkqanXDR9i/d4crF6kY7oFl/a6m4vvax/P8pphaNiNAa1ReX2MrG9njpwaR jzhuNk4w0ZH1w== 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 v2 net-next] net: skb_vlan_untag(): don't reset transport offset if set by GRO layer Message-ID: <7JgIkgEztzt0W6ZtC9V9Cnk5qfkrUFYcpN871syCi8@cp4-web-040.plabs.ch> 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. Since v1 [1]: - keep the code 1:1 with __netif_receive_skb_core() (Jakub). [1] https://lore.kernel.org/netdev/zYurwsZRN7BkqSoikWQLVqHyxz18h4LhHU4NFa2V= w@cp4-web-038.plabs.ch Signed-off-by: Alexander Lobakin --- net/core/skbuff.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/core/skbuff.c b/net/core/skbuff.c index 1ba8f0163744..aa3d2828b7a2 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -5430,7 +5430,8 @@ 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); +=09if (!skb_transport_header_was_set(skb)) +=09=09skb_reset_transport_header(skb); =09skb_reset_mac_len(skb); =20 =09return skb; --=20 2.29.2