From patchwork Tue Oct 15 10:29:10 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: 13836075 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2079.outbound.protection.outlook.com [40.107.247.79]) (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 351AC1EABD1 for ; Tue, 15 Oct 2024 10:30:25 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.79 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728988227; cv=fail; b=G/tzfZVEiH6rni0TA3slrHXFUYH4cYIHa8yrQ36AH/FvlF15/cthQr0d1yN/WbaJ+Ry9P+PHDJa0naNT8sPaa9aHOvvb7dtpOrvZVsT2jAg89x5xXp99SZmrS7RcNNfcNwe/eVR6c9qJT2NdrQhtZjnKVnTKInLndD3dL0L+HxU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1728988227; c=relaxed/simple; bh=aigVrtFmdlODcoDzUAkTu2EEDAXuRELqVFW7iXHciWY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=LRmUY8BIZPCOCODUe2E4JsHN3vTfHfunN0aLMCMxoSKalfZMbitx99pcYQ3Wblpi+CkySY/7pYj1TjYg6Q73hEurHrSMBIAn6sbZk8WMuikiGoZzvwkPs2XUUj+P0PvnFaYIBIdzCS1Iu7YOOBi7igdhzGYqE5XDjZcuWKTb9dw= 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=k2fUprPA; arc=fail smtp.client-ip=40.107.247.79 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="k2fUprPA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=mtiMdb5WVudmHC5DgyTEa1C+w4oxqXOkv9XtAfzGxWE32DwtQ6D/7Nd5tqpxbaN2lp3nilxbtEZ5JdmBhNEsgVEvFWD1earg5SCqDjLxcoQxhd9klrPtfpIC8dNBgxrDj1/W7AfFn97QaNBPnJGoaoV0I6A2SAqf+XYBdZgRvQ8cNa2rLfva+0t5YJGaGOF8wxNfIqZPZqHCOJuhGHGlZHwUNqj3NgwOBKQh/gfAFMJiF2Pfkh4ar6UIoGOk3eE4qlY54tlj6N1e0hfJBK4oQDcTDXSE4lEHQrUx1CgBr4m/6WHQbjl/gGhe8bl8adVMz79oTb0ug93/KyPKMxOxog== 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=AwpGt7LZQgUGaYqfl+JpsnW8PuU1p5tVsq5y1AfhjMw=; b=cSKwGesYZAYk5R+Hj1YfQ1XEIdT4DhtVPfPIwmeU5Rf+5ejEjbjbTNqUSU14HfZpokCDgSYzuZpQzCbBTHoclvvqPAhLMikYjLS4yM+sFLJ45ZAKjwimqyiPvIVW12hFW/lpLIwRLxSgg1frYw42XJAs3voPf2cK9SdwWuonCKAoy08TfHB/qgpYd9k2g+1LY0J5NJA6g95D4fE2O0/top9j6Cfi5hLM3KbBLT5JcDww0o30A3rUbVcZw1qg3YTfFrNwphH7etAPnosPRZmHujy3fiv0ccANqNK6Yfb61TlproH7onUtoqk8qSPV9hVqMdaVTObyGz/FHOXvoUbyBw== 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=AwpGt7LZQgUGaYqfl+JpsnW8PuU1p5tVsq5y1AfhjMw=; b=k2fUprPA/XYtT4vliokmAYrvFhZPgTvdb6+TlaMb4p8yLmZvIAi3gG8x6DfjkOMaZw5eLgo/+wocs3Jj1otYJegGMAPZiuQT/0FLJXoW74Ivbj4U0bYMw7MrYCeL2NF5Znc5N9yGBH145n9jx6hA7jR9K9BMyEszZRdEWWAz2HEUK1JdzeFVv/LgJ7N5oiwnVUrO/kE+knA3qQIBCZGzI8C4j2jxlqJSNZnk+Btk39MVm2pZdhARa05ca28Hfl55vi7qomBzXKDaQ86CZMaxwZchgL3ugmM4dPceHcApIRdHOTK4jjyWnVqNGSQHWb8juD7Lt9yBDM6a3J0MvOro0Q== Received: from AS9PR0301CA0002.eurprd03.prod.outlook.com (2603:10a6:20b:468::15) by DB9PR07MB9005.eurprd07.prod.outlook.com (2603:10a6:10:3df::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8048.26; Tue, 15 Oct 2024 10:30:20 +0000 Received: from AM2PEPF0001C714.eurprd05.prod.outlook.com (2603:10a6:20b:468:cafe::94) by AS9PR0301CA0002.outlook.office365.com (2603:10a6:20b:468::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Tue, 15 Oct 2024 10:30:20 +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 AM2PEPF0001C714.mail.protection.outlook.com (10.167.16.184) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.7918.13 via Frontend Transport; Tue, 15 Oct 2024 10:30:20 +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 49FATtnI029578; Tue, 15 Oct 2024 10:30:19 GMT From: chia-yu.chang@nokia-bell-labs.com To: netdev@vger.kernel.org, ij@kernel.org, ncardwell@google.com, koen.de_schepper@nokia-bell-labs.com, g.white@CableLabs.com, ingemar.s.johansson@ericsson.com, mirja.kuehlewind@ericsson.com, cheshire@apple.com, rs.ietf@gmx.at, Jason_Livingood@comcast.com, vidhi_goel@apple.com Cc: Chai-Yu Chang Subject: [PATCH net-next 14/44] tcp: fast path functions later Date: Tue, 15 Oct 2024 12:29:10 +0200 Message-Id: <20241015102940.26157-15-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241015102940.26157-1-chia-yu.chang@nokia-bell-labs.com> References: <20241015102940.26157-1-chia-yu.chang@nokia-bell-labs.com> Precedence: bulk X-Mailing-List: netdev@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 X-EOPAttributedMessage: 0 X-MS-PublicTrafficType: Email X-MS-TrafficTypeDiagnostic: AM2PEPF0001C714:EE_|DB9PR07MB9005:EE_ X-MS-Office365-Filtering-Correlation-Id: 612fdc85-9e7f-461f-388d-08dced045eed X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|36860700013|7416014|1800799024|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?glldgaikSXW/MsTJimfT5W8gU4URagE?= =?utf-8?q?eLveKZi3uK7MTt2rk9U3ngu/+fisRkh88VeSMKWHSjLPm/a0xyECePPN7XmLSYg2D?= =?utf-8?q?b+tglfXWW/l5H46xDhRkWqnn77awGnsSUs81X800/Iq2O50HWOnp6FROFlNSsiSmC?= =?utf-8?q?GFB/L6e/fuRc2iacf9H+jxmqVUIKfM9rfm3i//YwooWhvwk4h/vjDJtMeu98yoEV0?= =?utf-8?q?jQAxDG5d8Pp9qtGaElXVtDNnQ841uy4qrJw1ioRr/rMMXFbxSilpGvTyR6+vXt+as?= =?utf-8?q?1g4p8YyRwVRDZ31Ln0GtzKjcHQ12HB5m4rMN/tb3rCacwGHg+nN2SHlXrfIxAxsZH?= =?utf-8?q?TGGbHSVCY4igElnxpkQNwjrUjoS30V/eI1ZMfxIs/gSNtvUPDfqN9XmO8Wl35dyeg?= =?utf-8?q?1KjMZiVq4OWvAh8I057M1EGYLsnGXmxeh3iPC+LBZRXfasWoN+YOd5etnv1TKZPib?= =?utf-8?q?jq3TK+26AuRo99tWDrHzAXLa2Z09VlLqtN02s/g0lcmlhxmY2Emg/AczBFyV4muWu?= =?utf-8?q?Ub36K+FMilIX8aFfTkrlFBqE3EnUR+ZST/LDubNFr1uv/Dygh2CbnQwNuTqHbdapU?= =?utf-8?q?XdSI8xh+bvTxvbjwXOfoPnkF7UekRRY2LenC/9IeYusOzYgE0mJg3cAwy8dFbMA+T?= =?utf-8?q?lle36MpQrapmUEWRs2Vx39iPCfR5DiYvIb0DP6+kvAQi13BpvpaMjxk3wdeOKanbz?= =?utf-8?q?ttJB5WB5Vy56mCE9b6BUtmECujdQ/sPm+IKbCadNACWoch7D5YMa7BrVrle6+XCpN?= =?utf-8?q?FEWWcPgIyNXlBTsPJnZlPOsWDB/hfen3hFWdqtKmnn5r+1TROP4pE7V3bPZL7Msan?= =?utf-8?q?3WrJxH2lz1ORtQqxq+rTAUmjI1+HkANppkmpHPVVkYRwrMWxeMduhy8cYt4DxL+nH?= =?utf-8?q?+Bc4w22z6inozwYyNS9sbqTrxOVtcdtxGQbmJ7MWPSJwsPXrVnZwomliP+JtpdL4q?= =?utf-8?q?O+IlZmkyOHiVKvK0aXzg18CaZ5arfXUI/YREyu6vENU9pKGaHAieYiogbGSwHtUSc?= =?utf-8?q?DBlXiN9ZQQJRpJf9wchIaVrlrmkTLfgXCRD+6QtCv27xmqCnGhbVIHom8NIrldOCl?= =?utf-8?q?vjBRfP5HPVaWf/XOnMWgaJXHB2lrLXOnPTqVnwzxFm1DAIZGlAm/pL4UU6IzgbkaL?= =?utf-8?q?4pKcZXqaStnXsli/n/SYlm5z5iUwn4xfDvjGeacPovcxSKR6GQIbSj5B/i0+mNVO1?= =?utf-8?q?wkxwtarj8tKAZhq4rc9hVIgn7w9vIn4d249Y6FqK5QZ1H7bRX7R1U8f/5XcaAyrGh?= =?utf-8?q?eNjReFbA9lOn5GK0APA3/2+EjHbJ/lRBE796Hrq7kNXJs2wXlnsSego/CmEW/+JJS?= =?utf-8?q?G61A2yUPxjUX?= 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)(7416014)(1800799024)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 15 Oct 2024 10:30:20.6774 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 612fdc85-9e7f-461f-388d-08dced045eed 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: AM2PEPF0001C714.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB9005 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 4d4fce389b20..7ceff62969e0 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);