From patchwork Mon Oct 21 21:58:57 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: 13844709 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2087.outbound.protection.outlook.com [40.107.21.87]) (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 7C4951FE0F2; Mon, 21 Oct 2024 21:59:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.87 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547970; cv=fail; b=nHB2u+ID0YM+3N2nG7MbIxoIeramdnIYMyEThOjvKMQnKh1V/0sYeFV9UyX3adAeef5Ny0VkSeo6dNXO+Fuz14x5Hq/POc+e/IrHexFH7ts5RrQ3m5bl+FBT2C0oQg8TC0JVsiUpA2jdHrVBLO9DAOtm7Jxo3kU8FkEJYahzG0c= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547970; c=relaxed/simple; bh=iqP4Lrn2Z/fBm0RWoUJbIosaP4CJmoZQtGIJjWwHjO4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=BvDutqvQFdXOx7Kg4SItLPEHzwLgElj68aJSxBfxj3bRb3dwi/Hc4KhtROm8shIlGiR8YqFGmekT6xVaeeJ7UVTOm1MHUrMQ6OiMXmD2ZJws7X2Srbs4F9VSVPQxwaofsPrTPFQhW3DtZflwTNlu18/FuV1o8VjylBFvS15tef4= 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=F5+jz30F; arc=fail smtp.client-ip=40.107.21.87 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="F5+jz30F" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=faCRTco2xY5YLG2jqvm90V+RWUKCFLBkiFvnBiqhFlGegwqYfsJ/y0T3+tTIiTS5eqyqY6XJygRMIQDpxr0lDByYl/TIcNZz8qZcdfzLb0KEhHRh+FAQgy3zQ+bKuujdlWWR1wkNc4Ei3PW/8uakGrK2TYIxOMtIh+BgThZdTVZ5lth/0hQpQME1VXIllwox53jQOh2rHTxFihfC4d0M56yaC9lbzu7w1Dp1iN8lV4FtinOWJZsiQKNvlP8VB7uG3mID8PDbA1MKTgO4IgoKKVZk4KL2gGQ7PaNWMamAA09lC2LtyGJiVKh9QXpcMyf5f67bNc3cg5i9M3kLFAG3Hg== 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=Qap5KOTYkSn3sw5d0xLoait3kFngQIXe3o0O4mhxPZA=; b=FET7T0MHAFNENrb8ATCS8AhBIPaImRT8zxElQs2F2NxOaKGH+ZBI2eNVUOLDxCPwzsuiSoOt7t145M0GDKmcIho7zBWeG2bkth750q2ZO9qMxJuwFf5naYTIG2hxLr89xwLohr6sjc65slgvJklX85DFOHhfRu5oyGlX7tT6Q/UxLlf3r7Gkep1sjZwAJRHNrc6UhVPfBMpMceKAT83N9w+2lyGpKjqkdWUqxDdjrP/czKEgxotDpr3xkGhiZKfpbkDIQ+n0+ewcUji1qSZxkg4yhMHPOun49ruHwKHHibUvdmrtur0vk/KoSPM/KJeHhn4L989sNkl5L+iUBgQoqQ== 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=Qap5KOTYkSn3sw5d0xLoait3kFngQIXe3o0O4mhxPZA=; b=F5+jz30FD9Hjy0UOwHPmZHHXDIPCphm7Fl2E6+nnprL/OMKWp0GyYStslUSOCju162O77g2CurJZnRCqk40o9HivPksQSDDRf86rt3WfCOGRAI7UxuCOW8RXlgnJBgNrs0r2bE1Yp8CFIAkiHECWrS1sdVt1AMYCD3m1+K00yiRWsw5EbayW3RWwAvYj3feHC4yiy+99SAPwSEBoq4c/XSaqZsWqsYC1fWx3oCyWrOPwTKELWvQkHZil/waMvHOjROshSBisEeOZWA4eFHRz68sx9hmUPTVRH+ecVWgvfabtW+1wvzMGD0CYY4GW8ZTPo0PufqBHZhRNkPuAZ2MLbw== Received: from AM0PR03CA0080.eurprd03.prod.outlook.com (2603:10a6:208:69::21) by PAWPR07MB9324.eurprd07.prod.outlook.com (2603:10a6:102:2f2::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Mon, 21 Oct 2024 21:59:23 +0000 Received: from AM3PEPF00009BA2.eurprd04.prod.outlook.com (2603:10a6:208:69:cafe::4d) by AM0PR03CA0080.outlook.office365.com (2603:10a6:208:69::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Mon, 21 Oct 2024 21:59:23 +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 AM3PEPF00009BA2.mail.protection.outlook.com (10.167.16.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:59:23 +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 49LLxENI032273; Mon, 21 Oct 2024 21:59:21 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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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 v4 net-next 01/14] tcp: reorganize tcp_in_ack_event() and tcp_count_delivered() Date: Mon, 21 Oct 2024 23:58:57 +0200 Message-Id: <20241021215910.59767-2-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: AM3PEPF00009BA2:EE_|PAWPR07MB9324:EE_ X-MS-Office365-Filtering-Correlation-Id: 161c7a1f-a8a8-40c1-c263-08dcf21b9fa9 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?KW0/sMH7UtscrOzKLv3trRiGbsHdquq?= =?utf-8?q?KOvxxIVz1Js6cjIEyS5dTyB14ZuWOgSJ2+mXy/58BICeGoL9geP4KH9sdx47IG+Au?= =?utf-8?q?PBIW7oxYj9DQh8a3smEYS2DijPSD2SsKcfmeBM1st+KV60EFRD7U52M8bNrwTiCH9?= =?utf-8?q?1fm5Bc9wTgp9tDkWWZQHEdfn0+9Eye1hayawf1TfZq5Mq38za0QH/6I9j3lplan7a?= =?utf-8?q?nHNH5RGaJU1pE6AzpgkFS5iiqKNbSXJTA8HssOn7N9iP3RP4vKfrYlcISrqyjxyIL?= =?utf-8?q?WXJ7ApW5C7XC2Y/ZnC3nRstOUE5Zt3wzNL8yfsd+ETT9W08evh10d49hrz3KvLasV?= =?utf-8?q?MeoakEzm5fscGrMGF7+vnq77wDKQSHTunbM1y7ANR8D8Jb5Hg3YFTH6CJHx+Hrfe+?= =?utf-8?q?CfMgk/tMPCJYYQK5DRr8iin+5g2/s2ufvtvGILrAiWt+NSISmkGgPcmaPDAcABVGB?= =?utf-8?q?2RZ3l5pfS219XSxl2v3vI7r+NYLsO6UfYo7DKjmrP3ut+z8JOV5gG8JC4ij1zsGNv?= =?utf-8?q?D/bc98rTpQlaywF5u9LUmnwC0yHIMRe6f19UgnJksD7qycQJdiqa2EufVNpZP6wFO?= =?utf-8?q?4w8DUfd99o929elL2S22f78zd+dS/NZaDgrTN/6e4giuw5kWMugIxEOCT2Geixv/G?= =?utf-8?q?F4rgBRztlp8eqh2s6qcJqDgL2/ILmWWhiVjrpOqkYpPZM9XjOgAg54i5sORejy+iO?= =?utf-8?q?tlWRzahmm4q0QzsO08KOorxyFgdHTVA7wCDAJx5QXUoHXWqmYItdJdJWPKtrpInpO?= =?utf-8?q?LjE6+MZekaqzr/BfVQ2zPSQ1bCcXjukB/QWgdCZqeEyhdO3NXBlktclsy3gTMUnb9?= =?utf-8?q?BXZTEameJI87gbRl0gcfN4IcNh5jyvonQ/r4+kVePkc6l6O1dJk59SCdoItNBUIOU?= =?utf-8?q?+yHbPZTeefyfcg6pX0SnPerRjLerYAYoe7lmcy3IwEEx4wgjKkbGNKhyvCQRtiPRn?= =?utf-8?q?ckP8aWXbszrAvUVl8SVw50WC0OSOmrN/sgU98NppTT0PqCRj9+HO2DalVj6+uyuLV?= =?utf-8?q?p8a4JDbxuJwdF04n2HsPm4tzo6+hCJ1QjFWVT8UgbMAO1bnwctGh/ICqMBbsvTwou?= =?utf-8?q?RgpU+J4YI971O6Yn8uPEyXCSgY2mxnJ0MFdPZfQW6RE1IfXNVK6qX/WLtain/b7Gs?= =?utf-8?q?TuU/dg9eEmiis3BeljAiTGWx4Ah11x6MWG62VIHz/PMbV4v7spoWoVqjoAOEoC6se?= =?utf-8?q?ZqPExuUdOcPAa7JlE5LV1qohLj2guLLLvlsfy/Wq1wFHayz1KTrfwbRooBdAcpUFT?= =?utf-8?q?wWtl8pN4eVJJNnZkKaS5ptUkznnGGMiQgf77prrr8zYkDC7RYolLk1ggYovUJw4wp?= =?utf-8?q?s+Np+5ToG5uWFJAKxwHlKq07o3n/7MkDYAruiyO/uGWf7f1bIPjte4o=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)(376014)(7416014)(36860700013)(1800799024)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:23.5415 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 161c7a1f-a8a8-40c1-c263-08dcf21b9fa9 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: AM3PEPF00009BA2.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR07MB9324 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen - Move tcp_count_delivered() earlier and split tcp_count_delivered_ce() out of it - Move tcp_in_ack_event() later - While at it, remove the inline from tcp_in_ack_event() and let the compiler to decide Accurate ECN's heuristics does not know if there is going to be ACE field based CE counter increase or not until after rtx queue has been processed. Only then the number of ACKed bytes/pkts is available. As CE or not affects presence of FLAG_ECE, that information for tcp_in_ack_event is not yet available in the old location of the call to tcp_in_ack_event(). Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang --- net/ipv4/tcp_input.c | 56 +++++++++++++++++++++++++------------------- 1 file changed, 32 insertions(+), 24 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 2d844e1f867f..5a6f93148814 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -413,6 +413,20 @@ static bool tcp_ecn_rcv_ecn_echo(const struct tcp_sock *tp, const struct tcphdr return false; } +static void tcp_count_delivered_ce(struct tcp_sock *tp, u32 ecn_count) +{ + tp->delivered_ce += ecn_count; +} + +/* Updates the delivered and delivered_ce counts */ +static void tcp_count_delivered(struct tcp_sock *tp, u32 delivered, + bool ece_ack) +{ + tp->delivered += delivered; + if (ece_ack) + tcp_count_delivered_ce(tp, delivered); +} + /* Buffer size and advertised window tuning. * * 1. Tuning sk->sk_sndbuf, when connection enters established state. @@ -1148,15 +1162,6 @@ void tcp_mark_skb_lost(struct sock *sk, struct sk_buff *skb) } } -/* Updates the delivered and delivered_ce counts */ -static void tcp_count_delivered(struct tcp_sock *tp, u32 delivered, - bool ece_ack) -{ - tp->delivered += delivered; - if (ece_ack) - tp->delivered_ce += delivered; -} - /* This procedure tags the retransmission queue when SACKs arrive. * * We have three tag bits: SACKED(S), RETRANS(R) and LOST(L). @@ -3856,12 +3861,23 @@ static void tcp_process_tlp_ack(struct sock *sk, u32 ack, int flag) } } -static inline void tcp_in_ack_event(struct sock *sk, u32 flags) +static void tcp_in_ack_event(struct sock *sk, int flag) { const struct inet_connection_sock *icsk = inet_csk(sk); - if (icsk->icsk_ca_ops->in_ack_event) - icsk->icsk_ca_ops->in_ack_event(sk, flags); + if (icsk->icsk_ca_ops->in_ack_event) { + u32 ack_ev_flags = 0; + + if (flag & FLAG_WIN_UPDATE) + ack_ev_flags |= CA_ACK_WIN_UPDATE; + if (flag & FLAG_SLOWPATH) { + ack_ev_flags = CA_ACK_SLOWPATH; + if (flag & FLAG_ECE) + ack_ev_flags |= CA_ACK_ECE; + } + + icsk->icsk_ca_ops->in_ack_event(sk, ack_ev_flags); + } } /* Congestion control has updated the cwnd already. So if we're in @@ -3978,12 +3994,8 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) tcp_snd_una_update(tp, ack); flag |= FLAG_WIN_UPDATE; - tcp_in_ack_event(sk, CA_ACK_WIN_UPDATE); - NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPHPACKS); } else { - u32 ack_ev_flags = CA_ACK_SLOWPATH; - if (ack_seq != TCP_SKB_CB(skb)->end_seq) flag |= FLAG_DATA; else @@ -3995,19 +4007,12 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) flag |= tcp_sacktag_write_queue(sk, skb, prior_snd_una, &sack_state); - if (tcp_ecn_rcv_ecn_echo(tp, tcp_hdr(skb))) { + if (tcp_ecn_rcv_ecn_echo(tp, tcp_hdr(skb))) flag |= FLAG_ECE; - ack_ev_flags |= CA_ACK_ECE; - } if (sack_state.sack_delivered) tcp_count_delivered(tp, sack_state.sack_delivered, flag & FLAG_ECE); - - if (flag & FLAG_WIN_UPDATE) - ack_ev_flags |= CA_ACK_WIN_UPDATE; - - tcp_in_ack_event(sk, ack_ev_flags); } /* This is a deviation from RFC3168 since it states that: @@ -4034,6 +4039,8 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) tcp_rack_update_reo_wnd(sk, &rs); + tcp_in_ack_event(sk, flag); + if (tp->tlp_high_seq) tcp_process_tlp_ack(sk, ack, flag); @@ -4065,6 +4072,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) return 1; no_queue: + tcp_in_ack_event(sk, flag); /* If data was DSACKed, see if we can undo a cwnd reduction. */ if (flag & FLAG_DSACKING_ACK) { tcp_fastretrans_alert(sk, prior_snd_una, num_dupack, &flag, From patchwork Mon Oct 21 21:58:58 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: 13844710 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2060.outbound.protection.outlook.com [40.107.247.60]) (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 F07021FEFA6; Mon, 21 Oct 2024 21:59:28 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547970; cv=fail; b=utfEFO1drDNOH0XroBfvwdWwyGtxbmfroGi6AS+9xISU4lWe1D2p6F4Z51f5NyPhxZcWRUu4TKZ/+vZSY6WqPWbIWRybo+Df7+eGhjEA+YmODwr8Whfm+2UuYYZjspLHgcMTNnSPmweYKU4LCk9KiZovuR0S2J4kDhFAhdS5iPU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547970; c=relaxed/simple; bh=2l+0M08yMRIC83lTUd/86nAvpRigHplf/lP3QuzUlvk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=SKEHrlY377HEOn4KPiXjDBhMI41R1dlTNb+PzrjwiTTt+VuSzDQ5JVL8BH9cFHOQxxj9y41Za1j/+Oyaq4SZzi5nTxnMxSfUMiY5+8VVXcS9w3rXz/gUCUv3NOZdxhSZ10nHnqTmcfpcQO8Lz4tsewUyU4wIMOAsOQH2loRtUfY= 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=qGuxgolk; arc=fail smtp.client-ip=40.107.247.60 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="qGuxgolk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=MHG2Mq+zASJrjlUq5YGryhv5VaTygSzVb2JMgoUqC4ZHjnlYvCUTfRzRY2xulRbaFzMf45qbbkxiCUS3CJycobddBY2uVhLJFvid7V0nOL4pyNMyBS4vgA+1FZvYRWEv7PPGDz9yZJH43xMn1fBCexdYEnfmeLP1q33/OMBAVsSjTGMYMk6eQYbqFuvu4vTRV8+qGcS+bn/rpFl8ziT+RfQRZ477YvDXmElGm1o2QEUOL1jFSLcmFParxUCRqxtEWdE74geG6wAt7NLzPqdeZBxSoxeUXPH8yEtbiad2pxfo9b8lLtvsieOwlcQM4el0MMnNMjjvXyEJ5hzmw8hE+A== 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=GKTmCLaruA7YxU3//jgcaHnUAmhqvJ/CfHbis01G520=; b=cc4CMMzZqBqa0NWWchEszKKDJMWtM2iUcI9KFDgwpFM7QO3PG9h431AWSJlpgxsPrRM1VwsuLihhR4YB6KIe4f1I4PRMU1bdR3HBMRT38bETKtI2OkZ3ma0MYCQTu6QrVWhMOXiUObPkcGz3NmYRkYEXcwlHHIohRXxJADTOI7+gcYnPxL6Yk33W+WTEG8MM20qSc/+3WluD/QX3Gkreeb8Z4usO6MM8GZ8d4lMtNlHxoaPFtyqfxHaOITeYljxG/yjwgwCWQC1lhlKJwq0AdhLDH3vSNzEDoWhVrD21bqAMEm6pJXsf+PGsbr1tsfhSOYk9WR8qg+72VeU1utuZmg== 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=GKTmCLaruA7YxU3//jgcaHnUAmhqvJ/CfHbis01G520=; b=qGuxgolkuOuOSzlEaCkPcAf8Arwc2fu1IuLjMaMfO49jy43dLJFAfr0gtiXGI1mdVbOCMeSNwDwxPnik1sWhOcxnHNt8o4CFUIFoS0iHtHu9ETF97Wv6TKJzZ1qsSLaVPKi0tFmjRrzstMgMysHJhrqjo4BtjPQoOU40sF7gM7LIymOw7o4WH/ShhspoPwQ66xs66D2bs66cVP6rD6FBriWjsbHZFGeVwtnkSGOt6dBkGuNDkqSMl+wt/hv7bfNbDd4QdO/pXWCNPaRsFgC+RIjpqe/z3rIUFgF0rH7UvdEWk4xkrIvX9IcV0Hp9lMVQZAKew9nS9a/DIKnlSZAV0Q== Received: from AM0PR03CA0077.eurprd03.prod.outlook.com (2603:10a6:208:69::18) by GV1PR07MB10216.eurprd07.prod.outlook.com (2603:10a6:150:211::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Mon, 21 Oct 2024 21:59:25 +0000 Received: from AM3PEPF00009BA2.eurprd04.prod.outlook.com (2603:10a6:208:69:cafe::a0) by AM0PR03CA0077.outlook.office365.com (2603:10a6:208:69::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28 via Frontend Transport; Mon, 21 Oct 2024 21:59:24 +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 AM3PEPF00009BA2.mail.protection.outlook.com (10.167.16.27) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:59:24 +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 49LLxENJ032273; Mon, 21 Oct 2024 21:59:23 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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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 v4 net-next 02/14] tcp: create FLAG_TS_PROGRESS Date: Mon, 21 Oct 2024 23:58:58 +0200 Message-Id: <20241021215910.59767-3-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: AM3PEPF00009BA2:EE_|GV1PR07MB10216:EE_ X-MS-Office365-Filtering-Correlation-Id: 9bd114ee-465d-453e-e127-08dcf21ba06a X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|82310400026|1800799024|36860700013|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?hOPYi7S7mXxKO2yuSMguh3Ph/oDiG0r?= =?utf-8?q?DYQe/TMi03hO3Ob/ceyFyJzCz2eBphi9/pIRjhnn3bm0hMaMdeeweCAaBXOIEI+7I?= =?utf-8?q?UsknT1fBw2pYNseaIPg25569oftGtz7mzJSf1uZRarnndRR35NnjabfUI6GG2awdo?= =?utf-8?q?AsmfJauXfJVGeUcYM3U8ewU3ijMhpaETgFMkry33BSnyJLDjBEJWAl1lrtMG3EGfQ?= =?utf-8?q?RoikxUFrUQ7ZrOR+JeTB+ojCaOZienEpmRfHhBr5AnR71CfS/201ykdL5mURh5W6I?= =?utf-8?q?YwI2oJEH2nRobrE5pDmY1016xAc8F769Yxrpa12nWjoMbWBAcTJ36lZuq+8aS9PS2?= =?utf-8?q?uaTL6xCFgLgw40qsKTAk02vaAcAWPs+Atb0AcGFaokd3+7SLRI+JegSS+gFS18K32?= =?utf-8?q?x9L56rwGuDfb16QNXE414h3q+9UV3v8s5GN4xi9B5zxotP6pNWcGLAm27mnvL+JFe?= =?utf-8?q?xzSQJ/2sQrkFCTqjg0VslLjFiMl9hYZglP+xf3i3GwUUEx0X37rCwlRwnOJT8eeKO?= =?utf-8?q?4E0yEy0zGWjcbV8ql9Bk1YbSuUmgsDU5V+tcOdKbyPa/9pMtPyYgFiQfwz7173LAs?= =?utf-8?q?DyEogVJVe3mbQvnyrRJTrL9UC39oa0u9Vp+fGNh8CfZdDAy06ZZcLkq45gu928AXe?= =?utf-8?q?6hHjTfHneFOjwJ2E2fOaD6KKIc6Ng3gpz9rz4xDMbV4A9ql4THZ1qgB8YOj0D5idd?= =?utf-8?q?PR+1h+MT2QsTuMDQWxNtse16Xb1iO7Y1nGhp0J78jRxt2yebLaEtjTIoZfTQAzuAu?= =?utf-8?q?hqUx9/PYgL0ibEFQGf4QRlIYZ1ZBPwhU+e4SF4TOH0jMll8Ej3PkU0ZJX+R6YwAhe?= =?utf-8?q?YOHsqvGqIWUWkWxdxGzuQneNPH+eKgN9et9sEg7g+/0HLlGcEIKzHd+iV7jWY+0z8?= =?utf-8?q?gaPAxdu2HAfeRS+gyM1mEifxSFBLd/KEBkdUYJTjj0cYy5yQ22rs1hKTP7jh9JGLo?= =?utf-8?q?pwzukLVH0i5btmeRk2i4HvTZBB51EoPHSl2QVXiyVcAtsbWzc6Fy6Kd8JUUo9jG1p?= =?utf-8?q?2mnfoUG+mzOmALGv6qJ/Z1Ije+tSOowJXOzA/wIKalJhoplAqp7X6RquYxZ9+QOcn?= =?utf-8?q?H0vaun2/sgDrHXpcfkbc9/0ibg/Wxuk/rbQlAPtc22b4V5yhE0qCEiGHQ06BFDRea?= =?utf-8?q?gHxPKb3mwGIi89/8bll0lOUZmm5zDTzgxS8BDiyg97//bCJKBTTpvnDSRqhjL8TCl?= =?utf-8?q?1QcDuRxd1KluNSLgpAhQjIXgH/h4jtfHsegzTyU2mT7IqSdTLbHklMJ3oO5LqgxmY?= =?utf-8?q?qCCR8RTf09tMN0NV3NP/+bkQMXWCqbDTKx2nXJqvF3kUb/jRDc0vF0JwOU2/hV65A?= =?utf-8?q?OFmlfDzP8hAx5qfxku8nbcdiqRjnXCw2KA8Tr6bgKirDgHnapTWHiAk=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)(7416014)(376014)(82310400026)(1800799024)(36860700013)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:24.8071 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9bd114ee-465d-453e-e127-08dcf21ba06a 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: AM3PEPF00009BA2.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV1PR07MB10216 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen Whenever timestamp advances, it declares progress which can be used by the other parts of the stack to decide that the ACK is the most recent one seen so far. AccECN will use this flag when deciding whether to use the ACK to update AccECN state or not. Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang --- net/ipv4/tcp_input.c | 37 ++++++++++++++++++++++++++++--------- 1 file changed, 28 insertions(+), 9 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 5a6f93148814..3295ad329aef 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -102,6 +102,7 @@ int sysctl_tcp_max_orphans __read_mostly = NR_FILE; #define FLAG_NO_CHALLENGE_ACK 0x8000 /* do not call tcp_send_challenge_ack() */ #define FLAG_ACK_MAYBE_DELAYED 0x10000 /* Likely a delayed ACK */ #define FLAG_DSACK_TLP 0x20000 /* DSACK for tail loss probe */ +#define FLAG_TS_PROGRESS 0x40000 /* Positive timestamp delta */ #define FLAG_ACKED (FLAG_DATA_ACKED|FLAG_SYN_ACKED) #define FLAG_NOT_DUP (FLAG_DATA|FLAG_WIN_UPDATE|FLAG_ACKED) @@ -3813,8 +3814,16 @@ static void tcp_store_ts_recent(struct tcp_sock *tp) tp->rx_opt.ts_recent_stamp = ktime_get_seconds(); } -static void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq) +static int __tcp_replace_ts_recent(struct tcp_sock *tp, s32 tstamp_delta) { + tcp_store_ts_recent(tp); + return tstamp_delta > 0 ? FLAG_TS_PROGRESS : 0; +} + +static int tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq) +{ + s32 delta; + if (tp->rx_opt.saw_tstamp && !after(seq, tp->rcv_wup)) { /* PAWS bug workaround wrt. ACK frames, the PAWS discard * extra check below makes sure this can only happen @@ -3823,9 +3832,13 @@ static void tcp_replace_ts_recent(struct tcp_sock *tp, u32 seq) * Not only, also it occurs for expired timestamps. */ - if (tcp_paws_check(&tp->rx_opt, 0)) - tcp_store_ts_recent(tp); + if (tcp_paws_check(&tp->rx_opt, 0)) { + delta = tp->rx_opt.rcv_tsval - tp->rx_opt.ts_recent; + return __tcp_replace_ts_recent(tp, delta); + } } + + return 0; } /* This routine deals with acks during a TLP episode and ends an episode by @@ -3982,7 +3995,7 @@ static int tcp_ack(struct sock *sk, const struct sk_buff *skb, int flag) * is in window. */ if (flag & FLAG_UPDATE_TS_RECENT) - tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); + flag |= tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq); if ((flag & (FLAG_SLOWPATH | FLAG_SND_UNA_ADVANCED)) == FLAG_SND_UNA_ADVANCED) { @@ -6140,6 +6153,8 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) TCP_SKB_CB(skb)->seq == tp->rcv_nxt && !after(TCP_SKB_CB(skb)->ack_seq, tp->snd_nxt)) { int tcp_header_len = tp->tcp_header_len; + s32 tstamp_delta = 0; + int flag = 0; /* Timestamp header prediction: tcp_header_len * is automatically equal to th->doff*4 due to pred_flags @@ -6152,8 +6167,10 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) if (!tcp_parse_aligned_timestamp(tp, th)) goto slow_path; + tstamp_delta = tp->rx_opt.rcv_tsval - + tp->rx_opt.ts_recent; /* If PAWS failed, check it more carefully in slow path */ - if ((s32)(tp->rx_opt.rcv_tsval - tp->rx_opt.ts_recent) < 0) + if (tstamp_delta < 0) goto slow_path; /* DO NOT update ts_recent here, if checksum fails @@ -6173,12 +6190,13 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) if (tcp_header_len == (sizeof(struct tcphdr) + TCPOLEN_TSTAMP_ALIGNED) && tp->rcv_nxt == tp->rcv_wup) - tcp_store_ts_recent(tp); + flag |= __tcp_replace_ts_recent(tp, + tstamp_delta); /* We know that such packets are checksummed * on entry. */ - tcp_ack(sk, skb, 0); + tcp_ack(sk, skb, flag); __kfree_skb(skb); tcp_data_snd_check(sk); /* When receiving pure ack in fast path, update @@ -6209,7 +6227,8 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) if (tcp_header_len == (sizeof(struct tcphdr) + TCPOLEN_TSTAMP_ALIGNED) && tp->rcv_nxt == tp->rcv_wup) - tcp_store_ts_recent(tp); + flag |= __tcp_replace_ts_recent(tp, + tstamp_delta); tcp_rcv_rtt_measure_ts(sk, skb); @@ -6224,7 +6243,7 @@ void tcp_rcv_established(struct sock *sk, struct sk_buff *skb) if (TCP_SKB_CB(skb)->ack_seq != tp->snd_una) { /* Well, only one small jumplet in fast path... */ - tcp_ack(sk, skb, FLAG_DATA); + tcp_ack(sk, skb, flag | FLAG_DATA); tcp_data_snd_check(sk); if (!inet_csk_ack_scheduled(sk)) goto no_ack; From patchwork Mon Oct 21 21:58:59 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: 13844711 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2078.outbound.protection.outlook.com [40.107.249.78]) (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 E711E1FEFC6; Mon, 21 Oct 2024 21:59:30 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547973; cv=fail; b=MZkZeZCMgcEvJlKPxe21er4wJ0mO2f+uxM2jE72M+7t30ITJSMr5whryFKkjB2790ojgDiznD1uRHMvU0I5koqDyRwvlEBuNF2bjYuL8KOUMJbLJewgEP6N6QAA0CC9IGWi1V2L/58A5G4F1znNag17NbGhbJjGLEuqA5Vl6JSs= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547973; c=relaxed/simple; bh=VWfBnNyWjEH3XDaLA3UuMW35easf2rQkez0Pfq+GLhw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=kdpUNcbrkgucokUAotAM3s1OAN8N2OReOmLxVYzMwUkC48lv1skRz7M9l5UiPIobdw3UTRpVelxnlufbvypCCK8jBPT1c5iCDYcUeCKQ59AD12ektYgZSZWNdfLDdW7GIwmZ42br00dtjWAEYh1wtxKhd0ZUHzLLVuY9iD2D8zM= 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=cK8hMJwK; arc=fail smtp.client-ip=40.107.249.78 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="cK8hMJwK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=TFUFdRIwPg4wOBjCRfbADx3oU3Dq3XxHMtRiiPW9ACsZrg2bdfCZcmcm4VJ/tzihi1mZ4WKYekBb9g3eGtcrkq3I85C3+g1T6y295iYYZDMKZep1T6105YIbT/TWQAuJ/IlmDNzVvkt5PTvU89kVXCN5+iNk2ZTjf38gQypl1d+iJ+Xno1bOJALu8u7H34imhwfiyAvLGKBhCc9UlYTo4+IWl5Ri8Vquzs6ZX7T3mSbdkiA6dx3XR8bPpF2GT6ZVGpkOsgh00jZ9L4CzuksZfSz5BHS0goCkM8r4tzubl0KF8F6e2XM5NeHE/UrmEY8ImWv0DlywaADnBr2pzKT+Nw== 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=MMx3u4H44x+CVsqgJMWoc4rn9lSzlzPywoG4I9GWyRA=; b=vTFn873jKjqv6erkyJIG0cVQfjlti9i/qhWrGD8No1Npn57SFQln9CcD1rFB74Zda5R/J+QZPIzJnj7+kz2aHdwVJBOTk1fntFqZHkfkVZ8+qCCQO3AQj0FdXkXkiJm6mLf41NXWLEiWmseFQf0ZJ3wYFm8fdiS8jvhtb3GorbrrYDlc9eLXeXXzrzN+dqVw1oho9Vj2I+W3Yrlzw9EcAAoaPfXftLQq+lhfR9R9vmCekww97e3W5lhCASE7Iv2K33u2aQnDmd+/ASkuVrnodwP79uOiH1vJq5LATC7aofv1n9Z5RlyPDN9SzT5m6tOkt36ybvnhDgou5xa6TIUoRQ== 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=MMx3u4H44x+CVsqgJMWoc4rn9lSzlzPywoG4I9GWyRA=; b=cK8hMJwKyV/wx4gTHVmITINRLtbOx3KDn+G79Mi6PvQKxTZjZjEo7B2YSV/CgFdDS3sphSmde+f2hnK6N6XsXwgaVpJvYXANxaTimjdhKD89Yg0X5hfl8IN1kE6qWaV0FRd2DLE41ihWujWi25iOtLawhE3ir6lPh4nvFKbsJA0e4Buv4JfoeZBmjwj6Ro9diqN7KAgzbikK4R+HauU301UTFEK+ctdzko58VX7uKbHU9TgoyCgSubwq9uJwwjnp8dmYTRAPxqwmOzaRgqlrEtAJ/qRRmnPoJt/3zs2k20Gx4jZd9NXLjyE8PSVthKNbkCvkEeyXkp1P5Ib9Jbe+bw== Received: from AS4P190CA0022.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:5d0::14) by AS2PR07MB9207.eurprd07.prod.outlook.com (2603:10a6:20b:5e9::16) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Mon, 21 Oct 2024 21:59:26 +0000 Received: from AMS0EPF000001AE.eurprd05.prod.outlook.com (2603:10a6:20b:5d0:cafe::6a) by AS4P190CA0022.outlook.office365.com (2603:10a6:20b:5d0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28 via Frontend Transport; Mon, 21 Oct 2024 21:59:26 +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 AMS0EPF000001AE.mail.protection.outlook.com (10.167.16.154) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:59:26 +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 49LLxENK032273; Mon, 21 Oct 2024 21:59:24 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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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 v4 net-next 03/14] tcp: use BIT() macro in include/net/tcp.h Date: Mon, 21 Oct 2024 23:58:59 +0200 Message-Id: <20241021215910.59767-4-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: AMS0EPF000001AE:EE_|AS2PR07MB9207:EE_ X-MS-Office365-Filtering-Correlation-Id: 2861ee8b-38ff-4dcd-d262-08dcf21ba125 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|7416014|82310400026|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?oQrUXrQlZAGOUt5dBVSuLKxI2CqQ0Xl?= =?utf-8?q?LqnhPZ5kCTw9dy1lMar30LfW77oQBpmrd1QgWYSdbfpoQwseT0Fv00Ljjgn8U/sXN?= =?utf-8?q?g3bGsIBP31iQkvu/Q7gLKFEBXRKrUfIbnadMJkrEhWc41NQ9mes8c5XYd47l8JXPp?= =?utf-8?q?Kc5X0y+kOoMJjTvVtltr3IAGUB4zdsClZhPWC3ya7p1ErS/k1masdOZOsnI9C3B2A?= =?utf-8?q?tvGVjyuAzXbf7OY4FllCypQ0GMbfT0tkjbcJ/wkGw9+Bg7YlznLuipweVZoqYUB/B?= =?utf-8?q?da5bItM9lMSVFxE0z4RjiIUhYQTxq8CU79AufuVnSbnGSSCgKW6Wq4dz3ScNhxJz1?= =?utf-8?q?3ijTd4GvRhZ1900LzrVzfhvTv8fr/fp/2QmeYVcuzTnAEhKkV+8JUeAZ7vt1NEqDJ?= =?utf-8?q?BvgufgkvjddVw+NF+6V/kdLbgxvzepdK4Tn1524AQBxajisocfNG3MCv7zPjH3tBy?= =?utf-8?q?/ERP6o9YGDS2nZXmta2396o/RJ/wEed9GjdNqQmDm5oGoPGHV0rKAD6fyq/+dNCWZ?= =?utf-8?q?YNeRdYWG0k5oxeNd/D+BPeHGypwNy7U0lzVsGZLfKjwM9yaztn7c68VIsLORyDsHf?= =?utf-8?q?8TmYfqyUUSnAknWXq8Tze+fy44j7Q5U/eWu77hYpfp55sVj2ovuFo+UX5VsgGMni7?= =?utf-8?q?eASzkQyuMYuNAQRTK7qGEfe7mqU2PToKLC8czITzglkqdIs2T9Pg/edN9/cM3V5Tr?= =?utf-8?q?3fnS8oSXaMIZ/hOaZ/aiKaRUFKPfEPE57X86Ii0hggyI1fPmbLvbQPkPnc5MsVapJ?= =?utf-8?q?qlCrEBrq9wF2qC2d7eqleu6WjKEqlhmtVfUO/tnbhK3PWEmAlv15t5IA/HtoB535C?= =?utf-8?q?il7ZSgPj5LRcH7Dyb5GXOydQF/GRP0faFTu5YBcfq3W5Q/u/XzhuJeqCIHgC6WJAo?= =?utf-8?q?rVKkseKlf7jnRRs+s3QaJp+KtwqIWbM5Ivrzy7WeWrnqAdOYETM7hWvNQg+t7vhD2?= =?utf-8?q?25Js1EJk04c6Wi5tasciYRVVRQHCgKVSUNIwha/4V91pMCgQhz+P/zlmKN8y5tVSI?= =?utf-8?q?Z2wlZyDoJF3M3CLG2lWgoOFAI2fmyWbMS5bIPUVN+SzXdb3l3DNILeC0+2fgQZn5V?= =?utf-8?q?NbuF+nABK75+ohmHuVX/NKb7hLKbcOlDavmP6KOy9hkES955G2ykgCGta/aoaul3c?= =?utf-8?q?r3QA+pV9nw+GRwrB/HuNvzcvZFi9E0eney2gJe8D7uXMUqzRZsvJmhWb6f7PHL+JY?= =?utf-8?q?/HFZQ3BkJMx5mVHiVXc2FRV2iOI0PYKi8xVKiF7uXjtLeuvPVibp2qyYknDW4kTQA?= =?utf-8?q?SNA8+DHU5iFRPZa0TVqzbtFX4CA6xIXSd7Srm2PMxyWm15TPI7+YcpHcY3hMexo9A?= =?utf-8?q?gkRjIU4pl+Jt55CXF2oExSMU+lmUmJRAEQ5xl20Hj6WeXPjgbOvU3ZA=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)(36860700013)(376014)(7416014)(82310400026)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:26.0166 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2861ee8b-38ff-4dcd-d262-08dcf21ba125 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: AMS0EPF000001AE.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS2PR07MB9207 X-Patchwork-Delegate: kuba@kernel.org From: Chia-Yu Chang Use BIT() macro for TCP flags field and TCP congestion control flags that will be used by the congestion control algorithm. No functional changes. Signed-off-by: Chia-Yu Chang Reviewed-by: Ilpo Järvinen --- include/net/tcp.h | 21 +++++++++++---------- 1 file changed, 11 insertions(+), 10 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index 739a9fb83d0c..bc34b450929c 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -26,6 +26,7 @@ #include #include #include +#include #include #include @@ -911,14 +912,14 @@ static inline u32 tcp_rsk_tsval(const struct tcp_request_sock *treq) #define tcp_flag_byte(th) (((u_int8_t *)th)[13]) -#define TCPHDR_FIN 0x01 -#define TCPHDR_SYN 0x02 -#define TCPHDR_RST 0x04 -#define TCPHDR_PSH 0x08 -#define TCPHDR_ACK 0x10 -#define TCPHDR_URG 0x20 -#define TCPHDR_ECE 0x40 -#define TCPHDR_CWR 0x80 +#define TCPHDR_FIN BIT(0) +#define TCPHDR_SYN BIT(1) +#define TCPHDR_RST BIT(2) +#define TCPHDR_PSH BIT(3) +#define TCPHDR_ACK BIT(4) +#define TCPHDR_URG BIT(5) +#define TCPHDR_ECE BIT(6) +#define TCPHDR_CWR BIT(7) #define TCPHDR_SYN_ECN (TCPHDR_SYN | TCPHDR_ECE | TCPHDR_CWR) @@ -1107,9 +1108,9 @@ enum tcp_ca_ack_event_flags { #define TCP_CA_UNSPEC 0 /* Algorithm can be set on socket without CAP_NET_ADMIN privileges */ -#define TCP_CONG_NON_RESTRICTED 0x1 +#define TCP_CONG_NON_RESTRICTED BIT(0) /* Requires ECN/ECT set on all packets */ -#define TCP_CONG_NEEDS_ECN 0x2 +#define TCP_CONG_NEEDS_ECN BIT(1) #define TCP_CONG_MASK (TCP_CONG_NON_RESTRICTED | TCP_CONG_NEEDS_ECN) union tcp_cc_info; From patchwork Mon Oct 21 21:59:00 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: 13844713 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2046.outbound.protection.outlook.com [40.107.22.46]) (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 52B4F1FF05A; Mon, 21 Oct 2024 21:59:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547975; cv=fail; b=UWyaAWAfPhzVGP02kgA9qKFOH2jQaHrZ2fBY1cqvVKtpnjJrzpPoMuOOqevyGy9nm3EsnBjWPwqu2p3Pgbk2uRs6gWGPHZ6VquY2ziNXTZtAWa8QeISp0OssShx7DOJsMyJaOzpR65cJ99+4RDS4wEo4CoFmrfnDHjHuSmFq5DM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547975; c=relaxed/simple; bh=2t+5N638urHzd2mITJuqBgr0vLodMfkStFo2Z29puv4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=bdsAsPAFf2DBNXT1CrJdAJUgY8VyiJVjxsLKNJg1GoyjFJRQx2Cv0V+mZ1AEWUNoHVNgCfbiK0JFa0LNqNdI7PcvNyTJdS22w4SkgaYm8f1oj8ALywC/vilHsNH7D0PmEY5Y0jsHvGHR5IjmoTFSL+4zaxguCoS/Oq8Dvw4WI0A= 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=pFLTO40o; arc=fail smtp.client-ip=40.107.22.46 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="pFLTO40o" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PglEc6e96Bt3bgDJwI3sLYw68WozJ179JZPw6Erghf37xqMvHbZX+AJXLFziVby3Y8bdGwg3zKCW8oWR3G2rEorHl/gxo3+Q/kvGirlGNu36rZFFS8A67N4rcEBcV5BA0hkco0/YRL1JyMWFdoJ6AlYDGcnoNdKZll2lWLa9WJHuS3NnIbDq+Zv1W/LZAiCKr0xSqcFdrLExI2ZcUNO/w0OWt1EnIwj5f7IXmn358lk6ISq7VNH8NfrxOIjK69R+deP0bC49gvIGs3NdT1sJ+/NQVk6L9PlTo79CaKEKD00Erq+IiBbNRLF9+wcz8dG7wHXcuED+mhcjoukNmlVe7g== 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=s2xhPcQlS+ABToD5tbnfVaU6cD2DcEEZ0wnz+k3lwd4=; b=qUAVnG4P4b3l01NeoFwW+Yq3+NGYEuOdFJpx7Doe7dYs36fvBj4JE57H5uTOKiZNvGZDbz0+LSJm97tnvlGmYKHxT9sFg5iX0G0qELF+r1Yx/hjgCSIGogYa4gANTBzia88lGDAaJs+2OIBlwlNvInHjxauB3uU5+us5nbdp6nbhRW5HP5YJVe2WIzQr50PYnU89Jsdz72SWZ4+SQ68QuO0KMDWDz7uvUpzU206hum+UUjbOxY/EwKrYxRzLUs01q2ofpp+FMfxkmzDNqIvR4Zm2HTVeROmcV1YV3MPt4TZP2tWpa7bqNJ/92Gze1Ry6vUDGsW2cfQuQMo+2zMzBUQ== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 131.228.6.101) 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=s2xhPcQlS+ABToD5tbnfVaU6cD2DcEEZ0wnz+k3lwd4=; b=pFLTO40oSHSN60y3I1j2NVkTA26BLXoF/yeauSgYJyG8yjvDM7I4LRAsC/o4HrZV7B59L+XiseuFCC5073rF5Nz9FcZxx1QEuHV/5wgIbr/ZfaPIWX16ews67F1FSRxkgKteHyh42qebd3UX+Bjddakpk21RMjmoxdMGGnHuXctculCVcaGAhgLK1zEy3grKIo+OHki8qTnG+juiuqsZ5jcqqmtqUqJ9GoVryaeocsa64ok1R4bqSOcpJeoKodst1DIHU7XJBqSC5inezHpSQP2cgGeetWGFEchx25Bn9/nlMLu9uOxfGyc9Np/noF93jfnMfHsH4G81joDbJoDmWw== Received: from PR2P264CA0029.FRAP264.PROD.OUTLOOK.COM (2603:10a6:101:1::17) by PAWPR07MB9509.eurprd07.prod.outlook.com (2603:10a6:102:359::5) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.27; Mon, 21 Oct 2024 21:59:29 +0000 Received: from AM4PEPF00025F98.EURPRD83.prod.outlook.com (2603:10a6:101:1:cafe::ff) by PR2P264CA0029.outlook.office365.com (2603:10a6:101:1::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28 via Frontend Transport; Mon, 21 Oct 2024 21:59:29 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 131.228.6.101) 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 fr712usmtp1.zeu.alcatel-lucent.com (131.228.6.101) by AM4PEPF00025F98.mail.protection.outlook.com (10.167.16.7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.2 via Frontend Transport; Mon, 21 Oct 2024 21:59:27 +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 49LLxENL032273; Mon, 21 Oct 2024 21:59:25 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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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 v4 net-next 04/14] tcp: extend TCP flags to allow AE bit/ACE field Date: Mon, 21 Oct 2024 23:59:00 +0200 Message-Id: <20241021215910.59767-5-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: AM4PEPF00025F98:EE_|PAWPR07MB9509:EE_ X-MS-Office365-Filtering-Correlation-Id: 33a835c1-2ae4-4e5c-d3f5-08dcf21ba1f6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|36860700013|7416014|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Dd1y+95EWmlaJf96rbUsrD4j77c6T70?= =?utf-8?q?ZplJwDMg2PFwgXvz5meHYsNkky6Xs9VDCzDhz3nKIEhNEG+FVxRRTCcehmyG1C03D?= =?utf-8?q?dw1sUzkUT/GZfnsrpshOWhKSBHExRbc5CiMTdSfFf6c/QynE4b0YvJNN8Y0M2zhfi?= =?utf-8?q?+2Q8leYsE3vUmwhg0C4V1sxAjjdK8j0/yZfDgT0+QwHEOkvRnzuUdI2M4wPb5hBEQ?= =?utf-8?q?m4fpIPWhCeziQyZyw64/IUM7h8dc1ZaZTcn0gFvOeJ8c5QV4rFSOn82SXVNhlafsO?= =?utf-8?q?2h56jREK0rdQnVbX5PYA7D5nZ39tXfH0DXoavuSCIGLaiKnabIRxbVdF0EYnyCMUB?= =?utf-8?q?mkO1t3bfodhtCBvTTwUic6nShZLsYoOc9sqJIXaxAKFXZKSRd+OGRMDCxR6ppjn4x?= =?utf-8?q?KShZOGAzOOpE5r/L9VAH3rZwklOyf4E4McDEPPdVmsWOyeukdd4fJ2uPL8xQm7S64?= =?utf-8?q?7RcyqY5U5tZiEm3giQJ2TIQzubhGur2gls/qPOX0HgliM3VKDfOeleDClIHUlElUU?= =?utf-8?q?T2JIKyjDROeaaLb5/BEK6PyL3MzM2VHOFTyO4iEXNpjhfaTvagRRaH1WFMw9v+qd2?= =?utf-8?q?iOMb0z3tYcJNx51RWP0oz2jQi8kK4EwmHjbgs65UeoiusaGFy/ZH2SdjVyHjx3pU7?= =?utf-8?q?H307VevXcZ+z6EUp2J5L53kpd3HiPUItJxtGzESTlSTK5Mh8xiHs9qjEn+06QCEmy?= =?utf-8?q?fCwHcsbZxhe1Mk5+2F0TTVk7Dzu/TDlYMpDLYn90AyUHHV/fRCe2FtTmiew7lDohL?= =?utf-8?q?gbcC4NuA0RZjtlorHnQcFdr34K8IskyJnfEP8CaGXRyEXmZF7amzJspDA5+Po0aXX?= =?utf-8?q?wJ0rMR9rXQpxKUTghTQnK6o3awYUU7cg3W58b8b94nhX4kJseGkNGqqwUGyt4YnKi?= =?utf-8?q?f9pXkOSEhOiBYIxzseeuBK1LA6puSbOLsT+qiLw7cS08A4IuJ6Sny2PEa7Gw3pVpj?= =?utf-8?q?S8WO1ctOnOeVG0BHL3TtVAUbWIk2PJ30CDZ5CjhNuPPHzuUuvT4qPeX8jtPbFQpdF?= =?utf-8?q?E6dWQkBF37PMowvY7Nz1PoJNh/Pge78zDEBiOfUyPNDZTfBHG1FulGqq86z6g0ZB4?= =?utf-8?q?kdviSYL/fP+SI3aJ3e5OtBnmEuBaNsgxuAMZrAaMKlEbdnzJ9RzDFFv/u8GgwfLGx?= =?utf-8?q?Ekdg13mwYL0757u3havcy5t4lcv9jrg7acCANxoIP1KuLGfSD+JrN8mu/Fodjbxf8?= =?utf-8?q?e771zYRjUOq+hnYC77ENNQx5RkKFGcqdAOcF+8Zsff4UBEijzSctw4wq+/OP6/VkF?= =?utf-8?q?rjBlhmO1gl9Q8bp7u7Ers4cqg/QRI3n+kQ4UV4gSHaOty2zY9ZB9zN6BAcXRJIbsX?= =?utf-8?q?jrAud6RrW3A+SWO0k3gw3hojAOe4Y6Mo4dpDM504urqwRAeT+9Lw1dA=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)(1800799024)(376014)(36860700013)(7416014)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:27.3864 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 33a835c1-2ae4-4e5c-d3f5-08dcf21ba1f6 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: AM4PEPF00025F98.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR07MB9509 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen With AccECN, there's one additional TCP flag to be used (AE) and ACE field that overloads the definition of AE, CWR, and ECE flags. As tcp_flags was previously only 1 byte, the byte-order stuff needs to be added to it's handling. Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang --- include/net/tcp.h | 7 ++++++- include/uapi/linux/tcp.h | 9 ++++++--- net/ipv4/tcp_ipv4.c | 3 ++- net/ipv4/tcp_output.c | 8 ++++---- net/ipv6/tcp_ipv6.c | 3 ++- net/netfilter/nf_log_syslog.c | 8 +++++--- 6 files changed, 25 insertions(+), 13 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index bc34b450929c..55a7f0a7ee59 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -920,7 +920,12 @@ static inline u32 tcp_rsk_tsval(const struct tcp_request_sock *treq) #define TCPHDR_URG BIT(5) #define TCPHDR_ECE BIT(6) #define TCPHDR_CWR BIT(7) +#define TCPHDR_AE BIT(8) +#define TCPHDR_FLAGS_MASK (TCPHDR_FIN | TCPHDR_SYN | TCPHDR_RST | \ + TCPHDR_PSH | TCPHDR_ACK | TCPHDR_URG | \ + TCPHDR_ECE | TCPHDR_CWR | TCPHDR_AE) +#define TCPHDR_ACE (TCPHDR_ECE | TCPHDR_CWR | TCPHDR_AE) #define TCPHDR_SYN_ECN (TCPHDR_SYN | TCPHDR_ECE | TCPHDR_CWR) /* State flags for sacked in struct tcp_skb_cb */ @@ -955,7 +960,7 @@ struct tcp_skb_cb { u16 tcp_gso_size; }; }; - __u8 tcp_flags; /* TCP header flags. (tcp[13]) */ + __u16 tcp_flags; /* TCP header flags (tcp[12-13])*/ __u8 sacked; /* State flags for SACK. */ __u8 ip_dsfield; /* IPv4 tos or IPv6 dsfield */ diff --git a/include/uapi/linux/tcp.h b/include/uapi/linux/tcp.h index dbf896f3146c..3fe08d7dddaf 100644 --- a/include/uapi/linux/tcp.h +++ b/include/uapi/linux/tcp.h @@ -28,7 +28,8 @@ struct tcphdr { __be32 seq; __be32 ack_seq; #if defined(__LITTLE_ENDIAN_BITFIELD) - __u16 res1:4, + __u16 ae:1, + res1:3, doff:4, fin:1, syn:1, @@ -40,7 +41,8 @@ struct tcphdr { cwr:1; #elif defined(__BIG_ENDIAN_BITFIELD) __u16 doff:4, - res1:4, + res1:3, + ae:1, cwr:1, ece:1, urg:1, @@ -70,6 +72,7 @@ union tcp_word_hdr { #define tcp_flag_word(tp) (((union tcp_word_hdr *)(tp))->words[3]) enum { + TCP_FLAG_AE = __constant_cpu_to_be32(0x01000000), TCP_FLAG_CWR = __constant_cpu_to_be32(0x00800000), TCP_FLAG_ECE = __constant_cpu_to_be32(0x00400000), TCP_FLAG_URG = __constant_cpu_to_be32(0x00200000), @@ -78,7 +81,7 @@ enum { TCP_FLAG_RST = __constant_cpu_to_be32(0x00040000), TCP_FLAG_SYN = __constant_cpu_to_be32(0x00020000), TCP_FLAG_FIN = __constant_cpu_to_be32(0x00010000), - TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0F000000), + TCP_RESERVED_BITS = __constant_cpu_to_be32(0x0E000000), TCP_DATA_OFFSET = __constant_cpu_to_be32(0xF0000000) }; diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 9d3dd101ea71..9fe314a59240 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -2162,7 +2162,8 @@ static void tcp_v4_fill_cb(struct sk_buff *skb, const struct iphdr *iph, TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin + skb->len - th->doff * 4); TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); - TCP_SKB_CB(skb)->tcp_flags = tcp_flag_byte(th); + TCP_SKB_CB(skb)->tcp_flags = ntohs(*(__be16 *)&tcp_flag_word(th)) & + TCPHDR_FLAGS_MASK; TCP_SKB_CB(skb)->ip_dsfield = ipv4_get_dsfield(iph); TCP_SKB_CB(skb)->sacked = 0; TCP_SKB_CB(skb)->has_rxtstamp = diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 054244ce5117..45cb67c635be 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -400,7 +400,7 @@ static void tcp_ecn_send(struct sock *sk, struct sk_buff *skb, /* Constructs common control bits of non-data skb. If SYN/FIN is present, * auto increment end seqno. */ -static void tcp_init_nondata_skb(struct sk_buff *skb, u32 seq, u8 flags) +static void tcp_init_nondata_skb(struct sk_buff *skb, u32 seq, u16 flags) { skb->ip_summed = CHECKSUM_PARTIAL; @@ -1382,7 +1382,7 @@ static int __tcp_transmit_skb(struct sock *sk, struct sk_buff *skb, th->seq = htonl(tcb->seq); th->ack_seq = htonl(rcv_nxt); *(((__be16 *)th) + 6) = htons(((tcp_header_size >> 2) << 12) | - tcb->tcp_flags); + (tcb->tcp_flags & TCPHDR_FLAGS_MASK)); th->check = 0; th->urg_ptr = 0; @@ -1604,7 +1604,7 @@ int tcp_fragment(struct sock *sk, enum tcp_queue tcp_queue, int old_factor; long limit; int nlen; - u8 flags; + u16 flags; if (WARN_ON(len > skb->len)) return -EINVAL; @@ -2159,7 +2159,7 @@ static int tso_fragment(struct sock *sk, struct sk_buff *skb, unsigned int len, { int nlen = skb->len - len; struct sk_buff *buff; - u8 flags; + u16 flags; /* All of a TSO frame must be composed of paged data. */ DEBUG_NET_WARN_ON_ONCE(skb->len != skb->data_len); diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 597920061a3a..252d3dac3a09 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -1737,7 +1737,8 @@ static void tcp_v6_fill_cb(struct sk_buff *skb, const struct ipv6hdr *hdr, TCP_SKB_CB(skb)->end_seq = (TCP_SKB_CB(skb)->seq + th->syn + th->fin + skb->len - th->doff*4); TCP_SKB_CB(skb)->ack_seq = ntohl(th->ack_seq); - TCP_SKB_CB(skb)->tcp_flags = tcp_flag_byte(th); + TCP_SKB_CB(skb)->tcp_flags = ntohs(*(__be16 *)&tcp_flag_word(th)) & + TCPHDR_FLAGS_MASK; TCP_SKB_CB(skb)->ip_dsfield = ipv6_get_dsfield(hdr); TCP_SKB_CB(skb)->sacked = 0; TCP_SKB_CB(skb)->has_rxtstamp = diff --git a/net/netfilter/nf_log_syslog.c b/net/netfilter/nf_log_syslog.c index 58402226045e..86d5fc5d28e3 100644 --- a/net/netfilter/nf_log_syslog.c +++ b/net/netfilter/nf_log_syslog.c @@ -216,7 +216,9 @@ nf_log_dump_tcp_header(struct nf_log_buf *m, /* Max length: 9 "RES=0x3C " */ nf_log_buf_add(m, "RES=0x%02x ", (u_int8_t)(ntohl(tcp_flag_word(th) & TCP_RESERVED_BITS) >> 22)); - /* Max length: 32 "CWR ECE URG ACK PSH RST SYN FIN " */ + /* Max length: 35 "AE CWR ECE URG ACK PSH RST SYN FIN " */ + if (th->ae) + nf_log_buf_add(m, "AE "); if (th->cwr) nf_log_buf_add(m, "CWR "); if (th->ece) @@ -516,7 +518,7 @@ dump_ipv4_packet(struct net *net, struct nf_log_buf *m, /* Proto Max log string length */ /* IP: 40+46+6+11+127 = 230 */ - /* TCP: 10+max(25,20+30+13+9+32+11+127) = 252 */ + /* TCP: 10+max(25,20+30+13+9+35+11+127) = 255 */ /* UDP: 10+max(25,20) = 35 */ /* UDPLITE: 14+max(25,20) = 39 */ /* ICMP: 11+max(25, 18+25+max(19,14,24+3+n+10,3+n+10)) = 91+n */ @@ -526,7 +528,7 @@ dump_ipv4_packet(struct net *net, struct nf_log_buf *m, /* (ICMP allows recursion one level deep) */ /* maxlen = IP + ICMP + IP + max(TCP,UDP,ICMP,unknown) */ - /* maxlen = 230+ 91 + 230 + 252 = 803 */ + /* maxlen = 230+ 91 + 230 + 255 = 806 */ } static noinline_for_stack void From patchwork Mon Oct 21 21:59:01 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: 13844712 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR02-VI1-obe.outbound.protection.outlook.com (mail-vi1eur02on2081.outbound.protection.outlook.com [40.107.241.81]) (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 C08B31FE0F2; Mon, 21 Oct 2024 21:59:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.241.81 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547974; cv=fail; b=gh/XSP/iHukWDCCUFgEUXfb/W0h2Bt2kXdxirDjOtCcSxbdnVsfB9WW2oUUS9W+KcvTcjogAbA0f9N0bip0r7FYokrvlXTYK5vt1CIalrR/x36wFzkIh18ZKum8xusuzNz8Kfc1B18VJ3Eg21FA4fqY9Qq1yZdDLes0DIUSSpEE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547974; c=relaxed/simple; bh=/DXiP48JvOyuu2neVkASCL/V6m9Qs0aUxatR2JoMVD8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=CMJvi0UwRfnL/NIa30q7h/FLyEmVjI5hlA7rsnpqE7x7RxhSIJC3Xqe/Hxt97OUdY43qhJmpMbRjSVP9WNWkUL9T710UxSfPZe+msZ9qyAD8te8ks9IZeh0Sbr0NFFz9W4b18hZBfKnEzr2Zv0hCkAUtcFG3sdZqfIH3QtwxujY= 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=hPPw1bFk; arc=fail smtp.client-ip=40.107.241.81 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="hPPw1bFk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=hdJdxtxw4cmAMpitvU/Zb7EQMxggY7fbKCX8dGKWVBUzyLuae7uvO/MZGQjXAsOVF3Z6uV6BWUWoNAPSyuzFerHRclouXCtK/SAUWDZ5wlR1abJGepUqe7HiayY06DR7byU/Y2QLyZCXuC9cMRItkXNqVJ6hyPXRtnDGhAHeQiUJgYUxZrWrY9ajMEXmHvMQ47g09mAV5zQi7A6fhtlAJEndNbjBOhwsri2MLRyNn+maRd6JQJbOiueMo8qaDW1TgMUIlAZ4DpXJJFR3YQjyoNT8gbmpPExmXjjkAHomI33YsUAhx69koHuZrgkCoticP+lBA8yzi2GMoI6dodhIFw== 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=slhYpgNbfxS31y0O4s9n10+y1xuaFQsDE8kARtPSdOI=; b=ZpHEj1Vbm8aeWv2ilpsgydvR+rLMvg7PVg/SYuLfQnkKiR2GLZGNGkTJy3p0OjWMKcyFbcbLcYxzPqJuWD8AmJBdQiSV/+iLziujBNPt0hukVifRVmWpqmySVoq/EA3IFed/LXCQY3q7R35x11RfkmimpF/duiFVC8QqalYWSwYeJeBxFaVdMrQapXKBNeTD6ISHDJZs7jMKBug3x5PDBdSKvQrO8tBL4ekBu4ZKG4vQwQjWF75DRrVbvVJUhL458k6MDQ3BtUlVs8L5bhi0IQthyGT3HhZdvW23fr6fMTNsFJwRbotjty0Y2oDqePZFxT4hFne3jBf0m1mJbjXS+Q== 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=slhYpgNbfxS31y0O4s9n10+y1xuaFQsDE8kARtPSdOI=; b=hPPw1bFkwqDG1A01C2DrKPhECJm7JzG610lZTHTrRHP2K3b0AbQNSNkWlVEPrv7Gs+j3wClVaKBMFDWxBpaIpLZfGaB+mrV6ged+67fvwZ1C//MVPuzsdvxhvTGcoWZoLmwpdSIRhWlq3HYJEJbSP18qiIKp8RhVi19kj1obXW7y1D2V4tFVwhvSGergGq6Y5L5HswBhVQEEJh5TERXcqOclFCLD0b9di9nHjIpDdX8cxdsrAUHDwyHXz2A+3hdbznG53e+QVdAbgHzscVXWJBnMZWzQDDawG8O56Acif4kTeldn4F+br9vEGp3BwujOQtPDp1AxtLvhhqjpiO6IkQ== Received: from AM6PR08CA0002.eurprd08.prod.outlook.com (2603:10a6:20b:b2::14) by DBBPR07MB7465.eurprd07.prod.outlook.com (2603:10a6:10:1ef::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.27; Mon, 21 Oct 2024 21:59:28 +0000 Received: from AMS0EPF000001AA.eurprd05.prod.outlook.com (2603:10a6:20b:b2:cafe::b3) by AM6PR08CA0002.outlook.office365.com (2603:10a6:20b:b2::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Mon, 21 Oct 2024 21:59:28 +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 AMS0EPF000001AA.mail.protection.outlook.com (10.167.16.150) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:59:28 +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 49LLxENM032273; Mon, 21 Oct 2024 21:59:26 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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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 v4 net-next 05/14] tcp: reorganize SYN ECN code Date: Mon, 21 Oct 2024 23:59:01 +0200 Message-Id: <20241021215910.59767-6-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: AMS0EPF000001AA:EE_|DBBPR07MB7465:EE_ X-MS-Office365-Filtering-Correlation-Id: 5a5bde0a-ca4c-4df9-328c-08dcf21ba2b6 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|376014|1800799024|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?wxYFjSkRMxA6Sq9l8MUS6rX+wU5wW/2?= =?utf-8?q?Lrf6F7KAFFQnqTKCNBDjVEkbjONUrSoLkfQJjM51a2x++fLYeh25w1NFftzic0sAm?= =?utf-8?q?JYZwVNcHUrz9XwxKDzC/gfDMjHnZjIzinpPLAKMIuZ4zdCVZEY75kvLanBZzI53k3?= =?utf-8?q?8bUW1jWSG/K0Pf2bUNlJQsrr7nQfxiNlczMkminy6C0Nhn1ZnE6tIGU/xlOMno6iO?= =?utf-8?q?jvxEwlN7Hh8CWOEylUTFerdAqiXCKHpD9gVuvWxzwpxS8gl3Y0cGulphBQVIdU0EL?= =?utf-8?q?1OZa9KfeKhfSZbCux2Sh2oSftA+PsNlEU80kz1J+BFZsd1fEM9mPqBD3NHDiRL5G+?= =?utf-8?q?pmvN5L8VlB8R4uD7ZpDJG2CbKwswnYHbFD7sHclXFMunlmrEFzmfWSnjBpfuITRDB?= =?utf-8?q?4w452MGv3MUALEW5IURJHeHcliX7tC4L13U7gugMLTp5VfeFbnYI7FQEeIBCjTDgu?= =?utf-8?q?PmS0TZuCM7E+koQqGyvcEph9ZW+3LGWpxNo4tUz1CGDN76jElqvvqXgPzBwG0+SL8?= =?utf-8?q?YSt6uWim2NGFRC1aN56Zh2Gn7d2xLPHQd1nZNENxOgBveJc3YBU+yIcH/4ALGpNTD?= =?utf-8?q?7TPJpA/n3Y/6gwqi1fQkr/M1h8yDQ+vsTIz1CmBHtFkbLAFTLTys2h6Ea3oR8eYLO?= =?utf-8?q?/8WheLrqCK5SkOhR3Z/6GiPUffrkd9Vy9RHWT16xb0i1TfH2IkUbhRsPDG+YESlOj?= =?utf-8?q?QpmbiOafs+PemPxrZW1dFiq1o/MUc5/moH/I0yr03FYgSMaBt0ylVbNSga2us40q2?= =?utf-8?q?7YifKWs9g0e/OYVE+fwYTZt6GfAZIY482kdi1K83xUmfDS3F/hzM2lNzLfryuuBYg?= =?utf-8?q?JNd9i2aJEnn0+woPzpaf+r0zzP75Kk09JdLJONL28vMI/8XoQxOkJckCsivVsFwr6?= =?utf-8?q?j3JB+Mx2XqxLgOAa5PuYWaOHPrwVGCd8fKDVgakV9FzjzklolEgZpwJiUJqemiV8/?= =?utf-8?q?xvMHLbf4iuVB02khhKIIdx4bf5GbPR9vXWVwqGRnP3tR6z+1IZdnwRjq6B3+Shuje?= =?utf-8?q?SGLWOFmPI7ymc9nvjh3G5FqXfH08GIqUkrV5iSLYFS/qsn87la165z8edndfc0W9H?= =?utf-8?q?X33IQH7Df8EwdN+XbVpO5lncs/J6pCZ0vCzh2zTEanLQfvJi4M6tUJZtd3VqqDzTd?= =?utf-8?q?P5ORPfLjzv5hH/7S/mffCFmFhDjr2QQYxMLtQomtuOmV0Ap5/5MwFXE+n+Q8pcxik?= =?utf-8?q?J0HPyzOoK9KJtyZ2Fs/j5tFUr1eV+xE408fcz641lS7vJTcsxsyzUERLTyfx9lSX7?= =?utf-8?q?BSmFwtfAM7hZUygm6Zf6utY6e7/2gb89osandLW5RqadGm6ExT5Y5rALulxxRHZaR?= =?utf-8?q?Ggy5EZJVsaUU4BBIlId3jAz4j9f6ZMfX8eX3on7Peu/fIHm0ajCAjds=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)(36860700013)(7416014)(376014)(1800799024)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:28.6093 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 5a5bde0a-ca4c-4df9-328c-08dcf21ba2b6 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: AMS0EPF000001AA.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DBBPR07MB7465 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen Prepare for AccECN that needs to have access here on IP ECN field value which is only available after INET_ECN_xmit(). No functional changes. Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang --- net/ipv4/tcp_output.c | 5 +++-- 1 file changed, 3 insertions(+), 2 deletions(-) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 45cb67c635be..64d47c18255f 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -347,10 +347,11 @@ static void tcp_ecn_send_syn(struct sock *sk, struct sk_buff *skb) tp->ecn_flags = 0; if (use_ecn) { - TCP_SKB_CB(skb)->tcp_flags |= TCPHDR_ECE | TCPHDR_CWR; - tp->ecn_flags = TCP_ECN_OK; if (tcp_ca_needs_ecn(sk) || bpf_needs_ecn) INET_ECN_xmit(sk); + + TCP_SKB_CB(skb)->tcp_flags |= TCPHDR_ECE | TCPHDR_CWR; + tp->ecn_flags = TCP_ECN_OK; } } From patchwork Mon Oct 21 21:59:02 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: 13844714 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2088.outbound.protection.outlook.com [40.107.22.88]) (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 48A701FF602; Mon, 21 Oct 2024 21:59:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.88 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547975; cv=fail; b=TFL2k9UVAQXUztiV+zHw4bwcdmg+B75Cp83EDVz2P9cRKE7ShJEG4PcrWvQRwUAJ6a11edecxnBptlWDLJ30hMxWITIKLzu9hSDs8C2Rb5QFm5wD3AaAQB4kLifGy0bLXtUJwCAVdL1maTvbJ05lLqLz04fqfPh+TcJ1bwVlMPY= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547975; c=relaxed/simple; bh=leNo0xCGv0TXQfy4qiO/qvKzRlLq9lg72vGgsiq8lzg=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=RmeDg9Rqo63dohSIUewflfY9eryGg1Tu0rFxqv1ZNlbsDQwYzF9gU+joGiTMrzutAIoJ6ASLw1nKRSqHTJC5+xKuMuIMNp17PqZ1SEb1m81I3uADFn4kjapmXalgsnE0gPz9x9kCixBWHwgpMJNEtdmLkC0/AJ4NRlG7bwkwpEk= 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=aKxAd4AV; arc=fail smtp.client-ip=40.107.22.88 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="aKxAd4AV" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ufJbRzg2vgfW9/kS8HzZmU9t6XaHrfTORPgXO6pVSmcI0c8rPE4x0pi2W13a8NIqu8iZsKXQit/LOFV87G1beuLCoiMgywOFR28HzDgzhEtDLamR8qmUoqtqpiUGZi/VpGGo6hoYXuT8dK756vZ6UQu2YRMX+D+D8MOpKs/2bM9DGazyirQRMYM3Z5HywNPb5F43xcci/PdJ52r3GjEkTqXweI0tAaze6xZ/bNjLHxm2Y7ZQUqWCLNQxZFdDeGjJYNaxWsy83vPoBvecsc4buVsHEr7mju+9VdttVVrWHO6IBk/5G1bp4/wp4OEt3L2OVJyiUZpPtxWf3GmEAxJQ7A== 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=Z+js0Oahjt/6qHyBm7lGS43gfhHYb0NanOSfmUdzE98=; b=G0sA/wh50BySDtEhnBCjfUiyWrT4kuoB2kRmMijCha9iOc8mLAbsPbvAaaQqRs8JkUNCiWGSW0CaftU8czP0CWxntx2d+GnZv+c93in0AqVo/I5JZkhRFRoV/r9gfSNTIoXje7XeSp9iaMNXpyG2JVbABGwjtOOOX1gw8yBmz//zRyRkZfeFXfmuzCnnZ7AsgeacsUC7OOBsiFI8KC//E4HK5XjMfUevgr1lHcQv1X22DalZtMY1FcNvRYkQfJr+/WV59I6SqTvy1Mtj8mom5G3fkD2Hd5tlJU1ppJpw8VrCacrekFcP0LY3t8xxaGA/OdbxKfJGNOmka+76N5egYA== 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=Z+js0Oahjt/6qHyBm7lGS43gfhHYb0NanOSfmUdzE98=; b=aKxAd4AVsFZWlaG9SYgYDqVuyKVgk1qXMeMPPdS1Hk7wxlgtBL3YcK41PHggMcQ6npYWv4rYAgWTYVZt78HD6QEEO2OIeRU/NJlm3ubJxTFmwkX70UP2t3S/7u5+FUW5E7pz1TMGEuWk6oEKt+gNVJUlH/5Gchk53qucrmLW80R4gC4u8DwL0bADO4IOqtwh/uckzNwC0KQwrTyq7nArDtLCDuZCeHu4ITy01vZGnNQrgBJ5iH9DhKYT8ZQgsNae1nabsWKzUvBlFEvt3Cf8jjwyfvO5rhj16+W9MyEN1BgOIPL1exPEv0gDE0zyPZaMztDuXvr475W8VvCaS3qR6Q== Received: from AM6P193CA0051.EURP193.PROD.OUTLOOK.COM (2603:10a6:209:8e::28) by DU0PR07MB8945.eurprd07.prod.outlook.com (2603:10a6:10:413::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Mon, 21 Oct 2024 21:59:30 +0000 Received: from AMS1EPF00000040.eurprd04.prod.outlook.com (2603:10a6:209:8e:cafe::9c) by AM6P193CA0051.outlook.office365.com (2603:10a6:209:8e::28) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Mon, 21 Oct 2024 21:59:30 +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 AMS1EPF00000040.mail.protection.outlook.com (10.167.16.37) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:59:29 +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 49LLxENN032273; Mon, 21 Oct 2024 21:59:28 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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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 v4 net-next 06/14] tcp: rework {__,}tcp_ecn_check_ce() -> tcp_data_ecn_check() Date: Mon, 21 Oct 2024 23:59:02 +0200 Message-Id: <20241021215910.59767-7-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: AMS1EPF00000040:EE_|DU0PR07MB8945:EE_ X-MS-Office365-Filtering-Correlation-Id: 62baf3cd-3777-41ee-72f4-08dcf21ba375 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|376014|1800799024|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?0afLIxG9y3RX69bBMrDB4AhRY6Zd4JU?= =?utf-8?q?zh+7R8xCAL5OElfsAZDePyIzCbXs4iyIuAzaTdmedEjYOnv+UMV7tjy3N9eZQMyYz?= =?utf-8?q?1epOYKYgrMKU08sMA0r6haq7WsmXHjTRb9C/On5bCYk7TjOfo6OmYO9D2KvCCUbQM?= =?utf-8?q?KEolIXgd5af6tHnLAs5Oy7qCQjoaYgQjpzSj4Gp8CRabTsdMObckHrQ0ibixdtoAe?= =?utf-8?q?1aZuUFrtiW7rCZ5fgPiqRB85X4S2daq8mOLe6Cke4Hxmw4mvlg1V9JrOHdl89eIlb?= =?utf-8?q?m5Xah2tqITZBHJc6tHPGyJVso0UMSA2Zkkl9P6C9011/hKCilgDiv1ZIYWb53O/1I?= =?utf-8?q?Qrpj9354p2GuoHT9zdRn6+wX5kSru264DbbX6C4EiQc5r71MhvtlkjwUcASjQZhzH?= =?utf-8?q?lqCqLF3ctFt5cD5KI0/1JCL+/oPIs9H49Qig0Kq/e6LJeZPh67tisSp1xGqOwYliH?= =?utf-8?q?cGbZeuW202QnJyCJYTLcncMJUqQZ8uUCj30mTaClmW0uOkwOpfisb/FXscm0LxmQt?= =?utf-8?q?QE5opvqkF8P6eTS0NZqhtVnyfkpffN+mf1tJMgmonrJe+BhIrGpamuQHGvQbpF/qS?= =?utf-8?q?LyNpHVF58CR8js+++AEMsFjPCBE8cSL7qpe2QCW8eF5cxHFqTIcS7JLzxvSOu1b8h?= =?utf-8?q?fKg8N+jVjPQaNOCtjQsKoc1EpWiQ4MCN9CFzbQ98z9zCWIBuwOtVpcTZTPunMPd5u?= =?utf-8?q?M5vkm7kkaiirVcz0jKZpyzvH5n4lsgBtJzzs19uSZ8itM5Md1oZktWuHzkCAxBpdX?= =?utf-8?q?ZOTlQI4CVJBR7h2Sw1M4NIptxTwPnOkorWAlmBzsVk7Q2kpqBVyVfu/4SCV4QjJmS?= =?utf-8?q?/EY/VFiFflkCDu0IPSf3VloSn/y7Ns7RexxJKOUWH5pz8LkJOdqpyBT49l//9W23E?= =?utf-8?q?yoVao7ReOLRrpLjvtM2nTgfnj0gKwRk4Z97OHAOKuLIdBjbp410B86R35nX4kv2j6?= =?utf-8?q?iryLbHTDb3pLVtnJe6Ahht7vLg3CS+76ClhHmv7mU9seRVDlPhAtkwHBZ1IXXqn/t?= =?utf-8?q?36MdDvv/e3r6IoILtmoiKCrsJC7QqT2GFWixQ2/CQqfMwzwWBPLy473uH+98oQD7g?= =?utf-8?q?fWDs65Y3lLwze940ba+NQwUFHT4ZAelGcFfM+i7rwPa64oK6iadk7JIQNl9qTs7Oy?= =?utf-8?q?haYb5enbqrk5U+j6g2wreEtPkLqoi/QLAJxc9hUwYg8i76gnqj0nw2bgPK0IaPsRt?= =?utf-8?q?FaFUW7N+7bUr55lWgRzFP+bER7oZpYUhv0g0KpYrA6vTeKLibN7MoxvfjR9JidIUu?= =?utf-8?q?le5XI98Fg4Rc94JCB6j28RdKGmP4GaCThLZ56ovzIB4RDDY4ss/ntU0unB3YRVs/f?= =?utf-8?q?P1feTDWqpQZVBgxr1W3uGZ5hgLHfe9DDPUp93vTgf/QSQCq455hN0cI=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)(36860700013)(7416014)(376014)(1800799024)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:29.9096 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 62baf3cd-3777-41ee-72f4-08dcf21ba375 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: AMS1EPF00000040.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB8945 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen Rename tcp_ecn_check_ce to tcp_data_ecn_check as it is called only for data segments, not for ACKs (with AccECN, also ACKs may get ECN bits). The extra "layer" in tcp_ecn_check_ce() function just checks for ECN being enabled, that can be moved into tcp_ecn_field_check rather than having the __ variant. No functional changes. Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang --- net/ipv4/tcp_input.c | 15 ++++++--------- 1 file changed, 6 insertions(+), 9 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 3295ad329aef..6d4abd452a36 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -357,10 +357,13 @@ static void tcp_ecn_withdraw_cwr(struct tcp_sock *tp) tp->ecn_flags &= ~TCP_ECN_QUEUE_CWR; } -static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) +static void tcp_data_ecn_check(struct sock *sk, const struct sk_buff *skb) { struct tcp_sock *tp = tcp_sk(sk); + if (!(tcp_sk(sk)->ecn_flags & TCP_ECN_OK)) + return; + switch (TCP_SKB_CB(skb)->ip_dsfield & INET_ECN_MASK) { case INET_ECN_NOT_ECT: /* Funny extension: if ECT is not set on a segment, @@ -389,12 +392,6 @@ static void __tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) } } -static void tcp_ecn_check_ce(struct sock *sk, const struct sk_buff *skb) -{ - if (tcp_sk(sk)->ecn_flags & TCP_ECN_OK) - __tcp_ecn_check_ce(sk, skb); -} - static void tcp_ecn_rcv_synack(struct tcp_sock *tp, const struct tcphdr *th) { if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || th->cwr)) @@ -866,7 +863,7 @@ static void tcp_event_data_recv(struct sock *sk, struct sk_buff *skb) icsk->icsk_ack.lrcvtime = now; tcp_save_lrcv_flowlabel(sk, skb); - tcp_ecn_check_ce(sk, skb); + tcp_data_ecn_check(sk, skb); if (skb->len >= 128) tcp_grow_window(sk, skb, true); @@ -5028,7 +5025,7 @@ static void tcp_data_queue_ofo(struct sock *sk, struct sk_buff *skb) bool fragstolen; tcp_save_lrcv_flowlabel(sk, skb); - tcp_ecn_check_ce(sk, skb); + tcp_data_ecn_check(sk, skb); if (unlikely(tcp_try_rmem_schedule(sk, skb, skb->truesize))) { NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPOFODROP); From patchwork Mon Oct 21 21:59:03 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: 13844717 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2083.outbound.protection.outlook.com [40.107.105.83]) (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 C3F191E25F3; Mon, 21 Oct 2024 21:59:37 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547979; cv=fail; b=SNLEUOn76jIuBuFoOi27QWzgBIg4TPemYr3nM8/r8t/umoAr6ofqgvs609gyncj5CUd00+xljPQkFJ6f3J6y55RQrfmMtzQZGkqM4oT6SxNAUTQ1bVUTnO/orz+P4eLDnqbXVw8YziLfWly6uZixusP/rocOFqXd8Sol24INMvk= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547979; c=relaxed/simple; bh=WztCfr7DU2uQkLa72YOgwPpB13/PQ87q2/XsS4qJoUM=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=cjqay95QV85DZqBIl2lcj2qdK/Qi29/K/h5EAPF26yWoV3HEOvDpoq3W/Yu347wytjH46/EWckgyulN2+IcheFOoCt1owi0ul+r6+UT5zcTNZafWlGZO8/sA1o5CXeAvDufj/WxzMU9mzPnr2o/NJuOcSL/xQrJuQ3ODiFPzB5U= 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=G6T+L3na; arc=fail smtp.client-ip=40.107.105.83 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="G6T+L3na" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fFRl/BIGDxAdNHQ19D30Pll9OEg1jjUDmXsPFjUj9/+1MOvJ49XpdkdKAs1CLur1cTgjFM4xuMV4WTPGGL9gpH+fQ4nQXrl2fSp2RGKVn3x2TVamXbRpmkGuuQO0Wx+qFVqnItcyAh6aH9rtM6wHOYNtid5BZscgJOuTKhmPhKuisJvH4CSjhvgeRuJbQyB8bcy2RCYGBvreO73BOrI4Xvee67153mlHbd2ca4q1qFm3yioGoOe39Q9rSaw+q/hQqrp9DSo/OXRAdRT3GGRDVTKOENQaG0asMsfcuOhCgN+4V8JEFQCMyTLvCegtWuIJih5wuASmemwNTK8Rk6eeAA== 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=cMLJhFkpP+SH8QSt/9Ge4HrMPEmhzLTSJg317FeAfgM=; b=R6E/3ulO6N2Nqf+Wmj1xdNBJXj+uadoKRmIRWbQY0u8Z8A0mGPk4NfynH3vgF211/BKfwwRvhvKIIv7Z2QWqXQ5h69bAFPpJu3801gJ8fqQysVm+qHWP/pK4VSXTwG4qUaBBAaZaW4bolM3aWdo9lZJXQ3sk9P3I94IG3f/fmzzlqLAJZSl53upRBuRfDIsqr+QJ6Mo9jScVrb/5vBMzFvggxJFuBQKBDgI8/75323GNwJ1DXuki8lqu+Z+Xg0NcR75W1nil6rJDc/MTQp5OPOCtVOB7AikQ0MuFbwMDL7fHodL8ySzRboaN1o/+vHLaIRrzX+KLpwRRdjMSmtMSkQ== 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=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=cMLJhFkpP+SH8QSt/9Ge4HrMPEmhzLTSJg317FeAfgM=; b=G6T+L3na0xTpru0G6ZWu2YTyuyIzNxUWpcmE/r7+xYqCaP/oFlZjaCOVSX0hav/0IT4cQ9Yh/A9EZr6+3abZd/mKkIMdtZ47zIUHf7Vtnb0auQ02LSw9Sc283xLSRpyYlE6Ip6jZPBN+SL/o9twnjqw/ZrKnbFRSex0lCvF8PMJDWbpg//WEFWDJvkV9vnHvamxXC+l3awuwYt7oWLxBoJGPOBWR14uXJhlnE0Uy03iY+FnyW4npK397nLsVrl0R/u/c5y+kplVOyHqHxIiPUGfWrKAhB/W4RTUscFdBUf1HgD9AQQKIGN4gX26o6og1a/K53W/YGt6pghagZitSJQ== Received: from DUZPR01CA0001.eurprd01.prod.exchangelabs.com (2603:10a6:10:3c3::10) by DB9PR07MB8562.eurprd07.prod.outlook.com (2603:10a6:10:302::18) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.20; Mon, 21 Oct 2024 21:59:32 +0000 Received: from DB1PEPF000509F2.eurprd02.prod.outlook.com (2603:10a6:10:3c3:cafe::71) by DUZPR01CA0001.outlook.office365.com (2603:10a6:10:3c3::10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Mon, 21 Oct 2024 21:59:32 +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=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.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 DB1PEPF000509F2.mail.protection.outlook.com (10.167.242.148) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:59:31 +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 49LLxENO032273; Mon, 21 Oct 2024 21:59:29 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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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 v4 net-next 07/14] tcp: helpers for ECN mode handling Date: Mon, 21 Oct 2024 23:59:03 +0200 Message-Id: <20241021215910.59767-8-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: DB1PEPF000509F2:EE_|DB9PR07MB8562:EE_ X-MS-Office365-Filtering-Correlation-Id: 2e3554d9-13e3-47ba-3acf-08dcf21ba461 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|36860700013|82310400026|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?AOmX85siH3vymTUD1tvNcisSYarlmZP?= =?utf-8?q?Dncm9pwQTNeRe7qVjgvMsQJznxHDT+yYTuvpk9bKphG2K32+sVriFsnWsMjB3rOo2?= =?utf-8?q?vaK/uUthB+ob2PETvyX1D26uMhLDlsfsiFp/1b1x4B5Cluy8Fczzaqe0v/0Rd8HMi?= =?utf-8?q?Sarh/YktEP67PMMa9Coyr+wERHi/3qW/IXkGzzeCokPPYNFoRFYPqMXcocPtgF6bW?= =?utf-8?q?HmPljxsBEf4oJByWZD+OpFzgIcg9Z5nau9+Omtuf4BNxbROFNHui6/ZEHTAmAeeNx?= =?utf-8?q?FwUYYN+IgxYtLz+kqw0j0SkpjAZpZYp8qFulm88bw6XfXWALXN3ve6WtUVi0OCNXt?= =?utf-8?q?0sCGuQ4UlTgHKcidzRIuZztfIJDZQc4JByBGZg5Y+nHSaTGKAbGKrNgXozUPzzlof?= =?utf-8?q?zEAIUx3v9n4NGA8uukYXhEhNAV0/2CgS/sJ49zJHTyUGrmoondG5NcswRXS2pIkqB?= =?utf-8?q?6RRr5Pz15MHHDL66QeFr1mGaMHvRGaZAi6AoXgxr2FHje7/V8FU/juC2tKUwCyKLw?= =?utf-8?q?oXr5h7gQeFTjpdDepwWZk2vJHGVrWKYUlFTKStQAfZMwpVkiSLMs8kXb85ewqOhOU?= =?utf-8?q?gdVTJJLhbWOBtX17V8DItFApdMw1tR5gf7gAaxi5ftDfQgT5E8S1KLiLCs5KaHFj9?= =?utf-8?q?mJbBDtvoa5p512gdROjbtr5Y+rYZ1Wg8kr9XKlGvIuUoBaDrr9W80Iuxbv2c3FiIe?= =?utf-8?q?D7twZZyKYc8mniFM1QCifH3uWnM2oUyV8PM5kFSF3Bt98js4rLe1fqNXmBisq6REO?= =?utf-8?q?MT6wf6SC+Vz3KbV2gYalvCOE862EAnHTJm1WFyfD7J9KKSOPGEaWMlbvNuqLdABBf?= =?utf-8?q?O9kQUdYnZPuoLnkG++eJo9O8IJ5ok30gLvgM/RQFB/gJsY4lSyz/SV0UxcPXHAjY9?= =?utf-8?q?+NtsBG98dRwk5eTsc8g5mdnogDJTU1bSdfv8unoxVoajTZkbunhxtlmnQlKoDzF6m?= =?utf-8?q?bCCiLbFC2v6WvBBrlOKFvh+Kes+F2KJ6ZYJWLjGVi33EOorXNaBIFLT+0gH4mm4eN?= =?utf-8?q?PdbUyvlqCdWd+/NU23oCXeXqoz5xwyrKmSSwEoZjlMgp/bW0IF7MtpaLS61Hjjyq2?= =?utf-8?q?BTerOcVbbNRL6K55dFQfUQu9HTeRopSBg8KZCEuLCAp9IRKs+WCi977uKVK/x2wTq?= =?utf-8?q?X8laLuzd7gAvRT5jJTFHW2faVqEXCIJ+KEBQHwK3fwQzrMEuCUtnvgO+vnSVXDSXg?= =?utf-8?q?IZ/WNVGtcueK+UeLXVRpAqCQBKNse6wFga+rikmuLCLMKBfOAA22pdNSzSlNn3EOe?= =?utf-8?q?YTYxADPVAQYU+vfhCDUiFCnyxrctw5VURUU6/y1TANA/iToc9ShFWMcEA434b35Bc?= =?utf-8?q?fJaU0Ry7Fkrbc257VhkRshhUyYr36I6ngFHi34TJoILqeGwf90Jpi0A=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)(7416014)(376014)(36860700013)(82310400026)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:31.3923 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 2e3554d9-13e3-47ba-3acf-08dcf21ba461 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: DB1PEPF000509F2.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB8562 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen Create helpers for TCP ECN modes. No functional changes. Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang --- include/net/tcp.h | 44 ++++++++++++++++++++++++++++++++++++---- net/ipv4/tcp.c | 2 +- net/ipv4/tcp_dctcp.c | 2 +- net/ipv4/tcp_input.c | 14 ++++++------- net/ipv4/tcp_minisocks.c | 4 +++- net/ipv4/tcp_output.c | 6 +++--- 6 files changed, 55 insertions(+), 17 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index 55a7f0a7ee59..b6a4e0124280 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -372,10 +372,46 @@ static inline void tcp_dec_quickack_mode(struct sock *sk) } } -#define TCP_ECN_OK 1 -#define TCP_ECN_QUEUE_CWR 2 -#define TCP_ECN_DEMAND_CWR 4 -#define TCP_ECN_SEEN 8 +#define TCP_ECN_MODE_RFC3168 BIT(0) +#define TCP_ECN_QUEUE_CWR BIT(1) +#define TCP_ECN_DEMAND_CWR BIT(2) +#define TCP_ECN_SEEN BIT(3) +#define TCP_ECN_MODE_ACCECN BIT(4) + +#define TCP_ECN_DISABLED 0 +#define TCP_ECN_MODE_PENDING (TCP_ECN_MODE_RFC3168 | TCP_ECN_MODE_ACCECN) +#define TCP_ECN_MODE_ANY (TCP_ECN_MODE_RFC3168 | TCP_ECN_MODE_ACCECN) + +static inline bool tcp_ecn_mode_any(const struct tcp_sock *tp) +{ + return tp->ecn_flags & TCP_ECN_MODE_ANY; +} + +static inline bool tcp_ecn_mode_rfc3168(const struct tcp_sock *tp) +{ + return (tp->ecn_flags & TCP_ECN_MODE_ANY) == TCP_ECN_MODE_RFC3168; +} + +static inline bool tcp_ecn_mode_accecn(const struct tcp_sock *tp) +{ + return (tp->ecn_flags & TCP_ECN_MODE_ANY) == TCP_ECN_MODE_ACCECN; +} + +static inline bool tcp_ecn_disabled(const struct tcp_sock *tp) +{ + return !tcp_ecn_mode_any(tp); +} + +static inline bool tcp_ecn_mode_pending(const struct tcp_sock *tp) +{ + return (tp->ecn_flags & TCP_ECN_MODE_PENDING) == TCP_ECN_MODE_PENDING; +} + +static inline void tcp_ecn_mode_set(struct tcp_sock *tp, u8 mode) +{ + tp->ecn_flags &= ~TCP_ECN_MODE_ANY; + tp->ecn_flags |= mode; +} enum tcp_tw_status { TCP_TW_SUCCESS = 0, diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 82cc4a5633ce..94546f55385a 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -4107,7 +4107,7 @@ void tcp_get_info(struct sock *sk, struct tcp_info *info) info->tcpi_rcv_wscale = tp->rx_opt.rcv_wscale; } - if (tp->ecn_flags & TCP_ECN_OK) + if (tcp_ecn_mode_any(tp)) info->tcpi_options |= TCPI_OPT_ECN; if (tp->ecn_flags & TCP_ECN_SEEN) info->tcpi_options |= TCPI_OPT_ECN_SEEN; diff --git a/net/ipv4/tcp_dctcp.c b/net/ipv4/tcp_dctcp.c index 8a45a4aea933..03abe0848420 100644 --- a/net/ipv4/tcp_dctcp.c +++ b/net/ipv4/tcp_dctcp.c @@ -90,7 +90,7 @@ __bpf_kfunc static void dctcp_init(struct sock *sk) { const struct tcp_sock *tp = tcp_sk(sk); - if ((tp->ecn_flags & TCP_ECN_OK) || + if (tcp_ecn_mode_any(tp) || (sk->sk_state == TCP_LISTEN || sk->sk_state == TCP_CLOSE)) { struct dctcp *ca = inet_csk_ca(sk); diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 6d4abd452a36..0161660938d3 100644 --- a/net/ipv4/tcp_input.c +++ b/net/ipv4/tcp_input.c @@ -334,7 +334,7 @@ static bool tcp_in_quickack_mode(struct sock *sk) static void tcp_ecn_queue_cwr(struct tcp_sock *tp) { - if (tp->ecn_flags & TCP_ECN_OK) + if (tcp_ecn_mode_rfc3168(tp)) tp->ecn_flags |= TCP_ECN_QUEUE_CWR; } @@ -361,7 +361,7 @@ static void tcp_data_ecn_check(struct sock *sk, const struct sk_buff *skb) { struct tcp_sock *tp = tcp_sk(sk); - if (!(tcp_sk(sk)->ecn_flags & TCP_ECN_OK)) + if (tcp_ecn_disabled(tp)) return; switch (TCP_SKB_CB(skb)->ip_dsfield & INET_ECN_MASK) { @@ -394,19 +394,19 @@ static void tcp_data_ecn_check(struct sock *sk, const struct sk_buff *skb) static void tcp_ecn_rcv_synack(struct tcp_sock *tp, const struct tcphdr *th) { - if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || th->cwr)) - tp->ecn_flags &= ~TCP_ECN_OK; + if (tcp_ecn_mode_rfc3168(tp) && (!th->ece || th->cwr)) + tcp_ecn_mode_set(tp, TCP_ECN_DISABLED); } static void tcp_ecn_rcv_syn(struct tcp_sock *tp, const struct tcphdr *th) { - if ((tp->ecn_flags & TCP_ECN_OK) && (!th->ece || !th->cwr)) - tp->ecn_flags &= ~TCP_ECN_OK; + if (tcp_ecn_mode_rfc3168(tp) && (!th->ece || !th->cwr)) + tcp_ecn_mode_set(tp, TCP_ECN_DISABLED); } static bool tcp_ecn_rcv_ecn_echo(const struct tcp_sock *tp, const struct tcphdr *th) { - if (th->ece && !th->syn && (tp->ecn_flags & TCP_ECN_OK)) + if (th->ece && !th->syn && tcp_ecn_mode_rfc3168(tp)) return true; return false; } diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index bb1fe1ba867a..bd6515ab660f 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -453,7 +453,9 @@ EXPORT_SYMBOL(tcp_openreq_init_rwin); static void tcp_ecn_openreq_child(struct tcp_sock *tp, const struct request_sock *req) { - tp->ecn_flags = inet_rsk(req)->ecn_ok ? TCP_ECN_OK : 0; + tcp_ecn_mode_set(tp, inet_rsk(req)->ecn_ok ? + TCP_ECN_MODE_RFC3168 : + TCP_ECN_DISABLED); } void tcp_ca_openreq_child(struct sock *sk, const struct dst_entry *dst) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 64d47c18255f..bb83ad43a4e2 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -322,7 +322,7 @@ static void tcp_ecn_send_synack(struct sock *sk, struct sk_buff *skb) const struct tcp_sock *tp = tcp_sk(sk); TCP_SKB_CB(skb)->tcp_flags &= ~TCPHDR_CWR; - if (!(tp->ecn_flags & TCP_ECN_OK)) + if (tcp_ecn_disabled(tp)) TCP_SKB_CB(skb)->tcp_flags &= ~TCPHDR_ECE; else if (tcp_ca_needs_ecn(sk) || tcp_bpf_ca_needs_ecn(sk)) @@ -351,7 +351,7 @@ static void tcp_ecn_send_syn(struct sock *sk, struct sk_buff *skb) INET_ECN_xmit(sk); TCP_SKB_CB(skb)->tcp_flags |= TCPHDR_ECE | TCPHDR_CWR; - tp->ecn_flags = TCP_ECN_OK; + tcp_ecn_mode_set(tp, TCP_ECN_MODE_RFC3168); } } @@ -379,7 +379,7 @@ static void tcp_ecn_send(struct sock *sk, struct sk_buff *skb, { struct tcp_sock *tp = tcp_sk(sk); - if (tp->ecn_flags & TCP_ECN_OK) { + if (tcp_ecn_mode_rfc3168(tp)) { /* Not-retransmitted data segment: set ECT and inject CWR. */ if (skb->len != tcp_header_len && !before(TCP_SKB_CB(skb)->seq, tp->snd_nxt)) { From patchwork Mon Oct 21 21:59:04 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: 13844715 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2046.outbound.protection.outlook.com [40.107.103.46]) (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 B0625200110; Mon, 21 Oct 2024 21:59:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.46 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547978; cv=fail; b=QftCn9hWNnLQZ8ONTGg/nwxRVMSIZXf0lmMANJiO9ZY69lcGMfKdwhTvzhhqOR5zpy23rAYkE8sWmCNsQzKJkzTaSTwYsJW8tWb+W1wyg8CE+8dESfofbdvyncWrhfm3Nfky9azQ+fx6YaXh4XQ9bPcibGaGd1XIxy2I0iPCSjg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547978; c=relaxed/simple; bh=J9zvNIGCSv/VEda7aJQwG9Uhgv43BCWIAQkMiwTdNKU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=BTD1CGcs/JNalQFsEol4wxxterCV7+vUoISurlsUb7s4y/uA2dxC8hxEbmrWICBS9IeTgtJw0JDlzRgSWfs070Ls/N5FaA7cAAqL0DU39xh7ClcRTtqwQ+Yh0QduwI0rTdeaC8W75ZxlK+sHWDtt/UP8is2T5WsfcX/w6YMXNsg= 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=duPDBjtl; arc=fail smtp.client-ip=40.107.103.46 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="duPDBjtl" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=LVqG14qJSTq2hrNplyq4r9doEOtDzHHSIBxJc7nR7yVGoTygLEsRdCZFNozqfgVtXAoliJ1FDKXYl9hzs5/bvsw9XSOQjs+GwEqRe6uNbLPFJvGCyS5/Tdu45b1ZN2bH1U/TP7nqqFeRY3d+03KfUQDvGJkv/YDiLE1klTak65RRsY7c6Gw7y6mSES0m6TI5S4HN7wvHg19PuacMe0pqtOS+anoneWC9ldYuU5cBr7VfPxt1aa+uZvTm8IpeWEV6l/Vwk2WNU8cqYkJ1a14lehFhHRY172YgLxbLl87HCFrN3g6LX+1HZc+fUXFSBNJbgA36dtvKIEhx5df4qvaj4w== 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=utVwYKFd5vjX/MZSV3gMWkfZps4OlT4rUH+yT3OEJx8=; b=xoZSA3QEWj2zzSxZEHruup0IEtNEFnEWtCTgMjhRimFUDZt53CG4Z9pPDUU92Wg8tCjvIDOzgHaluX95FJgtFW0adStR4kYrlscQUf8cvtui1a21uOSGBJK7lIViDaKmJLr1EZIa3u63Ca768x45Mk3MBo0PFEIG6DxhCgZloiJijb6U0PEjrB7oZj0NpGC3WuwLb+Mr3Jlm15nBKKYYmhVsL+6K5zv+GoxmRR0AygyesOcD/LMntVLGk4YfpJg6Kq0ZyAFBY+ofMD9OpcxK5+6TvEn/m1O806IZEWzVk/nf5gn7136NrgL2YoqXdUbEY8P4+9tmxWYWt7sbhQ/vAA== 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=utVwYKFd5vjX/MZSV3gMWkfZps4OlT4rUH+yT3OEJx8=; b=duPDBjtloIvHK1bWseQSK1hwNBh4qIrsGgufPeeiXZKw5Elr/tr0+O3vt4Rh0XEdcgurjXbmB1KMpDV2rOr/Xg2rBYlLbxYFFvd4/u3h31tnx2mQvkGsBk29fomYN5sv0B5J0E2jK0qP7OdRwU9Tue5/FVkwCqUvx1Ji6V9mmH2TIgkBXV8lm4Bkmh943pckYZV2jM9eDQB50nCKzdvZtk0qHmh8q6nlw1B25ZbViPo1F2NOej6rrlQdvy8wc5EKZ9zeFsSSO76WBuTz0OnNNcvPRxaBHFcjEmIgvZwadQ5rsbK5NN/4u95ICvP2DnzfEqjYJ8RGGu8RRskveJojbQ== Received: from AS9PR06CA0237.eurprd06.prod.outlook.com (2603:10a6:20b:45e::24) by DU0PR07MB9140.eurprd07.prod.outlook.com (2603:10a6:10:404::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Mon, 21 Oct 2024 21:59:32 +0000 Received: from AMS1EPF00000047.eurprd04.prod.outlook.com (2603:10a6:20b:45e:cafe::8c) by AS9PR06CA0237.outlook.office365.com (2603:10a6:20b:45e::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28 via Frontend Transport; Mon, 21 Oct 2024 21:59:32 +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 AMS1EPF00000047.mail.protection.outlook.com (10.167.16.135) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:59:32 +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 49LLxENP032273; Mon, 21 Oct 2024 21:59: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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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 v4 net-next 08/14] gso: AccECN support Date: Mon, 21 Oct 2024 23:59:04 +0200 Message-Id: <20241021215910.59767-9-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: AMS1EPF00000047:EE_|DU0PR07MB9140:EE_ X-MS-Office365-Filtering-Correlation-Id: 8f1df74c-cd3a-4a4f-aa77-08dcf21ba4fe X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|1800799024|7416014|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?E8X0S2mmRUHPkF04xyGrsPvEi1Z9tmg?= =?utf-8?q?LxAg6Ie9Kp6Iv2zhfhJ/CnbcG6f8TI0Ed0opIDcGeR76JonPzQZShFTTRmzMR2bPc?= =?utf-8?q?a9ZKE1yPnOuryxYOYZmXH47sB5HgUCCuF9Gxf+9m3emnSZM+5ATt6qgDeyeLi9Lyl?= =?utf-8?q?Q7EQIzLPgJyk/57fT0UDZsv5ccW87/ewRGEow9o3xx5kn/TiObOrGcIqXIcLIHcu5?= =?utf-8?q?/SFuk8FuYYr9iN4bwchuKyhbBuJmkL2PvaR+2nNB31qWfx+Ul/T2+btvSXDeBLMPu?= =?utf-8?q?ZAHKl7Jnpxh+0Q7w9NbPe9YTygTrn9IzOA4/NKDQ4n6a1u7Z6+7AD5W+W5fLJLIBc?= =?utf-8?q?hshhFyUhAo0wpvc5igZoi7Fr2NdeEpeGcBBAetslNsvfnfjI4v6OATlvXgAtAdiAL?= =?utf-8?q?gA0HgkfydYsh14arcUCdugAsg/PfU0MolvEn1qDOji3/H9DxhaNTjF68sqjr/vbZQ?= =?utf-8?q?a4INGRtr0ZBlQ1enZQ1DZ6eQSfiHX5YKPNtBl7xufY11O0L8xgKZO8EY1fEpbh2Wp?= =?utf-8?q?J6cqZqc96sh2g3oXbOQJzjWeDnztRuSSQCT4+AVyxGhB3EE1vqPfy/Xs2rBUTzrm/?= =?utf-8?q?tMrBz/oC/Oibk7SLEvdotcakeGyWQaEfKs+KPYrP1tSwsaEHdoMFdrKF6cGcjxNd+?= =?utf-8?q?iNmyN5e41wRhmjxic+S4/NW7W3ZMYYV/pvLbaruLlny3XLE3xFwDb0i7RCxIrUGcx?= =?utf-8?q?YmIRPme+bxFGBG1K3Qyx6Vp57jiyeGUNVkM1bys7OMfwPT633tlOBM71rvBjcc+zM?= =?utf-8?q?TAe/4m5aZPwL6i6xw+D91YlyInuX2EJl+tVJuwnqu7u/nVSCjKml/nZ4dR+kXxCJh?= =?utf-8?q?rCGD+pNQEjt4siCfOraC917qp2vv8U5phqDt86imT9nsQoTJjjAspZ43w/Ll/2eXG?= =?utf-8?q?a9nESkwkJK236nAKjBoIZfuQiyjDP4mG2HSV1plcCH9ghABrUy//Vd5CedV+a/5m+?= =?utf-8?q?dTry/Q2WtNtEij+J8GiQISbq3DkAtR7XSkrtT53j5WYt2L2aW5QnN4fieZpDOqyEG?= =?utf-8?q?SAl2eAxG2ewddOTZQYWmvSo9zbi9mftgxyr+N6IBth8AapgZra/si4gyZjFyIkJ70?= =?utf-8?q?yyI84I9Hf4Lz1gy5Irh9IYpow1DgVJEBMkZ2vx2MqyL0MIg3Jtjmidw/fn87IK2+r?= =?utf-8?q?tESkNO3GmLspIm6KC5fnzLItPwArYzn0MA5gzDo0y2Y33miB/HDGXRNqY8/ao8A1e?= =?utf-8?q?sSljX0ky/wtps0Le3EUxI2VrlbjVFB+e69Yh/nuFgW3WwR2LQz/PcHYwPtnwoI1Nn?= =?utf-8?q?izNweR7ZxwGIjldR9o2sYO3W8lcGO19RnnGXxdv2ZxrJnV1XzVUbg1IHJdYwEGRIo?= =?utf-8?q?jncC5ty2YIQYqj/rzQrlvF7/tkdgOLCTymPtJCsWS9x0TRrt8lqFGK4=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)(376014)(36860700013)(1800799024)(7416014)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:32.4709 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8f1df74c-cd3a-4a4f-aa77-08dcf21ba4fe 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: AMS1EPF00000047.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB9140 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen Handling the CWR flag differs between RFC 3168 ECN and AccECN. With RFC 3168 ECN aware TSO (NETIF_F_TSO_ECN) CWR flag is cleared starting from 2nd segment which is incompatible how AccECN handles the CWR flag. Such super-segments are indicated by SKB_GSO_TCP_ECN. With AccECN, CWR flag (or more accurately, the ACE field that also includes ECE & AE flags) changes only when new packet(s) with CE mark arrives so the flag should not be changed within a super-skb. The new skb/feature flags are necessary to prevent such TSO engines corrupting AccECN ACE counters by clearing the CWR flag (if the CWR handling feature cannot be turned off). If NIC is completely unaware of RFC3168 ECN (doesn't support NETIF_F_TSO_ECN) or its TSO engine can be set to not touch CWR flag despite supporting also NETIF_F_TSO_ECN, TSO could be safely used with AccECN on such NIC. This should be evaluated per NIC basis (not done in this patch series for any NICs). For the cases, where TSO cannot keep its hands off the CWR flag, a GSO fallback is provided by this patch. Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang --- include/linux/netdev_features.h | 8 +++++--- include/linux/netdevice.h | 2 ++ include/linux/skbuff.h | 2 ++ net/ethtool/common.c | 1 + net/ipv4/tcp_offload.c | 6 +++++- 5 files changed, 15 insertions(+), 4 deletions(-) diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 66e7d26b70a4..c59db449bcf0 100644 --- a/include/linux/netdev_features.h +++ b/include/linux/netdev_features.h @@ -53,12 +53,12 @@ enum { NETIF_F_GSO_UDP_BIT, /* ... UFO, deprecated except tuntap */ NETIF_F_GSO_UDP_L4_BIT, /* ... UDP payload GSO (not UFO) */ NETIF_F_GSO_FRAGLIST_BIT, /* ... Fraglist GSO */ + NETIF_F_GSO_ACCECN_BIT, /* TCP AccECN w/ TSO (no clear CWR) */ /**/NETIF_F_GSO_LAST = /* last bit, see GSO_MASK */ - NETIF_F_GSO_FRAGLIST_BIT, + NETIF_F_GSO_ACCECN_BIT, NETIF_F_FCOE_CRC_BIT, /* FCoE CRC32 */ NETIF_F_SCTP_CRC_BIT, /* SCTP checksum offload */ - __UNUSED_NETIF_F_37, NETIF_F_NTUPLE_BIT, /* N-tuple filters supported */ NETIF_F_RXHASH_BIT, /* Receive hashing offload */ NETIF_F_RXCSUM_BIT, /* Receive checksumming offload */ @@ -128,6 +128,7 @@ enum { #define NETIF_F_SG __NETIF_F(SG) #define NETIF_F_TSO6 __NETIF_F(TSO6) #define NETIF_F_TSO_ECN __NETIF_F(TSO_ECN) +#define NETIF_F_GSO_ACCECN __NETIF_F(GSO_ACCECN) #define NETIF_F_TSO __NETIF_F(TSO) #define NETIF_F_VLAN_CHALLENGED __NETIF_F(VLAN_CHALLENGED) #define NETIF_F_RXFCS __NETIF_F(RXFCS) @@ -210,7 +211,8 @@ static inline int find_next_netdev_feature(u64 feature, unsigned long start) NETIF_F_TSO_ECN | NETIF_F_TSO_MANGLEID) /* List of features with software fallbacks. */ -#define NETIF_F_GSO_SOFTWARE (NETIF_F_ALL_TSO | NETIF_F_GSO_SCTP | \ +#define NETIF_F_GSO_SOFTWARE (NETIF_F_ALL_TSO | \ + NETIF_F_GSO_ACCECN | NETIF_F_GSO_SCTP | \ NETIF_F_GSO_UDP_L4 | NETIF_F_GSO_FRAGLIST) /* diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 8feaca12655e..4f0747e2325e 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5066,6 +5066,8 @@ static inline bool net_gso_ok(netdev_features_t features, int gso_type) BUILD_BUG_ON(SKB_GSO_UDP != (NETIF_F_GSO_UDP >> NETIF_F_GSO_SHIFT)); BUILD_BUG_ON(SKB_GSO_UDP_L4 != (NETIF_F_GSO_UDP_L4 >> NETIF_F_GSO_SHIFT)); BUILD_BUG_ON(SKB_GSO_FRAGLIST != (NETIF_F_GSO_FRAGLIST >> NETIF_F_GSO_SHIFT)); + BUILD_BUG_ON(SKB_GSO_TCP_ACCECN != + (NETIF_F_GSO_ACCECN >> NETIF_F_GSO_SHIFT)); return (features & feature) == feature; } diff --git a/include/linux/skbuff.h b/include/linux/skbuff.h index 48f1e0fa2a13..530cb325fb86 100644 --- a/include/linux/skbuff.h +++ b/include/linux/skbuff.h @@ -694,6 +694,8 @@ enum { SKB_GSO_UDP_L4 = 1 << 17, SKB_GSO_FRAGLIST = 1 << 18, + + SKB_GSO_TCP_ACCECN = 1 << 19, }; #if BITS_PER_LONG > 32 diff --git a/net/ethtool/common.c b/net/ethtool/common.c index 0d62363dbd9d..5c3ba2dfaa74 100644 --- a/net/ethtool/common.c +++ b/net/ethtool/common.c @@ -32,6 +32,7 @@ const char netdev_features_strings[NETDEV_FEATURE_COUNT][ETH_GSTRING_LEN] = { [NETIF_F_TSO_BIT] = "tx-tcp-segmentation", [NETIF_F_GSO_ROBUST_BIT] = "tx-gso-robust", [NETIF_F_TSO_ECN_BIT] = "tx-tcp-ecn-segmentation", + [NETIF_F_GSO_ACCECN_BIT] = "tx-tcp-accecn-segmentation", [NETIF_F_TSO_MANGLEID_BIT] = "tx-tcp-mangleid-segmentation", [NETIF_F_TSO6_BIT] = "tx-tcp6-segmentation", [NETIF_F_FSO_BIT] = "tx-fcoe-segmentation", diff --git a/net/ipv4/tcp_offload.c b/net/ipv4/tcp_offload.c index 2308665b51c5..0b05f30e9e5f 100644 --- a/net/ipv4/tcp_offload.c +++ b/net/ipv4/tcp_offload.c @@ -139,6 +139,7 @@ struct sk_buff *tcp_gso_segment(struct sk_buff *skb, struct sk_buff *gso_skb = skb; __sum16 newcheck; bool ooo_okay, copy_destructor; + bool ecn_cwr_mask; __wsum delta; th = tcp_hdr(skb); @@ -198,6 +199,8 @@ struct sk_buff *tcp_gso_segment(struct sk_buff *skb, newcheck = ~csum_fold(csum_add(csum_unfold(th->check), delta)); + ecn_cwr_mask = !!(skb_shinfo(gso_skb)->gso_type & SKB_GSO_TCP_ACCECN); + while (skb->next) { th->fin = th->psh = 0; th->check = newcheck; @@ -217,7 +220,8 @@ struct sk_buff *tcp_gso_segment(struct sk_buff *skb, th = tcp_hdr(skb); th->seq = htonl(seq); - th->cwr = 0; + + th->cwr &= ecn_cwr_mask; } /* Following permits TCP Small Queues to work well with GSO : From patchwork Mon Oct 21 21:59:05 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: 13844716 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2072.outbound.protection.outlook.com [40.107.20.72]) (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 28C7E200117; Mon, 21 Oct 2024 21:59:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.72 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547978; cv=fail; b=IRCRlxzFna8pxsJSM7X2zjXjAseS19V5d2B1SHVnFeNcKK4J6Z2O985M5Xbqy4xjw0EVNYcckwuv3WIiNdF7/Av6UsCQEOS78WuTmHseIIGUdVGzBoLf/eqFUNIOUEOmxXjCNwbDS4YIATVxeAs0YiDXmlRSMMqzYUBjqTVuhfM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547978; 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=o5Wg9xZBDt6kCGFV7VQJ9/yZi6sWWGQEz+qw1XggbUW2hrUEvg8E/g/7jW0Q92YpXGyF7KUY3Hlr8vwP88lhuzH53prwdZgV1WriZLCDoSuBeArzm/UvD+1OGkct/v5tS+V9Q8UzOQV0JJAmy8nFgBzj84AKJVQ/YY5v8yVLhgA= 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=K4EV1kT8; arc=fail smtp.client-ip=40.107.20.72 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="K4EV1kT8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=l973njf6aRltnSvOUjw7WNB3egpHjvSNZzt1UCUbkA1EPTK3yjmeo7XRHAz4+EdqiT7NdTdZ6QVrWCi8giM0BOR4G04i2Toe6DCcC+9CFgjjPMSywLZjxPXl+VrlydIzIenJxdriaDHcxkg45arSJ7ufiMfJolUVRYb+71/xhwEc59R7BI9Hrq/sAT5D0XCSVjVZ8FNWOMOMRJbH4MITu1nseFc/FfSiLV+ylFc75+29OteV2Yj3gXK9gBCZuCgWKupyLTgWIXF2WrTvhP2dsQn3irCHwG0U+oZhLEah5gSFe2q+za6tVapWDe79tk7klFx0ffnpBNA2YTClc83Oyg== 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=RMR+qNveCLh9xmfhxRWbUpI4rdj2ZJWW6H0FYouNe7myq5XSFCQ2CvkeDPz9ntkG0BoHoGSuP4kZerNZMZLjsQn8D6icCAqw2+tr/Pd5sEAteOBKkme9D9r0GIR792s1l9hQLa6aJNwVvWSIYeevCcnmJA/KSNrNSyO81WETKcDh4E1/5C30mha9eFrewqJvLEtlRL7GynDQ8kM0qcCcJdxql5fN9jeGbtNMV4Vu0o40Vj39KaI1CgNikQUi354YwACDtJKL14ay/cgIQNf26ILXh8/E6UoAcRUfF7lO5kx7xjXw74O132ZQz5GtlYHQNgvUKu5c4qrpjmcjfdD4vQ== 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=K4EV1kT83v/ODROGPe1DtDeCIvNN8kDWuM71PmHDYQyOUBn4t9DsIa7TcaisPiLj9z7jip0n6e5oPuNe4uTCXJ2rlSPZ6UwEI3P7jOq5it1RZkoaFSpfUHFtHy4Brn7che72oNB2v9qaGpVBZQo88OOd64qh1RjEJc2d9KIlsxXtyTZ4t9VJLM1sClyxnA310PUh6QbED0Dx+LxWK40HS58obyKuqXKkFIh2FNP+ZIEe3k9sKiYgdmVP8U1NMq3c0LIBtmczDbwOTSOX2IasrsdP+KmlMjTryQ3PqtCruH/SNHs4uviqdAIBqEiA1TRp3RmHK78RHflShCq9kivqtQ== Received: from AM6P191CA0034.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::47) by PA4PR07MB8389.eurprd07.prod.outlook.com (2603:10a6:102:2a0::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Mon, 21 Oct 2024 21:59:33 +0000 Received: from AMS1EPF0000003F.eurprd04.prod.outlook.com (2603:10a6:209:8b:cafe::a) by AM6P191CA0034.outlook.office365.com (2603:10a6:209:8b::47) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Mon, 21 Oct 2024 21:59:33 +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 AMS1EPF0000003F.mail.protection.outlook.com (10.167.16.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:59:33 +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 49LLxENQ032273; Mon, 21 Oct 2024 21:59:32 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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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 v4 net-next 09/14] gro: prevent ACE field corruption & better AccECN handling Date: Mon, 21 Oct 2024 23:59:05 +0200 Message-Id: <20241021215910.59767-10-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: AMS1EPF0000003F:EE_|PA4PR07MB8389:EE_ X-MS-Office365-Filtering-Correlation-Id: 7c06c9eb-d1ab-464d-cca7-08dcf21ba5b6 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?RBcQV9oWTNMaXCqIYDF4gBpVcj6JYbu?= =?utf-8?q?tDnZPslTCQQ7cTnw5wC3699yGM0lNUs7hbRgnrV/hJd4AE7iupS3xTv0LtW6sM3ZC?= =?utf-8?q?4/ZBOOF7YiIqjdFpuvNZc2noxoEzLj5NXFramqDB8flltbb3lyZV+hblqCjH2acxY?= =?utf-8?q?LNhbC5ab6S5lXBf9hCGKHsgm2dvniKpmZlc66e9j0+D9OqxhpKF7oxsZBrqaMvI0g?= =?utf-8?q?Tg80D3JwwYmmuFASR1DvzSY8wkoi5Zeg8Oy7Z8Upa57bjnx3NnLTccGaHBmtoiMBj?= =?utf-8?q?rtTBxxw+S8buu6u+nYiBvnCWyiKHaoXtR+IbFIiRV6h6xcze2ku0o4RaAesn0r0XZ?= =?utf-8?q?g8QHuQ2qMQhlfQDYl+gohbbV9aGVv12ipaWEc/aWpsxIERdJcGX0TS1Vvl/9CSnkL?= =?utf-8?q?D1VsSvFupB0x6Mn51JVfQkcr/55ztidjg6fCswuWS1RNXTQUCxXclfsTX0FupLyzr?= =?utf-8?q?Oq3yl/QBOs3XPxZrqwFpCUlr+47cfbXQSM2wiw7Vx9ki4Bp6RUbDFSBOdR5TW4B8y?= =?utf-8?q?28qirb2teO4Lk41cie1VqTvsblqy6OtyBIqC5Pqw30J6rZbLHlTEBaGWToao8OmqM?= =?utf-8?q?bmst87do8nwxj8Anc/tWPHTrdo5NQDT7bbiWHYw4aQKXnEx4cYlTJIcKa3ukWJO09?= =?utf-8?q?ewTKFz/JO1QEcx9D7TwkHPlEB9a/J7oW0H2zJIN2kRFXcd//czn0KZGfpMO3UBF53?= =?utf-8?q?GodxRUM8GwZxikFDfttrwInHI1zQNWaoGu6rjg5eRQkUGPkoaftVnnQE7cHHn3hpd?= =?utf-8?q?PlHHCvovC56alkx7Z9Nd1R9nUUHyVMDMEVEUq5d4lzO6oY1ZRk8jfyquE+luSDjse?= =?utf-8?q?Vub4SvcEsZ3FMlzjxi5F2cdblaJ+i6gKThiwr96pfO0c6UczBJvIiZi+E1MAW+H2S?= =?utf-8?q?AuA5M6ENcgOC4qMo2JmIil+E49CHnkkYmWaLJW/TwISbv4ZD+RebI2U9X51fz3JH0?= =?utf-8?q?rA63bOS/B4BeLJHLu2PBxR82MgRrmiiy6Bbe5XAlq1p9z3DP8XTeAVdqwcRCl2Yt5?= =?utf-8?q?CCOrMz47fw3Vv5UBO1UgExCX9oEWfSLB7Qwa+iHUb47YxjC/T0TgQdjXuvXzmHvmw?= =?utf-8?q?X02cGq4RepSJIgCb+FIymK3ssbd4gel09XaHEHP+M3mFOayTRm5OhpIisc3sl4OKG?= =?utf-8?q?8T32MSDRv/nWz2nuAZ2sIGeOr03L7vLAUrVGbdMqXuDiXr5tfFtV8SCuKlSxPExpm?= =?utf-8?q?hsMFBcaUZQYwGowPWR2ZUsS6YrJgOfnwbTt/OVrh/X3VyF8qmANo4rLiqXm09kBPY?= =?utf-8?q?2jAkwXkUVHRWniGHY6c8+A/PxQpYl3GlV1FWAhR5V9y7PT9jdmUienMq4en8mFhQ/?= =?utf-8?q?eUe+fdqx78loyKwSs7KIXNGkOueBaCLvhgEfNOZJ2gz4gO+uFI6Lopo=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)(376014)(7416014)(36860700013)(1800799024)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:33.6777 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 7c06c9eb-d1ab-464d-cca7-08dcf21ba5b6 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: AMS1EPF0000003F.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR07MB8389 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); From patchwork Mon Oct 21 21:59: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: 13844718 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2057.outbound.protection.outlook.com [40.107.103.57]) (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 EAE8B20012E; Mon, 21 Oct 2024 21:59:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.57 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547980; cv=fail; b=Ky3Grtc7bNTaqP/3t0dPDxAnKi9oneXxJEw21OUcF8dOxJ+ABjSfX1dZWif0x2vew0zl0uH/Z8EuzakTysOO7Mx8LDygYSI7VBuY6HD64aXB/rnYdaRRiPqMtptvdw2y8xAy1G9vGXC+9KrquPW0/tvYPH1bKCmDuu5VcsyLSyw= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547980; c=relaxed/simple; bh=V+Yvya7OgHAA5sU7QnJqQ9VHeO+e4BHT9mmnvwVfQ8g=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ZPkcMNhcYuBzLOLDHqZIONXkD6++McVjHPOkO2y3H0HGXWc4HZHvFom//TJ2vS6sQ2nSt+ioYICNmBvDR1oCPMvuqRvepmCFMRtuZ7jIq0nD9wQXO7zjas5FAjCTiegezaACR1IDsb5dVw5BkyH1oNiMSNlZC+ii6om0J968u50= 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=pm3UHxrr; arc=fail smtp.client-ip=40.107.103.57 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="pm3UHxrr" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=PyER0O0QFqwQRrhf3FqVvQQASSSSpwyjOxwTBI+KwF23ra3v9/okSkL/YwnCuBRw21i8RDVySVVZ81q5Brc9LYqQAkHparVfr7rle1zVUh9bs0b5Ti/y5+d4NjDJ122hN2FAdb+0KbV5rk7VRBd+GiORgcz+w6W+1RM4QB6CKi09B3Idtr08zJ16oTlI0qb9jgPK4Ve0hpUWuWFtfmdhydaNjXSIuyvWPGrYYNmTnSFwc4cEYJespZYELGA6WNTy+mEriVL7zYMpBQYkaJedxSNtv0qdIgXz719WcLDnqrBDX6EQMbCOV8P9Gm6AyGvH9eFnQyRzzDuJE6/DZ9p0jw== 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=bfd88KmR3vDR2D6iM9TKzXENTIX9qft+iiHkzKQjoC4=; b=tLH6k+OR1mwfj7NFlGMZbya1Wes2XeBvMFGlbECtSvtlZqviZ4UjV5gdeAk/LCJ8dcL4uWghNJil0yOXg06Yc11Im4Zq7kHwfQhRaZKk/fS6nzxGHpieQSaHD543AJyG689lfd9095N67YfZQtW7/K5mfEwn2a17zLN0RrB2wSkED2YEjtaksUmhFKFwQsRx4bT+qm8op9+Lhdet95UdYL8QdqpKBYharuCl2HUrI2OyophOodducQTHg8+aNJPvqezsm7yFC6p0c8cZ9/WR5DBrL1O0SGMWfFC03lHCHL5oeh6KGwqTC8F+IMr9hZNSpwkVvHkFR9tBYngXP21vCQ== 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=bfd88KmR3vDR2D6iM9TKzXENTIX9qft+iiHkzKQjoC4=; b=pm3UHxrr9KkckGT1s8jUiPPHmiDvbEIV/kyxxTj1r0tWEVnsZ17LbZJXJa1wCWgbdtOuQMQ/rkYXiMenladWIpxGPSHYXc6hhSgjjUDUwy0egcgDbvDficg8m7lYn36qQ3uK2gL229iNtyrTtrt7FJxg3R299gUyKtl43dIMEGFliNf0MUTH67jIfVDweokviCi8fzgRwa4rQwEWhDRgbMgbNMe/62O6BE3mxIu3ne+sTcvy4Oer2qzkQQBHT/QXv97uEeIw4vEu2iqaOMmiCHR8qrP2aEqaxQmu+kqzQOy7n88hydYu6i30/W55OqH3TKhQJv1yhxEG2w6Sa/lAQg== Received: from AM0PR07CA0023.eurprd07.prod.outlook.com (2603:10a6:208:ac::36) by AS8PR07MB7127.eurprd07.prod.outlook.com (2603:10a6:20b:259::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Mon, 21 Oct 2024 21:59:35 +0000 Received: from AMS1EPF00000049.eurprd04.prod.outlook.com (2603:10a6:208:ac:cafe::16) by AM0PR07CA0023.outlook.office365.com (2603:10a6:208:ac::36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.15 via Frontend Transport; Mon, 21 Oct 2024 21:59:35 +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 AMS1EPF00000049.mail.protection.outlook.com (10.167.16.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:59:34 +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 49LLxENR032273; Mon, 21 Oct 2024 21:59:33 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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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 v4 net-next 10/14] tcp: AccECN support to tcp_add_backlog Date: Mon, 21 Oct 2024 23:59:06 +0200 Message-Id: <20241021215910.59767-11-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: AMS1EPF00000049:EE_|AS8PR07MB7127:EE_ X-MS-Office365-Filtering-Correlation-Id: 8b910a2c-6b92-4ec0-f75d-08dcf21ba67d X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|376014|7416014|82310400026|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Qj/57JkhkvAmxP1z/YXYD/5i/1qJ9fj?= =?utf-8?q?TEiVhnU2gNIIkqp19sqkurCsypj+/MqLQgFcKwExdw+B/45eQInYeCdfIzoDXcCIB?= =?utf-8?q?zmkQLIRQzl2s1qBpdrSr/7KCACSLwV7VDxqxhZswca3Pj77EGb+jTpYnEDhyWGshL?= =?utf-8?q?i2li1paTu6YOp9HelMUIgWozLaC3sJHvTuKYg4lIM9aU4A1piHVJUxmj3jmu1CJAc?= =?utf-8?q?uhQovieJ/O9YEp25Ua1IFd2FyIsJloQrBmP5FWFo5vIoqOzq5OxO8FjVsPiYDq965?= =?utf-8?q?13joag4wDhGfNVSxrvXINoZkfiqvy9D1sOabBL5z6gWo/BjwDt9EP3HnTaRuMOy0F?= =?utf-8?q?WJ7c0+FebnnnnQaPubBwBP+ISI52Ccg1iTDHV+/uin53v/Nl15QnUDELafVdgZ8nI?= =?utf-8?q?ZYmFHuWfr7F/jHg2ZdAwH9OPeDHS+1dfGFzS8PY6qVAymmZleuyp1JyoYvynRmmU2?= =?utf-8?q?OaJmBkoB/biUWX2fmw5+opvjQ60b/Lb/+zhdE6Yy7AzEby1PcPhp4beyqCxfvvhDt?= =?utf-8?q?Q8pXWC2TQGGd6Pfw80ZbJU9mlzftBvIcABDrzF31fTD9y9DmWyOs4eCXkBsomH4mO?= =?utf-8?q?7+/Nm1+7UAhWgIW8ompAz7WcGB1Wq/0GMoTNi1mE3cZK2G9PnEKG0miQqk2tisU+u?= =?utf-8?q?WqeJmyl2kjdlwP/A/cyOoYe9Sw8Y7lS8OjhFZ6+xa46cDbpjBWQeZukqSqTaPXHJ4?= =?utf-8?q?E0y/PrqJrBSqXKuq58I+4oFTgj4yR7iWXZ/5T6mu5hYm2TMl8MDA1IgrBGKsWmhE5?= =?utf-8?q?Z667WpGEJniZHOYFHnrQAaP4MLSK51BcDda9AipavLkHcpcMcROH0PACnWvWhfz4c?= =?utf-8?q?kF5bbNK1eZuFiOCvEAtjk9MSrhLEW6bqsF6rmp7blNLkXtYse9KMc3BsrPBaiJu+v?= =?utf-8?q?oSG+nORc4pCDs1Obldbh3rKxcEtaQlcz5z6OFJcqHVgBYv6C45TFZ4SJ816CilOFQ?= =?utf-8?q?RDWCZ4Qq5OZ8kyqbdJQhmU1bk6nneL2h2KZhXMnhiHiiAJXELipqCzq8K/Iwn/J++?= =?utf-8?q?WTf3CNZSHAMfzi4kuF3vamPnolx03jsvabNd9s/AHTfqOjiyFon+JBqHgMO81Q0o4?= =?utf-8?q?8+mOSSM+60v+RJtscASPbgQk0shnsCEHP/eVXhP0L5PJg/6toYLZgLodiYr//bLTz?= =?utf-8?q?fdmI7yteOGkVa5SvqTeyvTYyM8GUc7DRT6/r6mG/boaCrpjCNYK443NhcZM1NTe5M?= =?utf-8?q?1sTPU3YcLKPW3p59dVzYwZh1ItFoWfbz/Adx5CDedbzDV6nevsNbdAFzRjk7qsf5d?= =?utf-8?q?1p00ivsLgh8jIcQNRhY4t2ocINs/FfFt2UhUJFFzeDFUE6/yzbaIMiD2QP0gAyR9e?= =?utf-8?q?q7YwDliCfHTn2m9E8MZSRFWYMlTGzFFRioaaIurRa/iOhPCmkXOlcBI=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)(36860700013)(376014)(7416014)(82310400026)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:34.9829 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 8b910a2c-6b92-4ec0-f75d-08dcf21ba67d 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: AMS1EPF00000049.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7127 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen AE flag needs to be preserved for AccECN. Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang --- net/ipv4/tcp_ipv4.c | 3 ++- 1 file changed, 2 insertions(+), 1 deletion(-) diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 9fe314a59240..540fe14bdc32 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -2054,7 +2054,8 @@ bool tcp_add_backlog(struct sock *sk, struct sk_buff *skb, !((TCP_SKB_CB(tail)->tcp_flags & TCP_SKB_CB(skb)->tcp_flags) & TCPHDR_ACK) || ((TCP_SKB_CB(tail)->tcp_flags ^ - TCP_SKB_CB(skb)->tcp_flags) & (TCPHDR_ECE | TCPHDR_CWR)) || + TCP_SKB_CB(skb)->tcp_flags) & + (TCPHDR_ECE | TCPHDR_CWR | TCPHDR_AE)) || !tcp_skb_can_collapse_rx(tail, skb) || thtail->doff != th->doff || memcmp(thtail + 1, th + 1, hdrlen - sizeof(*th))) From patchwork Mon Oct 21 21:59:07 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: 13844720 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2061.outbound.protection.outlook.com [40.107.103.61]) (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 AA239200C8C; Mon, 21 Oct 2024 21:59:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.61 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547983; cv=fail; b=QJEK/48QreXNqiD/Di4miZriNi6+D91cRzEM3+8akWiwY/odDdn/1xI5e0bs7qQyLpnqYs5HnTHTaD207Po15zBymcM4twq0cxl0CcqohizUauBUtIQhcbFpAxhdyQagcyBc8Lm2bfUQKPVwapQg7K50t4xjpRQu9YL0ASPUqxI= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547983; c=relaxed/simple; bh=2aVgHO6e2ffeK21NnxaoFTQm7n0pQspgDtcP9of8t68=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ojMJDIMAUQ2Ns8nlEnuNqYEQRw3i3w3F2s8zoeNnvBjK53Z5pD8cYpI3CMYGuWR+lJtScUeBbPx9jcrn6CzqIAck+xdUMq42yH1qDpKRCmCsuQDw6l9KM9105ekMbeTA6H7LRXlT5O5GvMel+AYFdIm2P9/hOfAkz/ixMpTjW4o= 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=C7wf5cZO; arc=fail smtp.client-ip=40.107.103.61 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="C7wf5cZO" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=N4QnUnFIuwKlrV9nu+GOdcrPcK3BtwenfMcOpWr4uvGbz9LqJHDc9sJC0MqspZrl3QKDXVc37fWygJStYAMeRikq97k7Jix8NDwhDJ84WDalQqyUf8y8djnZiUQQVN98gh65Dzkx8DpKfPbQ6vOe5iuZJRKVZmWyLTflwi7JvDJJYXEu0jiCo+DlM6aJRTF9NCpw8lINKObswjSvmrcoGShP7fBWmHZFKrn9gGMwVjzQYC/VDapVNRA/IJRLvSe/3UzowOGM3UFL+7BR58/hGzYuebtuLh8+tyRIv74nFopWcrAP3S5TUK8ykRhwtf03e497D1Z4n6VQDSJp2xTCJg== 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=uvbkjnKkQWt039ALXqDtPQSLxUPIshp0cwz25EYtHmc=; b=rYoeNNmQrp2jyV6SUyrbZaDS3yQ9ymvIo64b87KJJaUf3g+AaMv/Lb1zrtNaYqAxq20kmGoMLEUI4zAmZPMAdIQm0VwMdtN/yZ451z+WjHqpneKFGJWI+CNj/lIdU2GFE3fD3JimY/YCeLBJYvt1Fq1yoNFOevR43gNYX/ZXcxiZao0LiUYRADXFYeVPTcExIj7e/AtHbyO8k3ylp29C8b4wu3O33YAstELHq9Bgjk09ughMq2Qe4VClEsCNISfKWWFnIlhdw86hXzyeayS05DdAvflXBeIz6Nc/KdkzoMZu4Y7auOI0qridOobphmBxUxv+h4xuSsBEAeydTYXsPg== 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=uvbkjnKkQWt039ALXqDtPQSLxUPIshp0cwz25EYtHmc=; b=C7wf5cZOCUl+9VG9xZbk8tOPqelC21Losp5zpLqkhLJO9/xzWCDRdpuKUKTCZN7k9V1mCu1S/QU7NjB5yyY0WDyribX+70rTGHkY5mXdXjKHF2AqEYwX5Lgi7oPRRU8jO4OlSeq0UQQdtmBBhCCpTJKg8eUW3+nV9MDDTVgezhZq8K75uwz3UNMR2h+WxaGqB5nRlVrrsaFLviWb3eveqW6wqVSqZRoxjqrF+OMpDLx1SHKNiTdxMhzQhgboa9ulDq7lN8YXoio81n4XOjCQXyI0Azo50w+J+dzSj4s6pwIu5ePuvOAcxxIMu4/3S+pSwc5+KgOLZIY4t/QjDPfwcA== Received: from AM6P191CA0004.EURP191.PROD.OUTLOOK.COM (2603:10a6:209:8b::17) by PA4PR07MB9634.eurprd07.prod.outlook.com (2603:10a6:102:267::19) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.27; Mon, 21 Oct 2024 21:59:36 +0000 Received: from AMS1EPF0000003F.eurprd04.prod.outlook.com (2603:10a6:209:8b:cafe::c0) by AM6P191CA0004.outlook.office365.com (2603:10a6:209:8b::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28 via Frontend Transport; Mon, 21 Oct 2024 21:59:36 +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 AMS1EPF0000003F.mail.protection.outlook.com (10.167.16.36) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:59:36 +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 49LLxENS032273; Mon, 21 Oct 2024 21:59:34 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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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 v4 net-next 11/14] tcp: allow ECN bits in TOS/traffic class Date: Mon, 21 Oct 2024 23:59:07 +0200 Message-Id: <20241021215910.59767-12-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: AMS1EPF0000003F:EE_|PA4PR07MB9634:EE_ X-MS-Office365-Filtering-Correlation-Id: 9da0be08-a68d-4eba-314d-08dcf21ba740 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014|7416014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?YysiY02J6ndFLdbSG00ySthVmQgZTvn?= =?utf-8?q?5B7yrskygpaRgOu/uEFDwALHexOu5VY9dOHBJ77Pxo7d38uwUMC2MgZkBRCY09neE?= =?utf-8?q?XThmFTHNpuDFQAzx40p0KkMZ9HjdLfVYKHudVTuKU8nGBlNNVfr8MLwHGDMtdhfGg?= =?utf-8?q?JJ79BSwVUCW4DNPW3RPrtKAMu9GgIulGN5/v9x245hdrABUgpOITeVhu9g3uukWOJ?= =?utf-8?q?DczRa7VuJR+/Jw/0QUbdhT32lVt+kot+/gjqBd3i/NZ3U4z4lHlSSy8t+InfFYKNT?= =?utf-8?q?BtQyigOfO/JBY45AMMMsRUaGxQUveuPOnv9Sa4TED7MWRAwyaJZyzy/3g6wVPpHlf?= =?utf-8?q?2U9A6ssSenkq9jV5DtH0U70Y1W8vJU3mKE13DHzjN66wnT7HAqUzi9BMXba6oThOn?= =?utf-8?q?vstX1MeK3xbPkwAlCHxxM7kY4XRvAkq90II/Z3Cq3+e1DzNtL11sz6nu04GKzyBuP?= =?utf-8?q?htsmOOHAPfhIpjiHe+f41M8yGU9QrOi8m4E4mwMOerMx8BVYew7UogclIkvQyGeh5?= =?utf-8?q?CqVrZZZCfGk7+hTINtift/4zHIJC1iWluo2CSl5VVQ5jCFJ+Ez8TWekS9dqvdpKln?= =?utf-8?q?/9NVn6A6Gf/QmCd7sqBIBdZOSJeV+9ofU4Qe11NRTeqHWcy+deRJC1atRghWsxiQf?= =?utf-8?q?zai2biycpu6qTFhVz2hqDkiOxfnyKfnZ/loMibmUglfnzYiPiEWyOuUfIucnGoL5A?= =?utf-8?q?3li+Lzi5gNtZwaEONQnWSlZquNWcqcZQgfZi/JfWetXxweWSPXKcVrhvmdhu8B87n?= =?utf-8?q?m2phDHhRxD1x1BEidF8im15SwRI8RJuMUIPzKw19zKlX+LGcoRBfxXgPTZ5ONtsCo?= =?utf-8?q?R3aMFDp97C8LEkcWLi54n2wBONTJPhDJ53rKmcqKu5E16Avxl2F2Xmh/ebywcji3e?= =?utf-8?q?a5XjSxyaZZgrhtrIKuBCY6B+EZ4D7t6T6K02vLvwTMS7w40hYAjWccn6xbvHNFcYi?= =?utf-8?q?f+7KNx5KSaNeuJiQdlqtlqnhMnqTTtiZAIf1n4dWis4h4V7tLJ+aOAw3/Ht9aS3lP?= =?utf-8?q?t8hWvViH3EZLBF5w/wv9aoS/OhDPilJJaiCJmudsfI3P5S5wSTva36fpcHmRt2Zy1?= =?utf-8?q?/1ValztLc9EuLpFmygcAewnU4uNl7/ckMhylOljae16Ma+DgAW0BZSwmWdmCSPP9Y?= =?utf-8?q?WNS0nHcryNdIhM92Pk19LCHms9H8iRBbUI2dkXgodv4Ml6i3h05VKkv3h7x745cM7?= =?utf-8?q?i+cX5hNWcdRnXACyiZrepw52maHwbsP/Kf2swkPtMHIDcE3dkj3Lz40mAYScTob1S?= =?utf-8?q?+Qs2WYcmAhkqDKYjaP0+oDccXyTPTyPGfp5NpURrmWu/9qxOf70XsKFzvHWNB0wHh?= =?utf-8?q?QRAEsbcdkkqrPeHdhLPKAcI2v8gwadJ7fyNtmTTmjXdXWRh/mKqx69I=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)(1800799024)(82310400026)(36860700013)(376014)(7416014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:36.2558 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9da0be08-a68d-4eba-314d-08dcf21ba740 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: AMS1EPF0000003F.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PA4PR07MB9634 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen AccECN connection's last ACK cannot retain ECT(1) as the bits are always cleared causing the packet to switch into another service queue. This effectively adds a finer-grained filtering for ECN bits so that acceptable TW ACKs can retain the bits. Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang --- include/net/tcp.h | 3 ++- net/ipv4/ip_output.c | 3 +-- net/ipv4/tcp_ipv4.c | 23 +++++++++++++++++------ net/ipv4/tcp_minisocks.c | 2 +- net/ipv6/tcp_ipv6.c | 24 +++++++++++++++++------- 5 files changed, 38 insertions(+), 17 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index b6a4e0124280..d348ea9be172 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -417,7 +417,8 @@ enum tcp_tw_status { TCP_TW_SUCCESS = 0, TCP_TW_RST = 1, TCP_TW_ACK = 2, - TCP_TW_SYN = 3 + TCP_TW_SYN = 3, + TCP_TW_ACK_OOW = 4 }; diff --git a/net/ipv4/ip_output.c b/net/ipv4/ip_output.c index 0065b1996c94..2fe7b1df3b90 100644 --- a/net/ipv4/ip_output.c +++ b/net/ipv4/ip_output.c @@ -75,7 +75,6 @@ #include #include #include -#include #include #include #include @@ -1643,7 +1642,7 @@ void ip_send_unicast_reply(struct sock *sk, const struct sock *orig_sk, if (IS_ERR(rt)) return; - inet_sk(sk)->tos = arg->tos & ~INET_ECN_MASK; + inet_sk(sk)->tos = arg->tos; sk->sk_protocol = ip_hdr(skb)->protocol; sk->sk_bound_dev_if = arg->bound_dev_if; diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 540fe14bdc32..3d836e0f099a 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -66,6 +66,7 @@ #include #include #include +#include #include #include #include @@ -887,7 +888,7 @@ static void tcp_v4_send_reset(const struct sock *sk, struct sk_buff *skb, BUILD_BUG_ON(offsetof(struct sock, sk_bound_dev_if) != offsetof(struct inet_timewait_sock, tw_bound_dev_if)); - arg.tos = ip_hdr(skb)->tos; + arg.tos = ip_hdr(skb)->tos & ~INET_ECN_MASK; arg.uid = sock_net_uid(net, sk && sk_fullsock(sk) ? sk : NULL); local_bh_disable(); local_lock_nested_bh(&ipv4_tcp_sk.bh_lock); @@ -1033,11 +1034,17 @@ static void tcp_v4_send_ack(const struct sock *sk, local_bh_enable(); } -static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb) +static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb, + enum tcp_tw_status tw_status) { struct inet_timewait_sock *tw = inet_twsk(sk); struct tcp_timewait_sock *tcptw = tcp_twsk(sk); struct tcp_key key = {}; + u8 tos = tw->tw_tos; + + if (tw_status == TCP_TW_ACK_OOW) + tos &= ~INET_ECN_MASK; + #ifdef CONFIG_TCP_AO struct tcp_ao_info *ao_info; @@ -1080,7 +1087,7 @@ static void tcp_v4_timewait_ack(struct sock *sk, struct sk_buff *skb) READ_ONCE(tcptw->tw_ts_recent), tw->tw_bound_dev_if, &key, tw->tw_transparent ? IP_REPLY_ARG_NOSRCCHECK : 0, - tw->tw_tos, + tos, tw->tw_txhash); inet_twsk_put(tw); @@ -1157,7 +1164,7 @@ static void tcp_v4_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb, READ_ONCE(req->ts_recent), 0, &key, inet_rsk(req)->no_srccheck ? IP_REPLY_ARG_NOSRCCHECK : 0, - ip_hdr(skb)->tos, + ip_hdr(skb)->tos & ~INET_ECN_MASK, READ_ONCE(tcp_rsk(req)->txhash)); if (tcp_key_is_ao(&key)) kfree(key.traffic_key); @@ -2178,6 +2185,7 @@ static void tcp_v4_fill_cb(struct sk_buff *skb, const struct iphdr *iph, int tcp_v4_rcv(struct sk_buff *skb) { struct net *net = dev_net(skb->dev); + enum tcp_tw_status tw_status; enum skb_drop_reason drop_reason; int sdif = inet_sdif(skb); int dif = inet_iif(skb); @@ -2405,7 +2413,9 @@ int tcp_v4_rcv(struct sk_buff *skb) inet_twsk_put(inet_twsk(sk)); goto csum_error; } - switch (tcp_timewait_state_process(inet_twsk(sk), skb, th, &isn)) { + + tw_status = tcp_timewait_state_process(inet_twsk(sk), skb, th, &isn); + switch (tw_status) { case TCP_TW_SYN: { struct sock *sk2 = inet_lookup_listener(net, net->ipv4.tcp_death_row.hashinfo, @@ -2426,7 +2436,8 @@ int tcp_v4_rcv(struct sk_buff *skb) /* to ACK */ fallthrough; case TCP_TW_ACK: - tcp_v4_timewait_ack(sk, skb); + case TCP_TW_ACK_OOW: + tcp_v4_timewait_ack(sk, skb, tw_status); break; case TCP_TW_RST: tcp_v4_send_reset(sk, skb, SK_RST_REASON_TCP_TIMEWAIT_SOCKET); diff --git a/net/ipv4/tcp_minisocks.c b/net/ipv4/tcp_minisocks.c index bd6515ab660f..8fb9f550fdeb 100644 --- a/net/ipv4/tcp_minisocks.c +++ b/net/ipv4/tcp_minisocks.c @@ -44,7 +44,7 @@ tcp_timewait_check_oow_rate_limit(struct inet_timewait_sock *tw, /* Send ACK. Note, we do not put the bucket, * it will be released by caller. */ - return TCP_TW_ACK; + return TCP_TW_ACK_OOW; } /* We are rate-limiting, so just release the tw sock and drop skb. */ diff --git a/net/ipv6/tcp_ipv6.c b/net/ipv6/tcp_ipv6.c index 252d3dac3a09..9beba4dc2f42 100644 --- a/net/ipv6/tcp_ipv6.c +++ b/net/ipv6/tcp_ipv6.c @@ -997,7 +997,7 @@ static void tcp_v6_send_response(const struct sock *sk, struct sk_buff *skb, u32 if (!IS_ERR(dst)) { skb_dst_set(buff, dst); ip6_xmit(ctl_sk, buff, &fl6, fl6.flowi6_mark, NULL, - tclass & ~INET_ECN_MASK, priority); + tclass, priority); TCP_INC_STATS(net, TCP_MIB_OUTSEGS); if (rst) TCP_INC_STATS(net, TCP_MIB_OUTRSTS); @@ -1133,7 +1133,8 @@ static void tcp_v6_send_reset(const struct sock *sk, struct sk_buff *skb, trace_tcp_send_reset(sk, skb, reason); tcp_v6_send_response(sk, skb, seq, ack_seq, 0, 0, 0, oif, 1, - ipv6_get_dsfield(ipv6h), label, priority, txhash, + ipv6_get_dsfield(ipv6h) & ~INET_ECN_MASK, + label, priority, txhash, &key); #if defined(CONFIG_TCP_MD5SIG) || defined(CONFIG_TCP_AO) @@ -1153,11 +1154,16 @@ static void tcp_v6_send_ack(const struct sock *sk, struct sk_buff *skb, u32 seq, tclass, label, priority, txhash, key); } -static void tcp_v6_timewait_ack(struct sock *sk, struct sk_buff *skb) +static void tcp_v6_timewait_ack(struct sock *sk, struct sk_buff *skb, + enum tcp_tw_status tw_status) { struct inet_timewait_sock *tw = inet_twsk(sk); struct tcp_timewait_sock *tcptw = tcp_twsk(sk); struct tcp_key key = {}; + u8 tclass = tw->tw_tclass; + + if (tw_status == TCP_TW_ACK_OOW) + tclass &= ~INET_ECN_MASK; #ifdef CONFIG_TCP_AO struct tcp_ao_info *ao_info; @@ -1201,7 +1207,7 @@ static void tcp_v6_timewait_ack(struct sock *sk, struct sk_buff *skb) tcptw->tw_rcv_wnd >> tw->tw_rcv_wscale, tcp_tw_tsval(tcptw), READ_ONCE(tcptw->tw_ts_recent), tw->tw_bound_dev_if, - &key, tw->tw_tclass, cpu_to_be32(tw->tw_flowlabel), + &key, tclass, cpu_to_be32(tw->tw_flowlabel), tw->tw_priority, tw->tw_txhash); #ifdef CONFIG_TCP_AO @@ -1278,7 +1284,8 @@ static void tcp_v6_reqsk_send_ack(const struct sock *sk, struct sk_buff *skb, tcp_synack_window(req) >> inet_rsk(req)->rcv_wscale, tcp_rsk_tsval(tcp_rsk(req)), READ_ONCE(req->ts_recent), sk->sk_bound_dev_if, - &key, ipv6_get_dsfield(ipv6_hdr(skb)), 0, + &key, ipv6_get_dsfield(ipv6_hdr(skb)) & ~INET_ECN_MASK, + 0, READ_ONCE(sk->sk_priority), READ_ONCE(tcp_rsk(req)->txhash)); if (tcp_key_is_ao(&key)) @@ -1747,6 +1754,7 @@ static void tcp_v6_fill_cb(struct sk_buff *skb, const struct ipv6hdr *hdr, INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb) { + enum tcp_tw_status tw_status; enum skb_drop_reason drop_reason; int sdif = inet6_sdif(skb); int dif = inet6_iif(skb); @@ -1968,7 +1976,8 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb) goto csum_error; } - switch (tcp_timewait_state_process(inet_twsk(sk), skb, th, &isn)) { + tw_status = tcp_timewait_state_process(inet_twsk(sk), skb, th, &isn); + switch (tw_status) { case TCP_TW_SYN: { struct sock *sk2; @@ -1993,7 +2002,8 @@ INDIRECT_CALLABLE_SCOPE int tcp_v6_rcv(struct sk_buff *skb) /* to ACK */ fallthrough; case TCP_TW_ACK: - tcp_v6_timewait_ack(sk, skb); + case TCP_TW_ACK_OOW: + tcp_v6_timewait_ack(sk, skb, tw_status); break; case TCP_TW_RST: tcp_v6_send_reset(sk, skb, SK_RST_REASON_TCP_TIMEWAIT_SOCKET); From patchwork Mon Oct 21 21:59:08 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: 13844719 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2083.outbound.protection.outlook.com [40.107.22.83]) (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 C00941FE116; Mon, 21 Oct 2024 21:59:41 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547983; cv=fail; b=M7ZAEe8kdphcYzBm3XbmL0g4FNo2AjzyZpOEof/b3fv3LxfWjvdzWg12/xyqURggM37NHuzhTZMVsIOtMMuAFqrcSkMZPl/NY2zwju6j7zlu57N6+qbv13ma7aHi9aENDE6CLu1WQS2gSIUZxBfRl2n4JJKRM2Y8C+4Nhgp0vp0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547983; c=relaxed/simple; bh=UtKvF2A85J1YpCN00/2xMK7AfJNPRzHn8FJ1Dc7Tiro=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Zd7N0mziPoSIowRrx/5kAZ5iuvKbVtjnfDsJ2WKWVEhWcwUayCglcy+AIgSSG2hNZlTY+bXZg1NbYdRz8hjmuT+twR7WFpSrXY/7Ui6s6lSGdhLvSF4djkOnQqT6LTILDfCDVKZ3WC5rSmV7+p9VNHFYryGpmU2CEVxHGaEWJR4= 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=Glmuc3dK; arc=fail smtp.client-ip=40.107.22.83 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="Glmuc3dK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=E+6MgHZ4mx4P/Hr48+7RlkwUbLp02MemPtcRxHRyhqoukRQ2jspoVSEyYvUXmuRS2JpDWsYfLRVtEL45clezRmJwralfHjLgi6iMyqMxsbzaBDLdKNNXYfkZlgeSpNLvgHrHPdraDvEJug7vy/4oM/tbzKrqckqHXl7AA9x9VcMLEiXqyMUtz8/7/DbmegmBXq6EQOcDQrfLsXCo4uR+wJZs7OuoKdFVogxUeWOy3jnge/KOGlvfrVsvTCLpfcxjvsvLPszQRxjg8sGcGGksu12dh3D0Z2dDQ4cM4u9rfoDQ5jz3GSH9LVNcSheKuJBfoAB2LDYpIr1ZtjVWmvvfFg== 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=evuwPAKFfK5xlB++jG+LcM/1cDYl6Tr3X2lvjgrTehA=; b=i5BmFgNCEKf2r6NwZ/4Z9NxeQ8WepWJaobyGa+Ph7B4B448ti4FT9Z3HXVTbCCvD4rBE5MJlWGWvez/jhRCA6KKryrk+BZpe+KhjM7n8wjlJzKQa2us+i2IdRpm02ZDyaqgKtg/1fa4FlPt9sw0YjA/+/yX5KXY5VDqq1vcGN7/v+iD7bTqi9QDV/lpOQGqWhaX27aJV5bY3XK7L0G6wx5Ezq5mq6BbrMv2p45wkIs9bPgGv48xDi39sKmCp0kwEanVR4jP2EVISLlN2zoePaelcWruMEYr9bPMDW9GtWGNn4nn+HoxKNBkSFexezXW61nDNdTHje7i48GHGfk/7XQ== 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=evuwPAKFfK5xlB++jG+LcM/1cDYl6Tr3X2lvjgrTehA=; b=Glmuc3dKtrUY8tXiB9cH11DX4GRfyGiXvDQkRoIg29SkUEEOZbzlbbLGa/V9kk8WJqf2NbpbJ84SjwilF/lTaMuHuKRFbo5z2zK9LkFLJf1dk4s7bD49fkNFK1sax7jYoNdNl+zQbLtnJ41Vpj9G8n2wd6aoQYJZQ/+Dxbq3uW+rluq3F3ztRpwoIXPPwePW63CTJjGMH2UxTcWKc7Dd7csbG+t5Upm8tKHUf3isZPDRAxud4gK5ME0mCk1OlqovP/j/NBbB1OJaU3+biG5jbZpFkGPwC1kqWvDYvHsAzra8EH2HNly9BsRnfuCPUaJ5Mxd9tsKrHTmD6H/zdUW0kA== Received: from AM0PR07CA0011.eurprd07.prod.outlook.com (2603:10a6:208:ac::24) by DB9PR07MB7707.eurprd07.prod.outlook.com (2603:10a6:10:1f9::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28; Mon, 21 Oct 2024 21:59:37 +0000 Received: from AMS1EPF00000049.eurprd04.prod.outlook.com (2603:10a6:208:ac:cafe::e6) by AM0PR07CA0011.outlook.office365.com (2603:10a6:208:ac::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.15 via Frontend Transport; Mon, 21 Oct 2024 21:59:37 +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 AMS1EPF00000049.mail.protection.outlook.com (10.167.16.133) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:59:37 +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 49LLxENT032273; Mon, 21 Oct 2024 21:59:35 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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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 v4 net-next 12/14] tcp: Pass flags to __tcp_send_ack Date: Mon, 21 Oct 2024 23:59:08 +0200 Message-Id: <20241021215910.59767-13-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: AMS1EPF00000049:EE_|DB9PR07MB7707:EE_ X-MS-Office365-Filtering-Correlation-Id: 02ae915f-d0e0-4348-5c9b-08dcf21ba807 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|36860700013|82310400026|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?AFWGZVF/U7EpP2f9q/9Equm4TqKj8lM?= =?utf-8?q?1EPer3ctBUJl7d5wxUwyd+8s9c/C/gb1E2v/ls8br7XiC6/LTiJ04JvqtGFEnwyCZ?= =?utf-8?q?OrSzasl6aDWq8se0sjVueW7lIuUpyuBY1rOmd50+MzGBELfjQB9+Km8vrvqdjkdft?= =?utf-8?q?J5eCoqlxG9ceUSTdXpm3wkzuf+Xde1Nq7+22HPzToaNMOJvRPFFdeFiEmrSr6Gjpp?= =?utf-8?q?AqvhcqMwTeuFGjcAk0OYgv2RIpIYmhXlQSUttiz8ZFP2ngEFnC3vdgf+qS4A98lgk?= =?utf-8?q?G9uaABdAlFdZ5c1Ssk3Qv7FR1xuHl33crCjeySwzyMC4WHqsBJaQkJ56kAO8K/snR?= =?utf-8?q?WDdAXkCWjUaUWCkGDfWJuf/jiaQ9SN3y6ocRAT/LfZGyESddqrEnwTmADPpG+gSNw?= =?utf-8?q?4aTokPvXP9JZ3z5PAaqVbm5i6sH9RDWnhLpIjl2KtVejV0Ps7Q6BCo/joLCLcgKZo?= =?utf-8?q?n6bvtDmT4FcUHV7VH2813v9I3CGLwMbqJ280jt4ZthgyJ1CI6d7S4tROHsTH/d/gK?= =?utf-8?q?0nDjcoa3F32CR5SU6BptORhcycg7ULZQOQwnmgIxu7AxQt/xeFr7vxzer0gbKZiHa?= =?utf-8?q?UlZDOvTKzKZRF0FOEFFp8QnEiB0/zDjVkAold2nYYxr157fQzqj6bnJwH/rRWzh2d?= =?utf-8?q?VUfUI1sMdsJWprn2Vnsl7+LMMJo1mK8Tv0WlYQqONq8s8dzy33hNBjeAGl1raOXvt?= =?utf-8?q?oxsIh1n+/iru2Qjn2JH4Gmb0wGz4t4sw8yQ1Y4ATGh7tBw1u82IZf0tc6O6WQBMHi?= =?utf-8?q?M5sL0AzfwhGF/6XQDT75NrXJqHBN0qbbgr+c1X6gTovhJp1yT/FQ8mMeHNF0udFSY?= =?utf-8?q?Ue1G7/MBtQtNeudvaMttmmPztM34f8Fv7lv2CU/sbniYSZI7R/YfdR7W+84YCLwBI?= =?utf-8?q?9hx9H0ywljYODrMcj7N0K+lS/HzhvJnHprwxtSfIynpa+qLGA0h7HUu56+o4LDvDt?= =?utf-8?q?YdmXINKLfuEVRDpu+1gVQaYLzdgQzOKsWAx0/wxBoBaFNQOWFubb9w91zWgo8qCZx?= =?utf-8?q?eGmYKxvMQQM5zQUW/XczT04ETAyfoLlpKrhHfdVG7VMjXdPzI633HqRUqQgPoAvh0?= =?utf-8?q?uFlcksdTIsDR5nCR9o7NUWBPE3J0eTnt01csF1plY4h2/caLm3g3s4RBcYMft221d?= =?utf-8?q?N2kouyKksGGol8d0Ho1fsFsbv6YbGHK1YzYhV28JC6GBLbL0Ero+UpJderiJrE72g?= =?utf-8?q?Esg7V6elpDsW5foGLfV4wRKrHW62gZWwdRs2IWxt/0PZoMarxB1ilZzRzBw/wNVvX?= =?utf-8?q?wT62wTsUPgC6Xg4+Bki5ux16ysR9bPOPEdNBqJFwrXo2H50sQzZQblktyAVuCkzDN?= =?utf-8?q?EjHImcLoeL71bSlMpNl2i5EvD2Kc4TDFQlE9qtbojwblQqZyaDi7rhk=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)(376014)(7416014)(36860700013)(82310400026)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:37.5611 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 02ae915f-d0e0-4348-5c9b-08dcf21ba807 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: AMS1EPF00000049.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB7707 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen Accurate ECN needs to send custom flags to handle IP-ECN field reflection during handshake. Signed-off-by: Ilpo Järvinen Signed-off-by: Chia-Yu Chang --- include/net/tcp.h | 2 +- net/ipv4/bpf_tcp_ca.c | 2 +- net/ipv4/tcp_dctcp.h | 2 +- net/ipv4/tcp_output.c | 6 +++--- 4 files changed, 6 insertions(+), 6 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index d348ea9be172..81efbe1195fc 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -704,7 +704,7 @@ void tcp_send_active_reset(struct sock *sk, gfp_t priority, enum sk_rst_reason reason); int tcp_send_synack(struct sock *); void tcp_push_one(struct sock *, unsigned int mss_now); -void __tcp_send_ack(struct sock *sk, u32 rcv_nxt); +void __tcp_send_ack(struct sock *sk, u32 rcv_nxt, u16 flags); void tcp_send_ack(struct sock *sk); void tcp_send_delayed_ack(struct sock *sk); void tcp_send_loss_probe(struct sock *sk); diff --git a/net/ipv4/bpf_tcp_ca.c b/net/ipv4/bpf_tcp_ca.c index 554804774628..e01492234b0b 100644 --- a/net/ipv4/bpf_tcp_ca.c +++ b/net/ipv4/bpf_tcp_ca.c @@ -121,7 +121,7 @@ static int bpf_tcp_ca_btf_struct_access(struct bpf_verifier_log *log, BPF_CALL_2(bpf_tcp_send_ack, struct tcp_sock *, tp, u32, rcv_nxt) { /* bpf_tcp_ca prog cannot have NULL tp */ - __tcp_send_ack((struct sock *)tp, rcv_nxt); + __tcp_send_ack((struct sock *)tp, rcv_nxt, 0); return 0; } diff --git a/net/ipv4/tcp_dctcp.h b/net/ipv4/tcp_dctcp.h index d69a77cbd0c7..4b0259111d81 100644 --- a/net/ipv4/tcp_dctcp.h +++ b/net/ipv4/tcp_dctcp.h @@ -28,7 +28,7 @@ static inline void dctcp_ece_ack_update(struct sock *sk, enum tcp_ca_event evt, */ if (inet_csk(sk)->icsk_ack.pending & ICSK_ACK_TIMER) { dctcp_ece_ack_cwr(sk, *ce_state); - __tcp_send_ack(sk, *prior_rcv_nxt); + __tcp_send_ack(sk, *prior_rcv_nxt, 0); } inet_csk(sk)->icsk_ack.pending |= ICSK_ACK_NOW; } diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index bb83ad43a4e2..556c2da2bc77 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -4232,7 +4232,7 @@ void tcp_send_delayed_ack(struct sock *sk) } /* This routine sends an ack and also updates the window. */ -void __tcp_send_ack(struct sock *sk, u32 rcv_nxt) +void __tcp_send_ack(struct sock *sk, u32 rcv_nxt, u16 flags) { struct sk_buff *buff; @@ -4261,7 +4261,7 @@ void __tcp_send_ack(struct sock *sk, u32 rcv_nxt) /* Reserve space for headers and prepare control bits. */ skb_reserve(buff, MAX_TCP_HEADER); - tcp_init_nondata_skb(buff, tcp_acceptable_seq(sk), TCPHDR_ACK); + tcp_init_nondata_skb(buff, tcp_acceptable_seq(sk), TCPHDR_ACK | flags); /* We do not want pure acks influencing TCP Small Queues or fq/pacing * too much. @@ -4276,7 +4276,7 @@ EXPORT_SYMBOL_GPL(__tcp_send_ack); void tcp_send_ack(struct sock *sk) { - __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt); + __tcp_send_ack(sk, tcp_sk(sk)->rcv_nxt, 0); } /* This routine sends a packet with an out of date sequence From patchwork Mon Oct 21 21:59:09 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: 13844722 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2078.outbound.protection.outlook.com [40.107.21.78]) (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 28B42202649; Mon, 21 Oct 2024 21:59:46 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.78 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547988; cv=fail; b=TxUI5YkHapS/gyhnoTcVbx0wwVpm6mlIyisn6Hl2aeEX7gJl8cwwDjhSY+iHp7mmYwm1rHgOKx5o90y01MozJvn8iehAgCM+qV8SMSg4GzeNgNdORKSl/8Zk33LjmVk6YvivSQnY8nITIrq1ZiqZHZbXP/MvVf7Z3IHolCbAhl4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547988; c=relaxed/simple; bh=InWE5VdTYS9XAJEJCLoyUYuoVX/6u3C5uYfgEWK3+zk=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=uc+XZ/3D3+869nKcwt8FcNtnENL4Bfm/2MzwyawMuOzIZWa44rEPbaQtDI/oLF/d1VigEN509FiLpS6RDMaFh4TP/GCK/3LNWKj2zGoYlZXK0+ONUSH0UMeYAPxNX2+zsu12l+/ayU6uuhBlvs0w09rwv8l/GIk/PGywAM0chfY= 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=tILYPKtA; arc=fail smtp.client-ip=40.107.21.78 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="tILYPKtA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=asSQa+8d7FPJFisgMc8giGZb4zZojVXz44Vw0nHf0S19jYOGw6gnsr1XFEU8y3fqOrkpPEJ0SOxUwOdaO7mxWj4w2qT2wm9fm3wD3c+rq6Z35EbXQJ/JyRc9yG/o9TwjY7YGhQhVwf605R4wTE1bXFU7xs9DBVftPerkiG+8kVF52LY2FJllbVJSQ8OsywezAQUYeScm09vljYLZyDXxaPStBzjlpuv+jdrHED3kdgO2J759ZzLyF8dkrbHPJeOnPbIXPNbdinaxMb8qM7/kS9L4j2JO3jMGFzCW3A191YpkfdmlbC3rI18T07kBXFJnQU/HARiPaYQtoMP3q/1UUg== 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=KjtUDDwqSBTlN8GJJ93JAg7mvHQQiZNwgPW34th73Ss=; b=vx4REsqNhrUVUCImLt7gM/WboWx95h07FqA/fqgK/ETSj28eiQiR4VTcxJr0qA7JCNHgE5vhYDQDMX+Izj+3idn+VYPwH2ihDbCwSPu9i4ANG6o8IAwfTijJ1WZaGNcOvMON6ywoMIvP+GVoT5rkYF0vXG1WcXae3f1NoVx2/duTdgNTuYm8JUf+3yshBdMHh3zOvXS75okog8aJuv8Xey6tf5X68QG+MOgtjdvl9NlPpBTk8e5sWHSRdiuh+IGLjg2y54B6ozxDPV60XMt7dNBfEzfACBUDHwUQ7rtYvGQImF7dl3RlUmbt7zv2uNwwXAdtn34NkgtHmUxSh64SAw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 131.228.6.101) 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=KjtUDDwqSBTlN8GJJ93JAg7mvHQQiZNwgPW34th73Ss=; b=tILYPKtAvucywIigfWJhQWi0knIp2ymRtQCFyB0os45r9TYwe0AF+XmjwJ33IPH1Kzc0M2WhmUU1gr0pwfslrlppCSPxfPsLa07ZqpzyZ9dST3o4NqP68UZZldMBhjcrd7kTdWHBIFOxTOA6fk4fvUImk9puloemr7Fd9yty3wizjMq9q32rfG5pdO4WWdW/yJKwoZVTWsd1bRGlS23xXWXERFH+OtsI2djiIq5IsbCxu9Z5p7sBZW6DRu80lJFcEowf07/96AvUYiEiqiSRvya8p8WsXPWBg/73elBdx0p3Smb8b9qGQJXeuxJLo99DDRzHr4yQwIsDOvVbq6jjfA== Received: from MW3PR06CA0027.namprd06.prod.outlook.com (2603:10b6:303:2a::32) by AS8PR07MB9495.eurprd07.prod.outlook.com (2603:10a6:20b:633::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.27; Mon, 21 Oct 2024 21:59:42 +0000 Received: from DU2PEPF00028CFD.eurprd03.prod.outlook.com (2603:10b6:303:2a:cafe::a3) by MW3PR06CA0027.outlook.office365.com (2603:10b6:303:2a::32) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.28 via Frontend Transport; Mon, 21 Oct 2024 21:59:40 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 131.228.6.101) 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 fr712usmtp1.zeu.alcatel-lucent.com (131.228.6.101) by DU2PEPF00028CFD.mail.protection.outlook.com (10.167.242.181) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:59:38 +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 49LLxENU032273; Mon, 21 Oct 2024 21:59:37 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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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: Chai-Yu Chang Subject: [PATCH v4 net-next 13/14] tcp: fast path functions later Date: Mon, 21 Oct 2024 23:59:09 +0200 Message-Id: <20241021215910.59767-14-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: DU2PEPF00028CFD:EE_|AS8PR07MB9495:EE_ X-MS-Office365-Filtering-Correlation-Id: 56a863bb-d6f0-4260-1b21-08dcf21ba8e2 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?fsqrAMsKdv+Vftdipz1UviktA9sl3x8?= =?utf-8?q?Utmu/igEn+cWq4hGZ2FbyujFFd6axfuLOLZTMovs+/GX42b274frVQeTJXRtifx0a?= =?utf-8?q?TY+NlXuEMyf5P3+r4fqmzVRKGCCVzmTc6FMggU+N7jT+ZTVctCwWk5R6gnqZR4gJD?= =?utf-8?q?Apit5ESVMWyAkjf1fNOtklugGkXIjo7oPwPoTttF2R8KALH1y3uIVnosBHcT+SCgy?= =?utf-8?q?UHSQcNAoHr22aJkw9dbeuKVI4BU00TqO3TPZEUfVcpBqUjudQ2kuah5D6BAM4JiC4?= =?utf-8?q?X/xX830DUES0fDiinXwlITmWcOEOqZcnHhL1Sk6TeumhYsX4IutcXaCLJaFE58rjx?= =?utf-8?q?NR8HGtqZw76Dv7q7Kog7UBtj19oqYH1cUUwhn4TlHXWvF6nZZ9lLvWUCK/lUU66Uv?= =?utf-8?q?oevnbvqQKuMdUw04Rp0qqRFT/dPwvs2jgbciY01rx8uSlpLkF5jHhDiNe7UnRDBpc?= =?utf-8?q?5tF6h4xgCKA3cXLhSzpU1nfWGNW6aK7HdD0mua2PpWgfVldr3ao2jpIW5eCB88yTB?= =?utf-8?q?Ls2mJE93MDw55yjuvuUF2NzXET9fwrC83tNLpMr+49F8p55gFoTxqwFzbT2GjYjL/?= =?utf-8?q?VGVQWGIuv82A49Do6RzROEzsVCa1yzHW1SNyonZTGfIUmNwc374K9ytB1pkUIrfjx?= =?utf-8?q?ys4UwH34PUgoY3bbn+Xzva7y2GQcXpkuyfIe5ksugkAjEY0QyBQ0Lt+HqzTYEyBMP?= =?utf-8?q?aZtvsOCdUy4udnZ1MF5wKSm7bt1kFMT9Uhox6CkvlK2jj6BFnsQ1UlcTdxYs2bJVX?= =?utf-8?q?ARCe+mlKPt1fmv9vVMJVBvRthpKF21hZSvwnHmgRMp0R2HkyHbWUVfTrzTpH1fGRJ?= =?utf-8?q?UQfRznxkPqDst+Qxr4PC4jgbWQYvNo+jvSAk66G778cQ975YpigqcrVh/PpMwLeEW?= =?utf-8?q?ipafbFRsHZOkfpuWV0qrHHkOM4zcj8EIZct8fSn9slLSXcyvB5haTJBt5qRkoxPmK?= =?utf-8?q?8jrFa4NpI2oL5uXqRbPO1lo+lamg4xzqMjNsww1kADBKm2kv6cm9iPhYILtLajZ7l?= =?utf-8?q?2kRyD+f6LO1ppkvmC9r8bv0Hzv0tEzDmcMuEs3o6ohv9IElD6vhIaZL6A15huzJt7?= =?utf-8?q?dbc0OI9341jGlWlixwBHAaYkrX2W2keBNh1eAmtDIBuywesCFE49gy1gk82hD+p9H?= =?utf-8?q?dmcMAHd0AyHQoE7sU9LJaVczileIF1gW0tS7zRxIj/V1WShfiC4JmEWOOgY6MFjJU?= =?utf-8?q?iwQ3l4cfKvK/Ym5pAMnp41iuy4zqX5OYvHSzu2EeHRlPT+DkUdDQK/V6JHcxOWKIS?= =?utf-8?q?BfveUhU0VSv65qf5GmFsFtxcLuIxfc/Cbh3Ki9/unvWd53SXotNYb8bSeeN2wRuRF?= =?utf-8?q?i/AEQ926e4WRFSuHzdb9FjcpBQbus0z9b2Apgg8P5v/XzH8P4RE+60A=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)(1800799024)(36860700013)(376014)(7416014)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:38.9634 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 56a863bb-d6f0-4260-1b21-08dcf21ba8e2 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: DU2PEPF00028CFD.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB9495 X-Patchwork-Delegate: kuba@kernel.org From: Ilpo Järvinen The following patch will use tcp_ecn_mode_accecn(), TCP_ACCECN_CEP_INIT_OFFSET, TCP_ACCECN_CEP_ACE_MASK in __tcp_fast_path_on() to make new flag for AccECN. No functional changes. Signed-off-by: Ilpo Järvinen Signed-off-by: Chai-Yu Chang --- include/net/tcp.h | 54 +++++++++++++++++++++++------------------------ 1 file changed, 27 insertions(+), 27 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index 81efbe1195fc..6945541b5874 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -788,33 +788,6 @@ static inline u32 __tcp_set_rto(const struct tcp_sock *tp) return usecs_to_jiffies((tp->srtt_us >> 3) + tp->rttvar_us); } -static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) -{ - /* mptcp hooks are only on the slow path */ - if (sk_is_mptcp((struct sock *)tp)) - return; - - tp->pred_flags = htonl((tp->tcp_header_len << 26) | - ntohl(TCP_FLAG_ACK) | - snd_wnd); -} - -static inline void tcp_fast_path_on(struct tcp_sock *tp) -{ - __tcp_fast_path_on(tp, tp->snd_wnd >> tp->rx_opt.snd_wscale); -} - -static inline void tcp_fast_path_check(struct sock *sk) -{ - struct tcp_sock *tp = tcp_sk(sk); - - if (RB_EMPTY_ROOT(&tp->out_of_order_queue) && - tp->rcv_wnd && - atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf && - !tp->urg_data) - tcp_fast_path_on(tp); -} - u32 tcp_delack_max(const struct sock *sk); /* Compute the actual rto_min value */ @@ -1768,6 +1741,33 @@ static inline bool tcp_paws_reject(const struct tcp_options_received *rx_opt, return true; } +static inline void __tcp_fast_path_on(struct tcp_sock *tp, u32 snd_wnd) +{ + /* mptcp hooks are only on the slow path */ + if (sk_is_mptcp((struct sock *)tp)) + return; + + tp->pred_flags = htonl((tp->tcp_header_len << 26) | + ntohl(TCP_FLAG_ACK) | + snd_wnd); +} + +static inline void tcp_fast_path_on(struct tcp_sock *tp) +{ + __tcp_fast_path_on(tp, tp->snd_wnd >> tp->rx_opt.snd_wscale); +} + +static inline void tcp_fast_path_check(struct sock *sk) +{ + struct tcp_sock *tp = tcp_sk(sk); + + if (RB_EMPTY_ROOT(&tp->out_of_order_queue) && + tp->rcv_wnd && + atomic_read(&sk->sk_rmem_alloc) < sk->sk_rcvbuf && + !tp->urg_data) + tcp_fast_path_on(tp); +} + bool tcp_oow_rate_limited(struct net *net, const struct sk_buff *skb, int mib_idx, u32 *last_oow_ack_time); From patchwork Mon Oct 21 21:59:10 2024 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: "Chia-Yu Chang (Nokia)" X-Patchwork-Id: 13844721 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR03-AM7-obe.outbound.protection.outlook.com (mail-am7eur03on2063.outbound.protection.outlook.com [40.107.105.63]) (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 2E93E1FE116; Mon, 21 Oct 2024 21:59:44 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.105.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547986; cv=fail; b=iQNMDORBg4cr14r6NtrjFz2vOpW7MX8EHHwtDjh1w876nheiiX93+cLYH6ligR4g2LlsxHl30SKzNBesFMnYQLYZrqjea3AjYX/l5vL/1GAeEcsCnpA0tvh49bTg9nuOrG/YSd24J3K2+QjV3qduXDaL07uqq2PyhtS4Ia3bfjQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729547986; c=relaxed/simple; bh=zwbe4lW9pU5EeZsP72nneaESkytMyQhk2vv7hKnmVW4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=o9ik4tlXf5KTOJy2z5EDsAvQHPcmyfBM3QDN6Z3b8WEbdC8sGJ8N2CFELv1jFJ8nnGs9eX+XFnhaR6MTwkVCHR2M+rSU37FQpWi4Mmf2Oq0fOO1wkZNM5UrQ9tvYQGAK4np047bTWqZx8Xqs0a3EDZiVUGsDToQlqPm8DMvRdWU= 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=SjjHFaHi; arc=fail smtp.client-ip=40.107.105.63 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="SjjHFaHi" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=CXn1jLtgzuQY+OP5N9k12rH70tp7VunTe/oIdpklF+i33whVsgLpXz2n4YLJNMQB6Yo7n7fBCptH/SQ7vo6uJgYnj2AwbAFGUTyXNsDcDi7qsLoDRAmwMwsRP83GI6OK3nmrdZXsxaPubqGuyQ7I2aSfE8pzrCOC4lbavB4C7M9hi0Srqs8v69UHHXa2515hAmO9hhoNanhTEr/ZQNNrlVWjLUUyUJXYfMbXBTt8RphP7SCD7cdyiOszWQiM95myMPbXcDKB2BfqvzjPx3eh2dA8xxY424rKq45qikEco14Byexb09NeCG2/11eJ7xnJmImBaEHs9NDCSF9sVSG2ow== 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=1JENV3spbOLrAWm9hyeATZILr8aJP1JSqWBvGKpX/K0=; b=aKaUatXZm7jvVu1Kg51QZbnDM67Ytma23TVsQkUNnsQdv2CwiiKS5z/6NjbemGNOuTIeghxAD+xjk2VsgQ0EjMfpXvWXiW+MVhfgsEWK0w7u3pZ6h1WeF6fGw9UP55asM4hiBbPyWgHk1Mt3XUISBwXUZniMp1V18d6sZysyvY8bwGW9VIoQ5Gr9Qu8IyYUO0Q7xZ7R5BnWBdzzouRQ4kLDXL2wEbmH2TYmnJ+jHiuHSQQOneoriQCkLfFEyysHKwQbHIbeU6Ht/vizOGI4M7LoATc1IIl1T04iUifNMh91c3y4h8u+hmi8N7ProKBzKQWOYKonvxBcPVye6Y4jbGg== 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=1JENV3spbOLrAWm9hyeATZILr8aJP1JSqWBvGKpX/K0=; b=SjjHFaHidWK+YvRsEJ0buEnW5fWnEQeCCwh2jAzlUfQUCTNw4KU/2SbewqlLz7IdRLxnbsV67DWkf216TFvabNTx/bcjNVQpHGfcIrOBGZqPzvzh/59FgDtIceMx6ENF3pX04wG09WWX0lHLx6ZiRrEtZgkcS4HhA9bXfS4aQIMV3Pn0D/mbgbec/z32ILK42QzZkQaJzeL91XMKWPa75NtMXMvOLdwvASxsdhHlqgG4GXe85y7QIMtNaZ3fE8oQAkJ3La6wN4fo2IYmVOyuisjnx/raWdxM4wLtKg5tps/QqnlriGs/2QNdx81xBN6XV12pT1sUyahsbgAbNGt9oQ== Received: from AS8PR04CA0037.eurprd04.prod.outlook.com (2603:10a6:20b:312::12) by AS8PR07MB7110.eurprd07.prod.outlook.com (2603:10a6:20b:255::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.27; Mon, 21 Oct 2024 21:59:40 +0000 Received: from AM2PEPF0001C715.eurprd05.prod.outlook.com (2603:10a6:20b:312:cafe::49) by AS8PR04CA0037.outlook.office365.com (2603:10a6:20b:312::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.29 via Frontend Transport; Mon, 21 Oct 2024 21:59:40 +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 AM2PEPF0001C715.mail.protection.outlook.com (10.167.16.185) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.14 via Frontend Transport; Mon, 21 Oct 2024 21:59:40 +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 49LLxENV032273; Mon, 21 Oct 2024 21:59:38 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, netfilter-devel@vger.kernel.org, kadlec@netfilter.org, coreteam@netfilter.org, pablo@netfilter.org, bpf@vger.kernel.org, joel.granados@kernel.org, linux-fsdevel@vger.kernel.org, kees@kernel.org, mcgrof@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 v4 net-next 14/14] net: sysctl: introduce sysctl SYSCTL_FIVE Date: Mon, 21 Oct 2024 23:59:10 +0200 Message-Id: <20241021215910.59767-15-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241021215910.59767-1-chia-yu.chang@nokia-bell-labs.com> References: <20241021215910.59767-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: AM2PEPF0001C715:EE_|AS8PR07MB7110:EE_ X-MS-Office365-Filtering-Correlation-Id: ce91da09-c0fa-4889-fb7a-08dcf21ba98c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|1800799024|36860700013|7416014|376014|921020; X-Microsoft-Antispam-Message-Info: khs1JpTroN7kA0CkqoMZ5w4zRbq8nExqIUAXgUXDoDE1/2HqC2SuIpLFs3aPewbaxvF7DpP7U0wJjnKjS6ZRuqafZ5GvUFLe7SvBwW4hV41Fv/GpDV6rLHai/to17J3ytP3N79RNYQu0KfAaREO4jh6/HE+uVY86G3ywwLWW2yd4DWhDpWdgrDlVsMcbvzmNMBzf/qqnz0C4GOSvNaNcd2Ta0cvq1Fu30+byLd+Q6W4RCAVPE/bBxlmlMJMUZ3yoGLWPA0cYVneyCZ4HKkgUIyvHD5ZvMJAOJy3jDcotn7QWG+kTMTsRUX5H1899DfH/Na8yWZ2FCgTfHO1LiEdIZ3bNnEhRH93NTHCqEOHrnMdzLCVzg3hsB1aY370A2P39b/JmpFXnPMfCc4CwGuB+fKwcpF/a6aPBZVvCvHqfYGvfPZRFvXuQPWwwqoBv4H2bvEERWVQAyRxiAgPRjYJISTffamkS9e5+FrzXqkR3wcZTqkLzUESel9zZumLVbu/hR9Fx3unXIN2ZMoMFu42vUfjAuBtccNWt19D6LOEeiXQll73kC7OxF7DnG5mtN7TnX276mjJF58MtDOM/fClj+GDtiK5wdfBUgAq9aORtYeXB8GvAcEK0z+A0t4/F3bNPQWCWZiPIQLT7Lsx1HC0KMdhiVM4hPvNOO6V/lOpEQlov048W7lpnsOgmQaUJgf5MRcnI/ykfPtcI+gevcqqDgOEnz/OGaC8UUUATIyaX0JBPAQQFBHyoRcspQZlIzwHNHWGz6PyaJkJDU3HAfRq6ggwFwa1GoLJh0+2bpp9ZSLBR7HIj0p0FObHVOF6U+PemZzx1Lpkb3jSfx0IYatEhmLb/hQn/6yyOZ2QQEgQhrAM48lA4YpjhRZVFOg9erPaE1nCwXWDXbxNKe/y0mWxdKJ7rdnzYBtVNPeRCFZ/1MzVGKFYkrtk+XsA4jg24OWjH+hPSUXLEmga9JVjrLoSAy0njJY3I9qeKDBrq6lAiuvQ54m4gWMBUfmzLDcspr7i1cv2CZEwGn97E/Y7QMnc+GpH19CXzOdS9q6xoVpnKMT5KB1Xs1T3yFez5MJTldYwzD1twmz7qmQpCU3/oMcuk+RYWN5imzENOia/tVTvA7epTgTXR0c5FqUkSoLAvjmk6oIWD2PbZYfrF6cuX+sDTN+JzNSnksR2fOpMtCAcPaepYnQ0rFhJ+TfoeT9YF3F5W1vtgFqhaCOj+kEm/+6HZZVi9D5o2NwZsahrSDGLMVDgGCuw+Hs7418Yh+RFvimPbh2Wf6EV93WL7l1C8ch+AtPmWrBOa+PExzHJAQ8gMRGs9dh12otfYJpo0x7XFgseYDfdtmQ+iVFQ+6bYZQv4ObqFaYeH738iakJJ+Ml9InQGumNkyposyWePq4E+MEwG1wdRjAj2vQ445UUkpAyzo5S7WidhNy5udajv8FuniHF0= 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)(36860700013)(7416014)(376014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 21 Oct 2024 21:59:40.1301 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: ce91da09-c0fa-4889-fb7a-08dcf21ba98c 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: AM2PEPF0001C715.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7110 X-Patchwork-Delegate: kuba@kernel.org From: Chia-Yu Chang Add SYSCTL_FIVE for new AccECN feedback modes of net.ipv4.tcp_ecn. Signed-off-by: Chia-Yu Chang --- include/linux/sysctl.h | 17 +++++++++-------- kernel/sysctl.c | 3 ++- 2 files changed, 11 insertions(+), 9 deletions(-) diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index aa4c6d44aaa0..37c95a70c10e 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h @@ -37,21 +37,22 @@ struct ctl_table_root; struct ctl_table_header; struct ctl_dir; -/* Keep the same order as in fs/proc/proc_sysctl.c */ +/* Keep the same order as in kernel/sysctl.c */ #define SYSCTL_ZERO ((void *)&sysctl_vals[0]) #define SYSCTL_ONE ((void *)&sysctl_vals[1]) #define SYSCTL_TWO ((void *)&sysctl_vals[2]) #define SYSCTL_THREE ((void *)&sysctl_vals[3]) #define SYSCTL_FOUR ((void *)&sysctl_vals[4]) -#define SYSCTL_ONE_HUNDRED ((void *)&sysctl_vals[5]) -#define SYSCTL_TWO_HUNDRED ((void *)&sysctl_vals[6]) -#define SYSCTL_ONE_THOUSAND ((void *)&sysctl_vals[7]) -#define SYSCTL_THREE_THOUSAND ((void *)&sysctl_vals[8]) -#define SYSCTL_INT_MAX ((void *)&sysctl_vals[9]) +#define SYSCTL_FIVE ((void *)&sysctl_vals[5]) +#define SYSCTL_ONE_HUNDRED ((void *)&sysctl_vals[6]) +#define SYSCTL_TWO_HUNDRED ((void *)&sysctl_vals[7]) +#define SYSCTL_ONE_THOUSAND ((void *)&sysctl_vals[8]) +#define SYSCTL_THREE_THOUSAND ((void *)&sysctl_vals[9]) +#define SYSCTL_INT_MAX ((void *)&sysctl_vals[10]) /* this is needed for the proc_dointvec_minmax for [fs_]overflow UID and GID */ -#define SYSCTL_MAXOLDUID ((void *)&sysctl_vals[10]) -#define SYSCTL_NEG_ONE ((void *)&sysctl_vals[11]) +#define SYSCTL_MAXOLDUID ((void *)&sysctl_vals[11]) +#define SYSCTL_NEG_ONE ((void *)&sysctl_vals[12]) extern const int sysctl_vals[]; diff --git a/kernel/sysctl.c b/kernel/sysctl.c index 79e6cb1d5c48..68b6ca67a0c6 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -82,7 +82,8 @@ #endif /* shared constants to be used in various sysctls */ -const int sysctl_vals[] = { 0, 1, 2, 3, 4, 100, 200, 1000, 3000, INT_MAX, 65535, -1 }; +const int sysctl_vals[] = { 0, 1, 2, 3, 4, 5, 100, 200, 1000, 3000, INT_MAX, + 65535, -1 }; EXPORT_SYMBOL(sysctl_vals); const unsigned long sysctl_long_vals[] = { 0, 1, LONG_MAX };