From patchwork Tue Mar 4 15:16:07 2025 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: 14000911 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2044.outbound.protection.outlook.com [40.107.241.44]) (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 71F99290BAB; Tue, 4 Mar 2025 15:16:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741101390; cv=fail; b=jsznK4BG8GXuhHx5vk1dCLy/ya18P7n4z6BoXMikKHwtvuOVZJg1IVx2t/Ex5PCnTDZ77xspQ7HOnzrn4LRZ+N7ToU5nYQSxxuJdzhbRQ793dX1kEHYfp9drF8JnNJIXS1Fv5XVIJ3Ttx8MZqIVZ9D4/N1eJURMlwLDQpOn264w= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1741101390; c=relaxed/simple; bh=3RdkqonsChfPG7hBRM7hh41Onpxs6JOlUNvjb73ogq4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=FShlyv3Gj7NnEblc1gXnmYuOsYdlcA7NJM1pcgWfgEyYh6x1z4QSjdB2XXmWMGahBOS6P0zm8yCyqZIk+xOUvs5Gb436y53j+EBioA3uQ5gGHP6rbbj9B7grZdz8ccgbXECsACZXA18zCop5aJJSuQmqmUg9LCLFXfCMBu+wRn4= 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=pSILdxQK; arc=fail smtp.client-ip=40.107.241.44 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="pSILdxQK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=nCBkfnoFdUno92ZoO/2pr9WSviUc56XigZ1jR5ka2lA5WLaA+L1d5Ls57gkDsDJFI4sIXmZqvQyowoDUXfbQfo5p3R2/r/lewKQdZ4dbwyDERF55pQMhcGeU/mA09sqk5KUUz3raumNFjlLzWp7REaeoytjM+7j0L1/iC9H33QYR2xdOubMnTnaKqgk5ZTSHo+Cq8wcrf8pbb57cpb6lNvrP9R2Dz/d93ZAhSXT9WmpzpOpYSH9geMqVbVgo7n234ST1nuijYYDcf8sTBeyR46cqD867enYXT2pMbepewYYtgIDEK/l5x5oqkDfkrGd72TqxLigGybpgByXo2aUtOg== 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=wKrlzno0YCh/lOjvTyktTr1XKxpY+DGvH39/XNQmcYc=; b=ROz9JaYFkGRTzaE1TzeKU8oIWdNNJHdQUS+cw9eEHG/FXnMD+I9Rlshd7LCqtH0Rzuk+afX4GgQWNtnC5+hTeHeDOT7SoCZoF7PY1zDt0fZUWvMisCJjC5jWcMRcF5Lsib5VCqa2ouFH4hrPl0qsiBVHD7rr7/wShoBsVGVl8gXSaZK2PniW+NV91TTPw8JT79IKExG3NUNCKfRd/mMxD58EOIR1KnmlsmHNGXQRxWpbtNF5YVMTwVoPqJkZuieltn3zzc4RcYbQlJmP45hWSPRpTFi5cgTiJYOqW3RNJz6JAom42zp/nnpr3u0EmiEwxTOh2OQFqULVEUsUsA4ONg== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 131.228.2.29) smtp.rcpttodomain=amazon.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=wKrlzno0YCh/lOjvTyktTr1XKxpY+DGvH39/XNQmcYc=; b=pSILdxQK8S7/xZrWOu0BU+wQ/3+KoTSOnnOFhSJUQgNi20gpXUoP8+55BNBTPvZ65ryBZ9MzEJ+tTbgOQxnuNR/EsmqYENNEwn80KYi52vWdfqnj6j8kJ9VqzYdaYNaMzSDcxK9t3TZJuPuo1fR5gGpoKnW/5mgJ+Is8FEvKUV25kRimQdIDk5413Uk8o2R8yIf2dpLIK2j/BHrfxITo1FY/vP75797y1amZ5r4VydLjkMszt6kcBwzdt+MqjlHVVmkLqGFS5gIwEr0DbwtY6voc0YT4Z4IqrQ7vCeCDg/DzTM50OI9qSxwhQNS4hx3CFLHy6VZeCgj8XageMcWz5A== Received: from AS4P195CA0038.EURP195.PROD.OUTLOOK.COM (2603:10a6:20b:65a::21) by VI1PR07MB6510.eurprd07.prod.outlook.com (2603:10a6:800:18a::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8489.23; Tue, 4 Mar 2025 15:16:24 +0000 Received: from AM3PEPF0000A79C.eurprd04.prod.outlook.com (2603:10a6:20b:65a:cafe::2) by AS4P195CA0038.outlook.office365.com (2603:10a6:20b:65a::21) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8489.28 via Frontend Transport; Tue, 4 Mar 2025 15:16:23 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 131.228.2.29) 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.2.29 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.2.29; helo=fihe3nok0735.emea.nsn-net.net; pr=C Received: from fihe3nok0735.emea.nsn-net.net (131.228.2.29) by AM3PEPF0000A79C.mail.protection.outlook.com (10.167.16.107) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8511.15 via Frontend Transport; Tue, 4 Mar 2025 15:16:23 +0000 Received: from sarah.nbl.nsn-rdnet.net (sarah.nbl.nsn-rdnet.net [10.0.73.150]) by fihe3nok0735.emea.nsn-net.net (Postfix) with ESMTP id E29FF24FD2; Tue, 4 Mar 2025 17:16:21 +0200 (EET) 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, kory.maincent@bootlin.com, bpf@vger.kernel.org, kuniyu@amazon.com, andrew@lunn.ch, 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 v7 net-next 09/12] gro: prevent ACE field corruption & better AccECN handling Date: Tue, 4 Mar 2025 16:16:07 +0100 Message-Id: <20250304151607.77950-10-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250304151607.77950-1-chia-yu.chang@nokia-bell-labs.com> References: <20250304151607.77950-1-chia-yu.chang@nokia-bell-labs.com> Precedence: bulk X-Mailing-List: bpf@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM3PEPF0000A79C:EE_|VI1PR07MB6510:EE_ X-MS-Office365-Filtering-Correlation-Id: b08c362e-7611-42e0-a09d-08dd5b2f8691 X-LD-Processed: 5d471751-9675-428d-917b-70f44f9630b0,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|82310400026|7416014|376014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?jQIWRDJNu4+caHTAj+p657BNQY5qudY?= =?utf-8?q?gWzC/RA/8/FCrvo7fT5gvxB8xfrvkCcdEox4DJeh5rQ6LRiVm9/Dsfc5FQ3IXoTNh?= =?utf-8?q?8SgsxSF3drIDVd3esNrYXYnZyliLSkMq9hdW69rFiNyVOaZqTaGc/KWCM7vBFWfzH?= =?utf-8?q?2Zx68mnyB/W2aY9G4T2oyuqfSAd626iVeXwqQiCvt/aE8yyT21aX2uvUkIVJR6gMB?= =?utf-8?q?sjAeLRaa5MapiAGKhT8egiU8ZGwi/K14YMSZ96wJSr0XtNymdaQnXEHdVB65SQg1i?= =?utf-8?q?s63sOsxD7ASk1aQoahxdaarBL+rt/cBEsbKTOr3P07PVSMaWdjXA9jB3jx1aUk577?= =?utf-8?q?MDMvngTYnVlYevaQNO4q9l7UojCs1cE0mivriM96FXkGTAddEwB0OG6jdD9N9aDtt?= =?utf-8?q?T+C0ZZZ/zEQXqeWpr/LhuEZ+5PP5UBvEcxLmaZxbrWxrdTeopNlGVcWhgcx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f-8?q?2cw2JpZLqePOd+Q3rS9A591Ng+EyW6N7BYc41Wn/G9NceZA2hAo3omN/cbeqelIJb?= =?utf-8?q?c0zbQiKBo2yhptbqGqcxLfYe5eWsJit58rMjd1LygkL6vEn8cwnk+Em/tmx2oJrgb?= =?utf-8?q?MZHALjEt0x?= X-Forefront-Antispam-Report: CIP:131.228.2.29;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fihe3nok0735.emea.nsn-net.net;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(36860700013)(82310400026)(7416014)(376014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 04 Mar 2025 15:16:23.4978 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b08c362e-7611-42e0-a09d-08dd5b2f8691 X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0;Ip=[131.228.2.29];Helo=[fihe3nok0735.emea.nsn-net.net] X-MS-Exchange-CrossTenant-AuthSource: AM3PEPF0000A79C.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB6510 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 a4cea85288ff..ef12aee5deb4 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);