From patchwork Fri Oct 18 02:20:46 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: 13840997 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2075.outbound.protection.outlook.com [40.107.21.75]) (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 4B07213D881 for ; Fri, 18 Oct 2024 02:22:12 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729218133; cv=fail; b=ly8JPCROds2XUd5MNm0q4r1orQV9GzhOfTsoUZiSHTFO2eeg5a4/3rsfi9gw3dFWHoKR8XO4dcDWU8MOxok0UCk0MmArTK7E71z5QrFf99yF1CDJ2sva2dJiyui9RBh4BMmiKicq9hf4IKE9fR8RrP1GgBv55ddOYXTOwKAjIdc= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729218133; 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=fgDG+OihaDEfa2OpopQzgigR62Ss8hAdTRNuC5ARd/9PHUfgLPa2JxfZT6BoqyjtqdRwNcJ2zfZhFw2s3aPggAy41me6I32GehrWLpmWBMu9YpNzHcSDpJb7x2TZTGD2WN/tWM4NAppb7G4LYS+zIyykUxy6u3XND5EkHHH7EjA= 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=AvT2p5vh; arc=fail smtp.client-ip=40.107.21.75 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="AvT2p5vh" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=M5A61Qer4lqsAr0TGCWaguBJLv4I1tdck8fYGMfP3r1VAyMyhLjXhAAI80PwfXYOJa7Hw/MLiSUoN9TvGP5qNAQ7DMYTyVKA45JoYqRSkz00I1S9AG7exX+wFOwzCnOB1RQPntO81EOBzwI2YUwEIo4YILZuSI/Zc5akuV66NzsxuZrLTNJrR7SBvNlsI54iyehX4CGdZVAm74WQn3wz6tc7ri7U7RKZ7Y6vMHgMMWnr3cyOhjoFOsafSTAD/i1lHe5IyrHcGk4iZe/B1SiTlPxGdFV+Cq9M/lMzycZ0EDAzhd/tagNK7VZlW4vgYyhHNh6fjae51OzUrb3EGH4/dg== 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=nAnin9+V1ME4pIfCKTGWSY6LVNMAQ1wxY86kyxHnnm9KgpUd7j3Jsj0sE27sOx6l2ftn+ovGfCLRJj4p8GzRFnq3HIsqBa0kYX4R0SFj8zDPoZRpZgC4lIGekaWIvyqwas7t1+Wd3pmlZDI2SY3Ig2bA7sNIRcWt4C7M/V73xxhfmQ+r+UMPWFguxWK+dIuLk4riWh59NwEy0xKioa8lzn4tW54DOEhmOno2gdHcKRC8Mqpg0GsNJzdNs0FdFupRoC1CwXpI4eJKO7OSxyiAODOOu+GJTJIkGIVlf/XD0SpJb7b7lGf6v3t0sWo1Ll12a8ESTzY1w3TT5mlQRoCPMQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 131.228.6.100) smtp.rcpttodomain=nokia-bell-labs.com smtp.mailfrom=nokia-bell-labs.com; dmarc=temperror 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=AvT2p5vhZZNgjWf3XgIaVWAxZMvyjwtu4mjLB5HoycOvLW9ePnNoLuPzonFolnz+TTSL6D65gCNjED4shxBlnZjT8mwQIJP9D15EPlZ1Q4cS9kE9qG2oleIUNdCqjgCC4rq+tMWIU3xO3CReb0+geWfXiZFMDPONeUAH+4lDnajUC5YjswDkF0BbJh2/FXPAyuH1C3L1BHZZt6ms5ZIcH46Unhe4GUu8fPS7Tg+SPP5QsuCyzz8muw2uoj0ipIzFjgb5gTLy+3xb9bw/u+C58rRX4/DnhpujAHww8HBfDGUpoe7oyshJBNwRSx2zsP3dDFAbaIZxmyV74LE1Kry1tA== Received: from AS9PR06CA0158.eurprd06.prod.outlook.com (2603:10a6:20b:45c::16) by VI1PR07MB9529.eurprd07.prod.outlook.com (2603:10a6:800:1c6::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.27; Fri, 18 Oct 2024 02:22:08 +0000 Received: from AM2PEPF0001C714.eurprd05.prod.outlook.com (2603:10a6:20b:45c:cafe::b6) by AS9PR06CA0158.outlook.office365.com (2603:10a6:20b:45c::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.20 via Frontend Transport; Fri, 18 Oct 2024 02:22:08 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 131.228.6.100) smtp.mailfrom=nokia-bell-labs.com; dkim=none (message not signed) header.d=none;dmarc=temperror action=none header.from=nokia-bell-labs.com; Received-SPF: TempError (protection.outlook.com: error in processing during lookup of nokia-bell-labs.com: DNS Timeout) Received: from fr711usmtp2.zeu.alcatel-lucent.com (131.228.6.100) by AM2PEPF0001C714.mail.protection.outlook.com (10.167.16.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Fri, 18 Oct 2024 02:22:06 +0000 Received: from sarah.nbl.nsn-rdnet.net (sarah.nbl.nsn-rdnet.net [10.0.73.150]) by fr711usmtp2.zeu.alcatel-lucent.com (GMO) with ESMTP id 49I2L0Md023685; Fri, 18 Oct 2024 02:22:04 GMT From: chia-yu.chang@nokia-bell-labs.com To: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, dsahern@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 09/14] gro: prevent ACE field corruption & better AccECN handling Date: Fri, 18 Oct 2024 04:20:46 +0200 Message-Id: <20241018022051.39966-10-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018022051.39966-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018022051.39966-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: AM2PEPF0001C714:EE_|VI1PR07MB9529:EE_ X-MS-Office365-Filtering-Correlation-Id: 19f3bd16-cd73-4993-367e-08dcef1ba936 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|36860700013|1800799024|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?03prWDWW3nwuoUN/ARRfcDXlRUkkw4s?= =?utf-8?q?BevyIVfEE2EIUZkPtesfDDGtMq0fXybrsG97guvqDhTperpTNgn1N9VjvA0gy7Nkb?= =?utf-8?q?uhR2J8MUOaNFL3SZkBFdmEfVzxOGzQXRhj3MQ0hEWUm1baTVp3WN2GtP1xbgGtUXP?= =?utf-8?q?vKCyc2ClI/Q+T4TdPpNQdzco/mxaBJUjRWG+ffsI+z9Cxgj8jEx70DW8oZchGltxR?= =?utf-8?q?zc2gXWgPxB8dNvr1347MTQonhqRqjmIBwJVxs+IPZstMOjJ8YcBbwvPcig2pUqtlU?= =?utf-8?q?3qAKSdqu6mHiua6YR52d6Q/YFUXGyNIOHX+BMZClqW7BJKCk/8to8Hk0zMQgXwtD+?= =?utf-8?q?bIsOEEofrnTvMq/Xji5gb7h6lUFOXSRFEWgTmbLgUeWyseWfNb0wCcDzyVgt3Wjw/?= =?utf-8?q?TCYqXNJcNjCO/dDS2h0b4SQu6C+Nu5zftYEtXS9Lc+XYCJXyweQU/eMRWPYmkmeci?= =?utf-8?q?Z7Uy1UW5hJby8lcBwmLMESF2CcqN9j0DRAPMrXD8l5aFTciurg2RQeY6/XYGoDkNa?= =?utf-8?q?ZBqcQIX1mVZxgOz+2ERmjgNW7772Ar1XPTL8zcuXZP6EIRI4NOhlAUWA0WTG9DxJk?= =?utf-8?q?KinWg65+k1F2CGGLn44iH9wq4512J+zx4APmd/Wy9El6ie96iuQzeaYqyIB6ugHeE?= =?utf-8?q?TBR+YMCCy6DKzYQqr6xrbDMNb2xHMwYX3MN8lPyEBIbb7xPQzwIlkpGt5eahbU5B9?= =?utf-8?q?Ny5MNw9poNMIyIxfWrJrFCosb81DXOYML4pA8TGlpYxnb13Efh6KbW+YV8yOuLfvX?= =?utf-8?q?jMpC7NaV5DhXLDRvGMkBMCtHqw+l19SEVmiOp5iXrUpV1YFjdu1MJebIjC3T4txxI?= =?utf-8?q?qMoyXTnt6fsJE4ieLzX3c4XJAaV32lRUT6G2GQ1pIaCdTCojD6Mu6eWc0g5K1b3pw?= =?utf-8?q?1VLrkygIXh3m4xTwm4sDdqfHx8469SRZKIfeS2aT7ZeLDtVKEMsAXN/zT7eIJ0I9U?= =?utf-8?q?v12UNtjUVnNXMoijvE5O/npcB69fqKOmzIzx29xXod2Cdd35RiJTlGqSWj3T2i8np?= =?utf-8?q?f0+mfj3wkMJuC81EJV5huorGNkMzY9HOjbRTC9c+QZXl3+7ZPmqNkkRrSVdx/EP8w?= =?utf-8?q?taxZBrN/F3dyGkLs7Ht22NeGyO0sLisB/4LxqXvxvUciMTdakLCgLl8HEGnwYxvId?= =?utf-8?q?iET1bW7jqhReUf6eLgcvj+LiHxxOn7NbGvIe7FWa2vuiBvwMguTPj2aVT2j032p/c?= =?utf-8?q?SgUz5lh5L8m2aBLVCgAafHUpu1/c5HMC+sX2fs1MxKoKvM8ABmew1pA2femqcAM/z?= =?utf-8?q?K3hrJ5DfLWRwTzTU7zXGZd2cXfkt9tl0nof7liICJn6d6pC3hk0yFHCcXFuCBB1+4?= =?utf-8?q?OHilRUqVpePhh7AwX2mjiY8b+6HD3bix+1L6PMtYJ82FGTp1yJbjXtA=3D?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(7416014)(36860700013)(1800799024)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 02:22:06.0731 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 19f3bd16-cd73-4993-367e-08dcef1ba936 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.100];Helo=[fr711usmtp2.zeu.alcatel-lucent.com] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C714.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB9529 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);