From patchwork Tue Nov 5 10:06:43 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Chia-Yu Chang (Nokia)" X-Patchwork-Id: 13862740 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2073.outbound.protection.outlook.com [40.107.22.73]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id C840A1D31B5; Tue, 5 Nov 2024 10:07:17 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730801240; cv=fail; b=YFOOX8L4u8KHm10loNI+Aeh1YiLYPhhyef7helPE+QYLSjiWdKXawPkNAW2O6VscGULoi6VKm8S2DmbRRrKN1vzcQU7JKrLy5FTRUf3dBdErJEZuE2vr4TQV1ySNXz0DMKAZ3XZZhCqv46xOBehZyLAX7aQKrn+Qw/9zYMNG8Ig= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1730801240; c=relaxed/simple; bh=4j5SJ5HYuPel2Dv+IBBWRsO/17dTAoza3QBOY2Scc+0=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Li4jhTgdp8ywTQeqzehaT4SyX9+PTyp2/f7Ig987EtZnqaLe4YeMKi8Jx/EWDwQVJxp9V4+gDuuozNffbJrTD425qEhGcwXiJH2xJr87OTorNPNxyx7WVlCoZmSet5/mHakdm99pEBv9NQmu2ezPFQFriAcxU2jHWQwNiuMi3OE= ARC-Authentication-Results: i=2; smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nokia-bell-labs.com; spf=fail smtp.mailfrom=nokia-bell-labs.com; dkim=pass (2048-bit key) header.d=nokia-bell-labs.com header.i=@nokia-bell-labs.com header.b=JwXIL6BO; arc=fail smtp.client-ip=40.107.22.73 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nokia-bell-labs.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nokia-bell-labs.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nokia-bell-labs.com header.i=@nokia-bell-labs.com header.b="JwXIL6BO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uXUGxUTObqkMjoNGF0bB5nD+5nBPHRnP+8+XumJtZu6PB492UlirAvKCA0KMSzidwZx05iHtnIlLFfVFqGmksqTIAMo7818L5j6ha0VC964EDi87kbvC2LEvn8PPBFCmDM2IvwY+yWWDS0Jc3fLsftQzsB2MHueNw+CQdkluz5LDl3Dg3S2b8qPtz7FeDpF3lr2F3w/8JuHWXcjzHfB4iZ+KwFETKXz8bF6N54gltnadwyG9v3DVwvz1CPAzjvxjjaEalKoev7NTbjOMz4JeY1cszU4DhcHnyP8Rt7VfVp7UtJOu67pLqsLxZyANOHXs3HH2/UnsR5OxzoOhMC1dHA== ARC-Message-Signature: i=1; a=rsa-sha256; c=relaxed/relaxed; d=microsoft.com; s=arcselector10001; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-AntiSpam-MessageData-ChunkCount:X-MS-Exchange-AntiSpam-MessageData-0:X-MS-Exchange-AntiSpam-MessageData-1; bh=VSA7eqx5WtqjVvMOGIZmeD65xQRrVJgg0ZR6KM5OeDg=; b=hkHponZDvGPQMrdGO+eCjLPwPyjTL+AcOwZWpfkTwRHgtib3dG5061DV0yBqI07+FeEv2BZM4bgqJVMfv9c8lErr3RwSJHUoVJXuCQeuQ765a2P8oAsILyEflDGDCpdfkTxjvVsikkSE/T0IMxIhAuHNyKSQJBMobm84OA85WIbKqYzi5BSfBU75jiJHsQ4P0VrPte2q5IVnJYuJ1pxtHcaniGctQ7BwVQO18qztm7MFMr9dEJ2re2ZgdJ0ibjpqV9J3hDTRlmiNV4f6XEcYBetW5UUsh/CNcQajVbkGNc7fl0x/70YwhKtZ6OpCdV508DtoLtkXmnZF+zbgnUoLmg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 131.228.6.101) smtp.rcpttodomain=nokia-bell-labs.com smtp.mailfrom=nokia-bell-labs.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nokia-bell-labs.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia-bell-labs.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=VSA7eqx5WtqjVvMOGIZmeD65xQRrVJgg0ZR6KM5OeDg=; b=JwXIL6BODM0ePeXy/I8WbwzfVd1wbApIy5EyRzzCr8iENZzeyFUaCyf5D6mSgmI+SV+755Yu0lcSPY49BJ6x0j344tbOFZjlHOaNknmNMzWyxbD8hlukUB3dnJcehzI6UbD4fwwFExphoCqYQrdRXDN6poWNeJULGi5X3OkRFskba4c+uO4Cjf6cPLc1FoIETlqa78T5U+wJ9LRfJ38tKakJ9F7vlbqmsAeZ8axwffE0JWPKvPSD8R9aNuT3asmSC3s52SQDCRTXO6CzdjB5xqgUqF+h8aE4wwXrjFyXXQLL4AbuvcSik+Lk/SbV/Oo++ygEzrwNLMlM3dJ/NZYa5g== Received: from DB8PR03CA0014.eurprd03.prod.outlook.com (2603:10a6:10:be::27) by AS8PR07MB7830.eurprd07.prod.outlook.com (2603:10a6:20b:38f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31; Tue, 5 Nov 2024 10:07:14 +0000 Received: from DU2PEPF00028D03.eurprd03.prod.outlook.com (2603:10a6:10:be:cafe::c2) by DB8PR03CA0014.outlook.office365.com (2603:10a6:10:be::27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.31 via Frontend Transport; Tue, 5 Nov 2024 10:07:14 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 131.228.6.101) smtp.mailfrom=nokia-bell-labs.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nokia-bell-labs.com; Received-SPF: Pass (protection.outlook.com: domain of nokia-bell-labs.com designates 131.228.6.101 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.6.101; helo=fr712usmtp1.zeu.alcatel-lucent.com; pr=C Received: from fr712usmtp1.zeu.alcatel-lucent.com (131.228.6.101) by DU2PEPF00028D03.mail.protection.outlook.com (10.167.242.187) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8137.17 via Frontend Transport; Tue, 5 Nov 2024 10:07:14 +0000 Received: from sarah.nbl.nsn-rdnet.net (sarah.nbl.nsn-rdnet.net [10.0.73.150]) by fr712usmtp1.zeu.alcatel-lucent.com (GMO) with ESMTP id 4A5A6o2j024723; Tue, 5 Nov 2024 10:07:12 GMT From: chia-yu.chang@nokia-bell-labs.com To: netdev@vger.kernel.org, dsahern@gmail.com, davem@davemloft.net, edumazet@google.com, dsahern@kernel.org, pabeni@redhat.com, joel.granados@kernel.org, kuba@kernel.org, andrew+netdev@lunn.ch, horms@kernel.org, pablo@netfilter.org, kadlec@netfilter.org, netfilter-devel@vger.kernel.org, coreteam@netfilter.org, ij@kernel.org, ncardwell@google.com, koen.de_schepper@nokia-bell-labs.com, g.white@CableLabs.com, ingemar.s.johansson@ericsson.com, mirja.kuehlewind@ericsson.com, cheshire@apple.com, rs.ietf@gmx.at, Jason_Livingood@comcast.com, vidhi_goel@apple.com Cc: Chia-Yu Chang Subject: [PATCH v5 net-next 09/13] gro: prevent ACE field corruption & better AccECN handling Date: Tue, 5 Nov 2024 11:06:43 +0100 Message-Id: <20241105100647.117346-10-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241105100647.117346-1-chia-yu.chang@nokia-bell-labs.com> References: <20241105100647.117346-1-chia-yu.chang@nokia-bell-labs.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DU2PEPF00028D03:EE_|AS8PR07MB7830:EE_ X-MS-Office365-Filtering-Correlation-Id: b3823e4e-3e52-47c0-36b1-08dcfd819f52 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|376014|7416014|36860700013|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?4pekJ8OAy9kmmubN+FaNz2DDhVNuG7B?= =?utf-8?q?ptmiZ2Y+J4lXuUMcr8l7LnlTpmo+Ps6PrVlkLbx0Oz+34oK40kW63rkVgCfAPpYyU?= =?utf-8?q?7UVPFtlFRJCfryuyHFSvu7+HNxzvCPZNFKLa7mEe/a+5m+VjzHIICMfYO930tpaHX?= =?utf-8?q?+EUxIIG1O9+eJQpEJRRWNvh3W+7WnP2OY2sXd2Rv3CHb4vLvPnlgzBPlg2zEwP6gF?= =?utf-8?q?5bLGdGltqKkdb+fO1QV/2O2yU7SzTtPPFT4bEUdN5hhZvhUxSpkgwHkvu4kIHBPwu?= =?utf-8?q?FAzN7PW59TEVo88PE+6i9zMvMcbPVlShe9YLOSUeLe82u4T5kvAa+YN6DvynEDHBU?= =?utf-8?q?V4PTVxLDrqponq22WBVysk4Kda0S/PWQC2jq6EaYctN+qJE1+I+j+g1+xcvJnjZAo?= =?utf-8?q?lTqirWh/4SKe8nREZmbki5OSU2xlqIwHDHXVttLxMrbC5UOk0a5fGfTeifIsnuQMW?= =?utf-8?q?qwV+K1xgw1PnW1/ITOrOeqPgHL+/rvDqEVbMr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z79D1EYIw5hNN9l0yI=3D?= X-Forefront-Antispam-Report: CIP:131.228.6.101;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr712usmtp1.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(1800799024)(376014)(7416014)(36860700013)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 05 Nov 2024 10:07:14.3622 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b3823e4e-3e52-47c0-36b1-08dcfd819f52 X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0;Ip=[131.228.6.101];Helo=[fr712usmtp1.zeu.alcatel-lucent.com] X-MS-Exchange-CrossTenant-AuthSource: DU2PEPF00028D03.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7830 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen There are important differences in how the CWR field behaves in RFC3168 and AccECN. With AccECN, CWR flag is part of the ACE counter and its changes are important so adjust the flags changed mask accordingly. Also, if CWR is there, set the Accurate ECN GSO flag to avoid corrupting CWR flag somewhere. Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang --- net/ipv4/tcp_offload.c | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c index 0b05f30e9e5f..f59762d88c38 100644 --- a/net/ipv4/tcp_offload.c +++ b/net/ipv4/tcp_offload.c @@ -329,7 +329,7 @@ struct sk_buff *tcp_gro_receive(struct list_head *head, struct sk_buff *skb, th2 = tcp_hdr(p); flush = (__force int)(flags & TCP_FLAG_CWR); flush |= (__force int)((flags ^ tcp_flag_word(th2)) & - ~(TCP_FLAG_CWR | TCP_FLAG_FIN | TCP_FLAG_PSH)); + ~(TCP_FLAG_FIN | TCP_FLAG_PSH)); flush |= (__force int)(th->ack_seq ^ th2->ack_seq); for (i = sizeof(*th); i < thlen; i += 4) flush |= *(u32 *)((u8 *)th + i) ^ @@ -405,7 +405,7 @@ void tcp_gro_complete(struct sk_buff *skb) shinfo->gso_segs = NAPI_GRO_CB(skb)->count; if (th->cwr) - shinfo->gso_type |= SKB_GSO_TCP_ECN; + shinfo->gso_type |= SKB_GSO_TCP_ACCECN; } EXPORT_SYMBOL(tcp_gro_complete);