From patchwork Thu Apr 17 23:00:16 2025 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 8bit X-Patchwork-Submitter: "Chia-Yu Chang (Nokia)" X-Patchwork-Id: 14056279 Received: from AS8PR03CU001.outbound.protection.outlook.com (mail-westeuropeazon11012044.outbound.protection.outlook.com [52.101.71.44]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id BCC5421B9CE; Thu, 17 Apr 2025 23:00:51 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=52.101.71.44 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744930853; cv=fail; b=ZRej638TIo1EGN6PUafO6EpKTL1SPwQFoGbZT4GjA+NUMSD4zXvHcT1PSUrFQeaBROFN5KkOnVVSxFBj9txNIpYNTfDrpAWyUIruRIgI4GtRQ5LwQkP2aWU+92b3bhnCOfruAopTuVtoouNKmI79dKP06V3VQXmbhRh89Enjmt4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1744930853; c=relaxed/simple; bh=jzGjlVHTjyWEGx0OxJrvgDWNiNQ6gwMZm/yT5kX2loA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=JDzkH/4izGyAOJ6O2tBj+IkW4kWCtza9zRMfm1iP1c29tqfv4pJES29qo2DLiPQWFBWNR+izJwNQFeVPx8ND038xfsA68kdZ/iUWJOmq08blzyYpkrxDZrXUl9pgKcj1NY/ocs/VGsanMnHThvjdDVRrAYo83VJoMxEJru9OTIw= 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=bUp4fow8; arc=fail smtp.client-ip=52.101.71.44 Authentication-Results: smtp.subspace.kernel.org; dmarc=pass (p=reject dis=none) header.from=nokia-bell-labs.com Authentication-Results: smtp.subspace.kernel.org; spf=fail smtp.mailfrom=nokia-bell-labs.com Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=nokia-bell-labs.com header.i=@nokia-bell-labs.com header.b="bUp4fow8" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vT4Z9V0ob5PlDEuSArEpaU418JEmHyq48R6F4rmGV9v5bs86gI5FkMj+kBDKESfHl6KDc/i9WvmrAIOLep0/G+4WvNIbsjYTfgdX8VeOy4AmHkRhoYxPQJH7tnmqw86ocHXJ/3LlpO4kNvqoFT/Eyd1DyUXbFryGirBYzFtPvPm2TelmSPVCSAREkaaDcNqqyINpIHj9CEDozF9H6lPWg3Y1lcLBrrTp2EGmD4glEHRLA6IvJiHqQUzel5VsYXHGPVIG61Oez4aFlAI6mshUsYtckWQJV5iCqSl6zYwHsESU/Q2uZByefqBnK1paWCgIFz4a8L8FrDUm51XhzvasOw== 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=aP/7Psq07ihqriJaEJ63jaVwaWZLAB4da/DunpSK6As=; b=gznMHl+J0Js8LHhovOuTVGhmklrF7Tq1c5NZ6i21UDQ+FvvTMSH33xgGgHQIG6JTL7mae8RBpxwXh1hLxAYvQgTVHN+3RT5eAWkbV/EaqnXkrLoiWJ//WbRBTqRgqElOrSzjaD38wGhjCQC1LNAT4R6vVJ1mpL398zUWp/Dsi3mgyAWOwtXAAn6+Ja3W6tsQ9SYitUf3HB8bZ9E05HWg8/FZDv5GaRKGtgPOscHzJasli4dAZtFMH/ib3pPx6zgFBXLw1JXETriGzDDcBSuivUpQPWDIjgUFgRBY+W87Tyg/jiYniDtEo4YM9xFdvw8XfCC2NwbAZCZfyPYFYuR5vA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 131.228.2.29) smtp.rcpttodomain=amazon.com smtp.mailfrom=nokia-bell-labs.com; dmarc=pass (p=reject sp=reject pct=100) action=none header.from=nokia-bell-labs.com; dkim=none (message not signed); arc=none (0) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=nokia-bell-labs.com; s=selector2; h=From:Date:Subject:Message-ID:Content-Type:MIME-Version:X-MS-Exchange-SenderADCheck; bh=aP/7Psq07ihqriJaEJ63jaVwaWZLAB4da/DunpSK6As=; b=bUp4fow87yg+W9Wihf86bUKJErHaYmD9oMPgHB7Li/iCBjMUI7KfFsebSvMQulgg4gFmPDbuUn2Vu0KAq8HNNGmSr3we/qW1HWs0305xik7eqWSjbpifQsvP2YeVYHGTyVdwsj0BS7gk4nCunMvc8+G5wiHhkaGfncU0rEcE0mnEy4C4o3sjaP5g+9yrhrnoL74WMon6/3LIIEg0mBcnHpYPxHtzccwgqk7FpotS3zh8keybC0G1v7E+AVIA17LXHR7odVIa+jMePpLgyrW1sHO43gEHWL9OiyBj/NNYTX0CmWI9q8pxSgtLeo32U0KbYbMPX6yBl2o/EKLuBP0jzA== Received: from DB8PR04CA0005.eurprd04.prod.outlook.com (2603:10a6:10:110::15) by AS8PR07MB9461.eurprd07.prod.outlook.com (2603:10a6:20b:632::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8655.22; Thu, 17 Apr 2025 23:00:47 +0000 Received: from DB5PEPF00014B91.eurprd02.prod.outlook.com (2603:10a6:10:110:cafe::12) by DB8PR04CA0005.outlook.office365.com (2603:10a6:10:110::15) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8655.22 via Frontend Transport; Thu, 17 Apr 2025 23:00:46 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 131.228.2.29) smtp.mailfrom=nokia-bell-labs.com; dkim=none (message not signed) header.d=none;dmarc=pass action=none header.from=nokia-bell-labs.com; Received-SPF: Pass (protection.outlook.com: domain of nokia-bell-labs.com designates 131.228.2.29 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.2.29; helo=fihe3nok0735.emea.nsn-net.net; pr=C Received: from fihe3nok0735.emea.nsn-net.net (131.228.2.29) by DB5PEPF00014B91.mail.protection.outlook.com (10.167.8.229) with Microsoft SMTP Server (version=TLS1_3, cipher=TLS_AES_256_GCM_SHA384) id 15.20.8655.12 via Frontend Transport; Thu, 17 Apr 2025 23:00:46 +0000 Received: from sarah.nbl.nsn-rdnet.net (sarah.nbl.nsn-rdnet.net [10.0.73.150]) by fihe3nok0735.emea.nsn-net.net (Postfix) with ESMTP id 73CE32084C; Fri, 18 Apr 2025 02:00:45 +0300 (EEST) From: chia-yu.chang@nokia-bell-labs.com To: dsahern@kernel.org, kuniyu@amazon.com, bpf@vger.kernel.org, netdev@vger.kernel.org, dave.taht@gmail.com, pabeni@redhat.com, jhs@mojatatu.com, kuba@kernel.org, stephen@networkplumber.org, xiyou.wangcong@gmail.com, jiri@resnulli.us, davem@davemloft.net, edumazet@google.com, horms@kernel.org, andrew+netdev@lunn.ch, donald.hunter@gmail.com, ast@fiberby.net, liuhangbin@gmail.com, shuah@kernel.org, linux-kselftest@vger.kernel.org, ij@kernel.org, ncardwell@google.com, koen.de_schepper@nokia-bell-labs.com, g.white@cablelabs.com, ingemar.s.johansson@ericsson.com, mirja.kuehlewind@ericsson.com, cheshire@apple.com, rs.ietf@gmx.at, Jason_Livingood@comcast.com, vidhi_goel@apple.com Cc: Chai-Yu Chang Subject: [PATCH v4 net-next 02/15] tcp: fast path functions later Date: Fri, 18 Apr 2025 01:00:16 +0200 Message-Id: <20250417230029.21905-3-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20250417230029.21905-1-chia-yu.chang@nokia-bell-labs.com> References: <20250417230029.21905-1-chia-yu.chang@nokia-bell-labs.com> Precedence: bulk X-Mailing-List: linux-kselftest@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: DB5PEPF00014B91:EE_|AS8PR07MB9461:EE_ X-MS-Office365-Filtering-Correlation-Id: b8c07be2-160d-41db-ee93-08dd7e03b095 X-LD-Processed: 5d471751-9675-428d-917b-70f44f9630b0,ExtAddr X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|82310400026|36860700013|376014|7416014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?M+NxIDrgwc6/Lbk6zVjB1iZsmYPMDpx?= =?utf-8?q?ZnuAAezekNE8fXm/PBYSmZSs8HO4gZBgL6KFksqCxX2mvYYvp3h5MLHU441JK+pM1?= =?utf-8?q?MbcoEHHdy2ha5Z3s/gCQVJEXXznjvpFkUbkfjxJuimQxBSNiZ5Z3oMAc8kjhX6o9b?= =?utf-8?q?xnePKiQd0DsKIoOsYTGsXmwqPTpTVmlFFRl/DJ/Fo3ZQNqovx59k9cBvB8vEMsanx?= =?utf-8?q?Mqr6ZojLGUIHGaa3AamD1wzUxGMA4Bxe+KbaRlq3+7HzlLA1dTqfIot+IABG6lYJH?= =?utf-8?q?BHnAkvH/r+BpR1za7LTQ4ptgTdIrxMbtoH8ftMAdtMiMFn42UVhFMasFNoqpyaPEf?= =?utf-8?q?bOhE58Q/+/GdIZD5iTdbvIlqi0IbXBT20P5KkJewQpOd+1zKF7os560XD3bjLAkW6?= =?utf-8?q?X62/b74OSOvsyHqrTFxqPoYGPTzv0NG7lb4LqS9Q61HfgGYsIpNp6FYMWlFQH2mRF?= =?utf-8?q?SH4h8x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R4vndQqSSGW0dQaUGqldCkmlgk2ybENrkMeOgK29gQ23mk/XFLyE?= =?utf-8?q?0Xyf+22inruOtWeSFsszRhNp3RDlKRouKLQz76YXoiphWcO69unDor8Mmg5fcvwU5?= =?utf-8?q?cPd3ugyi9lLzAV+xgKBNz7dz1Q2X0b3A=3D=3D?= X-Forefront-Antispam-Report: CIP:131.228.2.29;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fihe3nok0735.emea.nsn-net.net;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(82310400026)(36860700013)(376014)(7416014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 17 Apr 2025 23:00:46.8604 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b8c07be2-160d-41db-ee93-08dd7e03b095 X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0;Ip=[131.228.2.29];Helo=[fihe3nok0735.emea.nsn-net.net] X-MS-Exchange-CrossTenant-AuthSource: DB5PEPF00014B91.eurprd02.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB9461 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 5078ad868fee..4dacd4a11669 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -812,33 +812,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 */ @@ -1798,6 +1771,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);