From patchwork Fri Oct 18 23:20:12 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: 13842505 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2040.outbound.protection.outlook.com [40.107.103.40]) (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 356B71917C7 for ; Fri, 18 Oct 2024 23:20:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293641; cv=fail; b=e+GAWYoPeut5+vYHP+wc0aurYaTtiKQpkCAcVjCN9Q2KC/85jutwTr0S3gwaAh+Jxfkai6PDPbwEvL8ngMf0ovoz8IOshP5gElNcf7aAiHLTyC+D0xrMFE3iFT8pOQkWZ/GN5Ndwu64bxiV5dhxklGLlHix8GuncivLi500wyJQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293641; 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=hb9FH4aF+PLn3kSZr35RQa2pf8FldjxOoWeKcNOiAfqevHXVHnDbB4Z2kSAxxxa7lbjv9XDmHkv3bbzWScbBGiOE0elqG3W9TW/TYvG1HghkSSH20sNnWe+C3okA2dwQrMoXQ2C4PNNil4rRhlB3bvczf1klspnBWFx8Ot+GFys= 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=E9L3hGxk; arc=fail smtp.client-ip=40.107.103.40 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="E9L3hGxk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=u4rw7rFREmGJoAPC9mdThqyJKmCMZLmXH59cyUoVlh8V99ZwC/FAKdgBuX1iGuiXcZMoh/gFa/udOClYDy6TpwKJaaKJLqEAR/806qy4SZ9Q7L4mQrPqao4Iv9lEsWNo78nxccrj6KJetxNPqo0nLOHNccggBJbIMgVEvn3I2FNIalxxc1NZPQh4a8+w+ZMHzSDyOJ1qUhBwNsQc7OCyzWi+1DSORd5jciRyuExP/ZhmFdc3mc8xkts7bE/4pRPjHlInIWt/3ZH9qKkI6y19HwlOoezyvCjH3tRf5K5swJZZGhEKV7zn0ukaQWhWUL8e/RwQcR7fHIkubcohNYtfsg== 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=h4d21AdKXmVgjz5sxYmww6m1+FDTpJqMdbG9AqSI9HDyF72pHgcO5mYpzWEdWOHdqB9U3kJyY3jjJmME1aJ0LNQsneGWAt/fll0JZtj8+E6teSGjfDV4tN4jLnD69GuqnKMiDXRpzgMq6IC/5RjoPvqUTlAulLH9vvhTQlQJj9GemM7T6vzvr7w1b8f2F8CV7QaVBCNwPkDssW5+5hxWlbx0R3BnqOx7NjPNg/cNShnN6ZkaYrQzA+Urbq2ZogPUnYzZltOltF3Rw1OZWYrIDe5Y8iUe7E4e715NlE31c/R3X0Yscj9R1XPRhcvk7VisRr3qwLd1p4t4I8cKnOWIKA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 131.228.6.100) smtp.rcpttodomain=nokia-bell-labs.com smtp.mailfrom=nokia-bell-labs.com; dmarc=bestguesspass 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=E9L3hGxkXRMn3bYY/K6vL+huo8zFDJ55Ug7MHhyWK9XpaslYjLughIX4BBK/U2Z11ei91R+BmQ+XXrC0zA9KODcuceGBB8OMZfjZgY0dTdl0Ey+vCoFwcQML35LsgGXSSMsTgEfP47xdp7X2FUVcHhVZW5y2MLPxIPW7O8S9Vkd2nXZOsukX+vcz0kpapKFi4sqjann/a+uiAQmp07jFBrXnBJ/2OM9fxQ6PFGXjFadh6ukBI5gojPFNs4iAphQ+22wpuzj646B9mCpdjdjJb4HDsPncW0HTT+oMH6B9XJKqYgUn1NfCwNyyaGxgcJ79FNS9wy6tN2iVfQom5HKjMw== Received: from DUZPR01CA0340.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b8::13) by VI1PR07MB9421.eurprd07.prod.outlook.com (2603:10a6:800:1c0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.19; Fri, 18 Oct 2024 23:20:33 +0000 Received: from DU2PEPF0001E9C2.eurprd03.prod.outlook.com (2603:10a6:10:4b8:cafe::10) by DUZPR01CA0340.outlook.office365.com (2603:10a6:10:4b8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23 via Frontend Transport; Fri, 18 Oct 2024 23:20:33 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 131.228.6.100) smtp.mailfrom=nokia-bell-labs.com; dkim=none (message not signed) header.d=none;dmarc=bestguesspass action=none header.from=nokia-bell-labs.com; Received-SPF: Pass (protection.outlook.com: domain of nokia-bell-labs.com designates 131.228.6.100 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.6.100; helo=fr711usmtp2.zeu.alcatel-lucent.com; pr=C Received: from fr711usmtp2.zeu.alcatel-lucent.com (131.228.6.100) by DU2PEPF0001E9C2.mail.protection.outlook.com (10.167.8.71) 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 23:20:31 +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 49INKJJY010239; Fri, 18 Oct 2024 23:20:30 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 v3 net-next 09/14] gro: prevent ACE field corruption & better AccECN handling Date: Sat, 19 Oct 2024 01:20:12 +0200 Message-Id: <20241018232017.46833-10-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: DU2PEPF0001E9C2:EE_|VI1PR07MB9421:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b919d95-9b72-44b6-0547-08dcefcb760b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|36860700013|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?dEwkwQSxZCP7I7oTLWaJRjmh7+eZ3wE?= =?utf-8?q?u1mDObXiNMbJ8L5NQJVEhhTl+WmNje9ytxqORKYsgy4Hk9CvmMG9yzBRXli9zP2wp?= =?utf-8?q?M/qGe1ZPVK52G8GQcsNM6vjJ/OEWnmjq0LsGy0Fz2F4fgrX8FWqdd6oWI+yUslfcR?= =?utf-8?q?OUdGYJGqcHZZfwB8HBMW1a7pVuG89NTE/Yt8SvKJzOkwKR2DmrGjiU88Iyhm/pQwz?= =?utf-8?q?lwUiB/igDW5eL3pujhgkgRWdBp97dZq7nDahNxQYR1VwJmMna3+ObutmN/VSKZ+1U?= =?utf-8?q?ykc5gEt8rCG0F22KJVCkBbYh2B+Cy6eYjuSlfdS9YnQbRxrOvDQYOd+dc6sZI5pmR?= =?utf-8?q?kE23zFFC3uhYMpEOWZTGRT/Uwr2ZHEyhPkyXihGmB7zQnmkv20MXhex9DI5qX8VCQ?= =?utf-8?q?rpquDEVAslvF2W71Pt4ZrF7xhYzZDW6e403R+g388zgF+sin7MQLJMFH2SgjxYke8?= =?utf-8?q?0ztNh56IYh7e+DauajvgyDhNTMvrkmcGxGR9JaAzvlSg8kF9g59LK8TX29cM80Mbr?= =?utf-8?q?X0uwPlbS1hKUEnGN76XSDz9QyqIebeec5Cq01nQ6czbmxBr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PM;H:fr711usmtp2.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(36860700013)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 23:20:31.5882 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b919d95-9b72-44b6-0547-08dcefcb760b 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: DU2PEPF0001E9C2.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB9421 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);