From patchwork Tue Oct 15 10:29:06 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: 13836069 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2055.outbound.protection.outlook.com [40.107.105.55]) (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 8145C1E5717 for ; Tue, 15 Oct 2024 10:30:21 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728988223; cv=fail; b=KQDmgXXvubCa8mLVtAPP6TDtDb+cypM2Xq+EcS2d1JdM+V/TxUoKq0iKnwChDOzggYkhk3fSrkIMJo9m6tZ8TZ0L8s5RoIbnrymJxBIE7JFDuppcZZvFeI+rwIp9zcpqL5advV4aEkKm/opmh9b1835oeyXA2DW9uNSexrl+508= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728988223; 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=P79fHl1iIrQZOQ9S5ny5N/rkcM4facFgSrMN0sFNS0C93w9QW4fxUH91WqWXU1sylTWSeOyDNn23Sh5T7jheFYo3VDAgrqaIf3IkKuAYJQ7eY8sg/HNDxlaydtXVnQKL/64p4Byq4R8UYpdnnnZ8Tp7cbbXgIr6Um0f2TTgCHaA= 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=Qpdu1U03; arc=fail smtp.client-ip=40.107.105.55 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="Qpdu1U03" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=rfH7Pa+9l8wC8c4h0m5BLkc17z9w+XzkspnQUutYbpBS1o519YntzgiOj6J2fup4HRMGuztrvv1pu/rL+F1pypJ+FW9eRQIYpsCbynK6SfW+i0CZNcQr+s3pVwg37SgtSqUmWaSOqOjuxbLmlzUED0f5yh59yex5a0KisbQ5C52QKdGB7LjNycbVemg0whidEeItJ17VQNvAy6wgLmtcs5myXtTwB5jfMmu5k/LDAk1kJacI+td9fb4Pf4p3acjcEKBB3GKVAe8msx9cfy0MvG/jtfw04IplFRaLz2QQIZNnSpkCC1pAV14DW9aiJM9I5DEgK7NEPrqycU8pdEzWIg== 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=NNI0qboxQCmPv5HLrSlNFwHufy741TCAAFyMv5KpgVHx3nDvcSSAl2VdGFxYsmb0RCOqxIlo2jzCVfyk479FGA8CpL+rHkGZGymGJsFdlgFoXI5ORDVXoduhtLIXjAi38iMHhihcesQGcms+IHwIMNxm56tGFopLD4VrJu3uLwDs23mHj1mtUo4X9eIURiShuPzG6FC9TxienTfBPemhCZ7LuT5nY9yxIo3ylc83MKy/jPOL/47uY+g7iZfHU/vwSm4WORno3zcVZDXDLQGezqsCJSBBIBPQq/8bPjcWdf8y+jDMo7JFxpPCVfuf3hCBfIYnyXYsSOFOTxLpIZ0XQg== 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=Qpdu1U03EsVukVnVJHlx1wMfm+x62qvMVEhZPdYb2R2pYj4MYmn0H49K8rmSJg8ML6RSyZtmAcK60ooRGGW37JJLk/QdgagfrkXV3R7ftG0k9hA8xItasS8fMLtbiwhKhHu+vY9AkBvTqfq30syEkIaPn+zF8cRGvttGb1UfP/89gMshCWlso3vIljsG07cEU5ABC8z5Ds7gpT2HGadSDmWpdkL3zVyFLvSnGEt/Jtga6tQga+lL+jDKI6PZvsVMiiX47w3TaJjsmqnp3vCzf1MrfFoD0I3icvJyGJBUd+WL4fz9hCLbnsVazOr1VAIrdwKMl9BNDmTNfTIqAj+3cQ== Received: from DU7PR01CA0021.eurprd01.prod.exchangelabs.com (2603:10a6:10:50f::9) by AM8PR07MB7666.eurprd07.prod.outlook.com (2603:10a6:20b:240::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7982.27; Tue, 15 Oct 2024 10:30:18 +0000 Received: from DU2PEPF00028D09.eurprd03.prod.outlook.com (2603:10a6:10:50f:cafe::97) by DU7PR01CA0021.outlook.office365.com (2603:10a6:10:50f::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27 via Frontend Transport; Tue, 15 Oct 2024 10:30:18 +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 DU2PEPF00028D09.mail.protection.outlook.com (10.167.242.169) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Tue, 15 Oct 2024 10:30:18 +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 49FATtnE029578; Tue, 15 Oct 2024 10:30:17 GMT From: chia-yu.chang@nokia-bell-labs.com To: netdev@vger.kernel.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 net-next 10/44] gro: prevent ACE field corruption & better AccECN handling Date: Tue, 15 Oct 2024 12:29:06 +0200 Message-Id: <20241015102940.26157-11-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015102940.26157-1-chia-yu.chang@nokia-bell-labs.com> References: <20241015102940.26157-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: DU2PEPF00028D09:EE_|AM8PR07MB7666:EE_ X-MS-Office365-Filtering-Correlation-Id: 46f9ad40-b87f-46a7-05a9-08dced045da9 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|36860700013|376014|7416014|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?OBrSoxDbGH5eXgUCqTcSyjqTCKqFx0i?= =?utf-8?q?IAUYrs4LoNHNkr1fY+1jP4uFXw4uySfoUkL3fMDG+0nD8wydqpCNmmSKgJYN9rsH+?= =?utf-8?q?cu8x/JLgV4lT/zmlBIDmexfc5rPfa446lbin6P4utAE16zGT5nzAZH09SJgkjBjQX?= =?utf-8?q?70YfGvFxayPLg0bQRkvCkJa8O6TlenA+9R5C2zsJA1OY/deS++Hsj2CFPG3qRXrwA?= =?utf-8?q?9qPrApjMW6DrehxCx9vggk5+pIXlmBp2Oct7gvm+Mx1kqYdra5ij/9bZHqMmEoHJx?= =?utf-8?q?dy0MCHI+FDNXVGd7L+Y7yFO/erek6P2FxWWM+1y4YV19hkDp4xlLcJi7b2aoNKXzd?= =?utf-8?q?hxJ0Xklz+VyTbVlGPLs3cuDRkl3wTgQn7FzgivIHN96R7YKm8Zf3/lSuqkhduV+Pd?= =?utf-8?q?vTY1vHYoNJhkdSSSvotc9yYO8iVQHI1pvctVIubHdFfYHucMrhdRaJucPv8JPfLYv?= =?utf-8?q?lpkg1iKH5wSjiGaNWTi13iALP/zWCABFcYjt2np6g6ToOyyb3mRdnNG29cBj2cr+t?= =?utf-8?q?tfJEk1PrmZy5F4hFbPQUeyDJjy4ER/2YtupnT1fnzgbTz1PaAvHUUWUjeM4KN3Oqy?= =?utf-8?q?lXdNEfjNYQXBTH5LTuQdEa/Xu0Yti0k2YnrGxqN4YyZ4w4wQoU4Kjev0QW5sqhyDf?= =?utf-8?q?gYEwHjA5D7Ta0Bvjk2dbu7hGDLTutG7eizj/jcMW/EhfTE7XFf+zq181r0ukNNKmt?= =?utf-8?q?rkGNBpS/+Npq5UP7NXgUdf+CV4WDRJsElQzZcTeFT4+E/8dLWz1//ogotKpByvvQ0?= =?utf-8?q?YWbTzQt66kX61PNyjboVhVSOJkLclS7JlDyJ9FeRWEcRiPPqinDpi+k9lJ1cEZxkw?= =?utf-8?q?rsBU7iChVanYGD/u5/A+Wta9jiBQGtPEOcqU5sjNnMMHk3RE3/ndYatz3PIXTz8U1?= =?utf-8?q?fB065ZZgUud5PXQAu+lc4banzw3Afy59IJFbq4oWaJ2Tro/klAaHK+9R62OYr9Wp2?= =?utf-8?q?YGSQ9XcymBZZdPJhKN7CXmvt/prZINETt76+T1dDDIDNQ1g+52E166VGn0AGQjgU3?= =?utf-8?q?5NaqxHa1fSUUUT9XK1rZSopAaHzOduS231VVHv53CTosz17BkvUItbNSFyCstkqOU?= =?utf-8?q?K9k9NisQJZ8a1BpBagAFT5DVdv/VZikhQ8ey73l4gSvym/KsRXEg3i4Z8lABZoEfp?= =?utf-8?q?/gAPRPY0v3lbvK9J+3YO/KitwfmPFFitPefA498QNlNDefRs2ZtUi42Z30wx2P4Aq?= =?utf-8?q?CaCBH7IfnPx+CVyxtxGkfWy6Iw+ook6CKCqbZkQ9T+nCJgM5w4hMlhqs6NYw8PJkC?= =?utf-8?q?e8A2MQRLuzZY4lxYnUYW9D/aKGkjwVqAsxRP50HxfV8AeCNN/xGN9xleygRPDXfJw?= =?utf-8?q?16imJ7nUBbJA?= 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)(1800799024)(36860700013)(376014)(7416014)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 10:30:18.5059 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 46f9ad40-b87f-46a7-05a9-08dced045da9 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: DU2PEPF00028D09.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR07MB7666 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);