Received: by 2002:a05:6a10:f347:0:0:0:0 with SMTP id d7csp5452078pxu; Tue, 22 Dec 2020 18:25:39 -0800 (PST) X-Google-Smtp-Source: ABdhPJwxXf9GNEkHX/fXdN9zyW3ml+xHcCGLepqguMLbnfBmRQlYwz4ojxZZfTw4oevNo+Rb8DXm X-Received: by 2002:a50:8741:: with SMTP id 1mr23132142edv.349.1608690339233; Tue, 22 Dec 2020 18:25:39 -0800 (PST) ARC-Seal: i=1; a=rsa-sha256; t=1608690339; cv=none; d=google.com; s=arc-20160816; b=VuhTRmL4TlhvfeIXCOPXMVoBUuGA64d9sCZYDlXFucD0CISGq9YtwKR72QGqbSkRCV E2uuF3T7WXbR+shgt61cNoyeh7uEFclS4hTXwjgYpjpCpQceFZl90cUditr0vI84oPKg WfmAHTsE9o42JSiA8GmyKVb5H/Ax+RRO7aAIX1VWabVsRAEGwN6+XarstR60ElvwL3vO cIqFj4OPGc1S/D/a4bUOLLPXSMgraeaVctoD0REgYf8MzEeCqf0kHzf+ywN6XATBOh2Z 6raylGQ7OOgvjhobfwABcwFav/xBK0BYUcy2a5FkV71/QvIg3wFabtijsDpHovGEN761 LnWQ== 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 :references:in-reply-to:message-id:date:subject:cc:to:from :dkim-signature; bh=ekulK4mSvrO40aP3iuizZ22o2Lf4NXMotnKrMBWg2+E=; b=VxfBrFkh3M60lqBaKSs+ne8HHXupvXz5LmPOgWgAtUiVTWp9fwPbhaxFwScZiFtBpS ISRpVRwwUsdhIjBGzlRbrcICHlrx4d9kx4YZRLjXNPXZyQOhlUYlpLxtj15JJ1aHIKTX dq47lnM9Sx+jhCNIP7+DaJba6b7h6oKi1Q1yAHHyTSm1YfS/FQKyYVdOvKRFuYb6lxOi poWnciahaNXGumUVjxemvt+qp10ZFQWYlK7Gor1CXXKRkSATibSPEDHkV0cM9GxE6kWS N14otAJUtlrx4Yz+ArD8mXRvW5ao66ODudBJez1OTl3yqkGvyeUg2ogMLQNiKazbgL7T 82AQ== ARC-Authentication-Results: i=1; mx.google.com; dkim=pass header.i=@kernel.org header.s=k20201202 header.b="PrpOy1/R"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Return-Path: Received: from vger.kernel.org (vger.kernel.org. [23.128.96.18]) by mx.google.com with ESMTP id c15si13493025edy.244.2020.12.22.18.25.16; Tue, 22 Dec 2020 18:25:39 -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=@kernel.org header.s=k20201202 header.b="PrpOy1/R"; 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=NONE sp=NONE dis=NONE) header.from=kernel.org Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S1728312AbgLWCXv (ORCPT + 99 others); Tue, 22 Dec 2020 21:23:51 -0500 Received: from mail.kernel.org ([198.145.29.99]:52234 "EHLO mail.kernel.org" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1730011AbgLWCXb (ORCPT ); Tue, 22 Dec 2020 21:23:31 -0500 Received: by mail.kernel.org (Postfix) with ESMTPSA id 70A6C225AC; Wed, 23 Dec 2020 02:23:13 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1608690194; bh=+UTwsuGRzzZhpz0EhL6quu0QIDzAmdWzEoKDyc32D14=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=PrpOy1/RugdnUlindMTyKBrm8xW5fWLGJ2AU0fc7rzfaG4VQoznYDHZMviUl/EFw3 0Rswct0pI7bVv+VYA+7U91TNBo6rux2pVNCyZyl1+zwCCRwGW7ilvho8Jl6zcT2fP7 H9MF0ahHtyj5T9MbbdBPLuyQEwdg7u9fM7bVtrv94J7v3/rUnud2d143RpDkrQEK3U gdLqGbVp/YmkFL5IxgFoADKwAT30nesSbEVJKJGsDGkmKc9LMmPAeJ+S08VnPWYKX0 d6WhTkmIT0+rMYtw1eQttnnDvdjf+OLuscdzWRTZHtU/FFAzWGukxXQF0w37aZZ02n /to7QiadvgS5Q== From: Sasha Levin To: linux-kernel@vger.kernel.org, stable@vger.kernel.org Cc: Alexander Lobakin , Jakub Kicinski , Sasha Levin , netdev@vger.kernel.org Subject: [PATCH AUTOSEL 4.14 17/66] net: skb_vlan_untag(): don't reset transport offset if set by GRO layer Date: Tue, 22 Dec 2020 21:22:03 -0500 Message-Id: <20201223022253.2793452-17-sashal@kernel.org> X-Mailer: git-send-email 2.27.0 In-Reply-To: <20201223022253.2793452-1-sashal@kernel.org> References: <20201223022253.2793452-1-sashal@kernel.org> MIME-Version: 1.0 X-stable: review X-Patchwork-Hint: Ignore Content-Transfer-Encoding: 8bit Precedence: bulk List-ID: X-Mailing-List: linux-kernel@vger.kernel.org From: Alexander Lobakin [ Upstream commit 8be33ecfc1ffd2da20cc29e957e4cb6eb99310cb ] 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/zYurwsZRN7BkqSoikWQLVqHyxz18h4LhHU4NFa2Vw@cp4-web-038.plabs.ch Signed-off-by: Alexander Lobakin Link: https://lore.kernel.org/r/7JgIkgEztzt0W6ZtC9V9Cnk5qfkrUFYcpN871syCi8@cp4-web-040.plabs.ch Signed-off-by: Jakub Kicinski Signed-off-by: Sasha Levin --- 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 c4f412526dfeb..9ab02babfcebc 100644 --- a/net/core/skbuff.c +++ b/net/core/skbuff.c @@ -5069,7 +5069,8 @@ struct sk_buff *skb_vlan_untag(struct sk_buff *skb) goto err_free; skb_reset_network_header(skb); - skb_reset_transport_header(skb); + if (!skb_transport_header_was_set(skb)) + skb_reset_transport_header(skb); skb_reset_mac_len(skb); return skb; -- 2.27.0