From patchwork Fri Oct 18 02:20:49 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: 13840999 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2075.outbound.protection.outlook.com [40.107.22.75]) (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 4F174174EE4 for ; Fri, 18 Oct 2024 02:22:16 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.75 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729218137; cv=fail; b=lJe366BPqRQ/3OHtDmhb9/kSmbhotvnDyIZd5kQrlS0OU2HmIbz3TPEBPj2kGx9TnIjLsHd5171LoKzS2RaPFroBvuVUMmE8wr/sWDmFfJa9HnS03Lnm2QG+jponBo95PcS774r5Il2lBfVl0PdgjvxzdtXBln4l/ALk4JZMpbg= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729218137; c=relaxed/simple; bh=Hj0kpmxspiVLJX8wpFuphNG9SkyVLpob5NDj2PecjNo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=trvPjyRGDVr6mLU2RpGdyyiENMPvIZdKNiDEy2k8GzmYZlV0XWTEsXIzf1ZMtd7+hsNQ8QNv92NTgNRIJ2+NecUY+KHYsbkhi2r7TrNa1PzXVhG2fXd4+WPAlQL89yMTXZKNY+tEx+FmUfRDfnGQpG7ipqi2a4n2rUxMGUJm/HY= 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=Ly8sp8P5; arc=fail smtp.client-ip=40.107.22.75 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="Ly8sp8P5" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=NyAyzzkI1t7FpLkk1+mKY94Nu+ZsO2hYVsi/iE6QUTF9CEIrfj42vzmsGkpqGjs5kyS2QEGv6YC/xqi6jl331SNOCUGrjp9Nio1rhk6YR3MDSinJw2Lmuiz2/eK4hnC3FwhkQyw085stzf0WufisVs+Qo9ZsXa6HHlK5C7Ut/1gwRXNqkb74CAiHoOMlDRSueacGJHVVYcq1TIYPohYfywP6bSInkpJUy3MtcOf/yWo9sgOssM8XPFPnK9QIJBqo5xCPOGK01UCYVderaV0stbID+d7fDs8hAYYcfTS0Q3RsmYOl29xj+3rIARVLr96eG5PMIgAGS1jh4dMZS7kW6w== 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=NXl+jkY6ong5Phsy59TTE3OHZvwQGTrSsZW9TS0xUyw=; b=PF5ZUMG4cdsbSnFB/jFQ8rTf0xzbsBJBAsASvZEyFHsM3jdljyy2y23nk/GmLFnmMgxrAkQBRvQhyWxxYf6X58TuwC6qysOWbrZv9f4otrQ2DfZhWjloBSCz8ebbA0qEXejrLfIrj1ewXJZ2D4nHw9Zu4fRGuUKd67MYye6qQdleqwvJzQyDoRmV22lqh1YI5oPur9OH1FMGnEvwb77Ev+oPejDmnj5iawX0Y6WXPOhLXwEc6I5WqU1r5QXYbXrguX2RzNBX57Sxzn38HEpsfsh0dtT7JTRFBTeXitZgwTOjPSqfDNPfHvlWVlNyIh5hNzGc2SxUemQcBYk7H2jMYw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=pass (sender ip is 131.228.6.100) smtp.rcpttodomain=nokia-bell-labs.com smtp.mailfrom=nokia-bell-labs.com; dmarc=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=NXl+jkY6ong5Phsy59TTE3OHZvwQGTrSsZW9TS0xUyw=; b=Ly8sp8P53icA7smTsUFT5w7Oaimoz3l+dbUnnhm3E2zNKJl95L4fTKzIjPlsz25eeojsjshfRgyBbqQ1kUHQBU3FQHtnuLVO+2Hcs5N43GieOT/mSXAVMTaCfhQIeN7zcrhs3eYQnSwUsIVu7xz1BgxyZliFxnakxjig35Sy6qKVAxsrkcnuhiuFSliqA7BPp+0/zrTP36ihcXZzEAjTtuf/4eDGR7TvzzCNp1DvKNF7iMlB+Oez7yKmHjVBxR6V2nAz8JIqcNnGG+PTk1YcMKrvXa16geoecNQk13z741ONQ9brxpdxI8E7HCmFseMSgBHotxfnkFUMO+FnrLNSgQ== Received: from AS4P190CA0052.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:656::24) by AS8PR07MB7224.eurprd07.prod.outlook.com (2603:10a6:20b:256::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23; Fri, 18 Oct 2024 02:22:12 +0000 Received: from AM2PEPF0001C710.eurprd05.prod.outlook.com (2603:10a6:20b:656:cafe::fe) by AS4P190CA0052.outlook.office365.com (2603:10a6:20b:656::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.21 via Frontend Transport; Fri, 18 Oct 2024 02:22:12 +0000 X-MS-Exchange-Authentication-Results: spf=pass (sender IP is 131.228.6.100) smtp.mailfrom=nokia-bell-labs.com; dkim=none (message not signed) header.d=none;dmarc=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.100 as permitted sender) receiver=protection.outlook.com; client-ip=131.228.6.100; helo=fr711usmtp2.zeu.alcatel-lucent.com; pr=C Received: from fr711usmtp2.zeu.alcatel-lucent.com (131.228.6.100) by AM2PEPF0001C710.mail.protection.outlook.com (10.167.16.180) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.17 via Frontend Transport; Fri, 18 Oct 2024 02:22:12 +0000 Received: from sarah.nbl.nsn-rdnet.net (sarah.nbl.nsn-rdnet.net [10.0.73.150]) by fr711usmtp2.zeu.alcatel-lucent.com (GMO) with ESMTP id 49I2L0Mg023685; Fri, 18 Oct 2024 02:22:11 GMT From: chia-yu.chang@nokia-bell-labs.com To: netdev@vger.kernel.org, davem@davemloft.net, edumazet@google.com, kuba@kernel.org, pabeni@redhat.com, dsahern@kernel.org, ij@kernel.org, ncardwell@google.com, koen.de_schepper@nokia-bell-labs.com, g.white@CableLabs.com, ingemar.s.johansson@ericsson.com, mirja.kuehlewind@ericsson.com, cheshire@apple.com, rs.ietf@gmx.at, Jason_Livingood@comcast.com, vidhi_goel@apple.com Cc: Chia-Yu Chang Subject: [PATCH net-next 12/14] tcp: Pass flags to __tcp_send_ack Date: Fri, 18 Oct 2024 04:20:49 +0200 Message-Id: <20241018022051.39966-13-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018022051.39966-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018022051.39966-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: AM2PEPF0001C710:EE_|AS8PR07MB7224:EE_ X-MS-Office365-Filtering-Correlation-Id: fa7961cc-f2e3-409b-b802-08dcef1bad23 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|376014|82310400026|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?bwJBOPZdlgGRw9tYT/i09Y5auWLG9xC?= =?utf-8?q?EKGoN8o5JkAM8cXzPzaaBUJVIEllzJSMGyF2A2yIZeRnDBDHveRq+ZCRdZMmNxxKo?= =?utf-8?q?InzqYM++TF0xaNcyXaeJi9avcJlFwc98whpUPXpzgtXh2Dy2OO6FSE/qi8gS12YNj?= =?utf-8?q?YTGF4oyOeO4SnflRg2/WQ539AWjfWIt3NdF16ajyjcaqzitDIvkVSnOJ8NE2wknmh?= =?utf-8?q?oKydcn5gxC8wjRwdJ1YbpnJvmtXRHX02DHsKoTonb76OmMLP25gwGOxn/SFdrPjR8?= =?utf-8?q?ECkD/1ZAGDT30DapHxrlW+eEaSfUwqVAwDZ2Zu36Nze68b0rvQcTHC6cnvzAQIFyq?= =?utf-8?q?dL/cfayV5dn0QJytwxbY1Fypk4+x2pYnd2/BZ1UDPIaB9fUvekICHMGM2mkn3s/KD?= =?utf-8?q?PO78TSJH36Epxif8ZHmp10RyYm33/7d3gpCu5KcN86BSNQWxPRfOXNBgplox88sRm?= =?utf-8?q?rPU5pn9Jutvupetmjlsr5HEAFesqxJQE0z5ZBAipvtKgFPKn8L4Hoq/Mbfislc0T5?= =?utf-8?q?HNR5Ks24oq9KYAujYBcfpUKh0RhV3FS1qONP56GCJZd9Y9+C5dU5oQcBEoelUsy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alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(7416014)(376014)(82310400026)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 02:22:12.6472 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: fa7961cc-f2e3-409b-b802-08dcef1bad23 X-MS-Exchange-CrossTenant-Id: 5d471751-9675-428d-917b-70f44f9630b0 X-MS-Exchange-CrossTenant-OriginalAttributedTenantConnectingIp: TenantId=5d471751-9675-428d-917b-70f44f9630b0;Ip=[131.228.6.100];Helo=[fr711usmtp2.zeu.alcatel-lucent.com] X-MS-Exchange-CrossTenant-AuthSource: AM2PEPF0001C710.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AS8PR07MB7224 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 fe8ecaa4f71c..4d4fce389b20 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