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?= =?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LoeL71bSlMpNl2i5EvD2Kc4TDFQlE9qtbojwblQqZyaDi7rhk=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