From patchwork Fri Oct 18 23:20: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: 13842497 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR02-DB5-obe.outbound.protection.outlook.com (mail-db5eur02on2083.outbound.protection.outlook.com [40.107.249.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 48E85191F60 for ; Fri, 18 Oct 2024 23:20:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.249.83 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293632; cv=fail; b=I7J06eaJl1hZ4dQLQUHF80M45+PKq8+S0U7OQWJNfofrmj9ul5g15fb4x9mCI8lWLLY66qsupOURzHtDCpLM+7coItEIXa4LUtHyWtU3b4dnAyieblDG56dLhslm7GWldQQ6Fj9kBE3SGCkkuI9dqyka91w5v6qc7JJS0P5X+JU= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293632; c=relaxed/simple; bh=iqP4Lrn2Z/fBm0RWoUJbIosaP4CJmoZQtGIJjWwHjO4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=cQuHTPe1uhokYZq/cvETa4yfNgYekU/351jM3HCvJx6F3d0USu4fEKKluedhq7r8XBsejgvNSqV6EXBkdHt1f7zVeAVMzq1JpCKTNshN96NTHY2ODQwXa7tDI4zDvkikZXt5KJBKvhjZwLvdLgE2zecow0KCwJmpgY3Zmug9EbM= 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=Mg8b0H2X; arc=fail smtp.client-ip=40.107.249.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="Mg8b0H2X" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=uB3HfSg54H7nEUun6RAjRKuhdhw18F21Mq196Pn/IznZkldz0rPCCRphbf3nYRdKwLFWL2sVp4OA0qCvl50Mapa80HCK5NnayALXS64I4wf9vVRsA0EH5FY6QY1NuRVohJDy4oJWwE46wDqZBqhKa4NIN8yvzy2IYa2gL2Joc1FAquMdpFMn0WP5QGY0dJ/aqbpMaNqlj44g7roIuOqooZiIMNa/r7B94U6p1dckBnD30DVRDkFuCH7++i2hCZJLz4mIRa3oEuYakrB/THfQIsxBjuLNy3xPTk4kv5MNgk2z9v+iD44VENlLQlCWFZf6y26xQcKqjkNVRq2zqlfUgw== 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=NU5lIh0ET4lYWPRn0L6WSEOqAeXrd1u8oJbRBbmljy2++jqDjLu2MKMVH6+QTwWKOkblD5xPUM4iTRELHg7IkwDGK+sUrnJb/NhT7MXfTN3rERxMadqXMcpeMkyfmv0u+pBaO43ip00SF1Gf/rLtxD2jhfVk445nBHdldbfWENGh1J/hvSojevTHsIJlOTK0Nu3qxL+AYa/1yhKA3UxUGXsmE6tcO5SG8nspQnBasrNvYGw0qZwSo4JfGAMn8xTbELa/H0L8Zm9KonfFLhDcSuMxrC/iLoVlMPMGkEVdZamV2rZOVI2WhdMhWgBdAn75k0HL08t2gY5nz6h1mdyRSw== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 131.228.6.100) 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=Qap5KOTYkSn3sw5d0xLoait3kFngQIXe3o0O4mhxPZA=; b=Mg8b0H2X78R+bDBijffB/M0mkBUdECFJOgw/pvMLrRDwzGHqYRtPQs4JP3UqRqcNTFGAZ3i1IFNpcreY1592Ci+cjvY69PwwfbKbc8gARKplIBP4MHvV3cQQ1BNfNpNekIcqmRgcuSu9vjeCTnCIo36P3C8bOCMjG15EDW+WQGgQH9Xm4CCuhAXCH95XNnEp6+JAGv6Dl/tc9i8CSUSMj8MVtbF27RcSqUxSxD4ZoAdskY+fPSWLrHypccbx5omxssZRSGNCPqPEWAtD6wfwHHyjuuVcKfF+COYTZ70VqEc6tGBf90bxl2zIPaZrqUSvFpxbfBWczy6GGMAMdyCflg== Received: from AS9PR06CA0759.eurprd06.prod.outlook.com (2603:10a6:20b:484::13) by VI1PR07MB9706.eurprd07.prod.outlook.com (2603:10a6:800:1d2::12) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Fri, 18 Oct 2024 23:20:26 +0000 Received: from AMS1EPF00000048.eurprd04.prod.outlook.com (2603:10a6:20b:484:cafe::b9) by AS9PR06CA0759.outlook.office365.com (2603:10a6:20b:484::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23 via Frontend Transport; Fri, 18 Oct 2024 23:20:25 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 131.228.6.100) 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 fr711usmtp2.zeu.alcatel-lucent.com (131.228.6.100) by AMS1EPF00000048.mail.protection.outlook.com (10.167.16.132) 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 23:20:24 +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 49INKJJQ010239; Fri, 18 Oct 2024 23:20: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, 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 v3 net-next 01/14] tcp: reorganize tcp_in_ack_event() and tcp_count_delivered() Date: Sat, 19 Oct 2024 01:20:04 +0200 Message-Id: <20241018232017.46833-2-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: AMS1EPF00000048:EE_|VI1PR07MB9706:EE_ X-MS-Office365-Filtering-Correlation-Id: 194d5db6-4582-4bfb-02ae-08dcefcb71ae X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|1800799024|36860700013|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?+UPJlntd/fuGJYw7m2BQFeE/vq+BR6X?= =?utf-8?q?/qmT+CZRd5ICtf5GnsDHzVfS/0CtB3ZkUxW+rHcB1F4TjuTPp4nykjhC7mAope9Gs?= =?utf-8?q?QrXcX0q/2OBYDtVjFKTe4VbtBAyWYrVlL+tP0cOHU5TxrPNqd/LjcuDuF31nwr83L?= =?utf-8?q?48loXNN7vRb+xYZU5DnJkgqry0JuJOCsdXkKSfS3xXH+n5SargoMvHVP1Py1g16MN?= =?utf-8?q?UX41g2IDbDDHNvA0UIxOpRzrG1vcY8EQs2grbiKhYraIzbRDZhGBZ8S444ztoWcHp?= =?utf-8?q?uFzR1P8TNIjoIgIfxzJkEIPRFsOHoEEMG0vOPLKekEF5t8zniLtgsKBuQxMa0kdsT?= =?utf-8?q?8sPtMHtijd4PxNm0YrwvkkSqYx0/Sstm867tPTySvig/FvC6vOr4AJaA/Hmmje8C9?= =?utf-8?q?47jQSYLpgoplBqyhHtGgQ2zxIHVyuxPbijc2FJFgFyKwlgQBkQzCBwWdPaMeu/7iH?= =?utf-8?q?gZbyci9ubq0E65+ctKSbppgH4ycc95jmLziznCmm095i0tgZGN6TNhktZiCy6jqwy?= =?utf-8?q?7SV0kMavts+ZaPTkzbR2g6Zhcg0C7l474R68UeRE8b1BuLvatF8z19wzAu3qyIOOV?= =?utf-8?q?rOKDPOCFa5rpQobokqgMZrDeAZ6BdZ4cQHD1WD8EOCqjkKBDHzgIxdM5CVSG3epTW?= =?utf-8?q?qHvbAt9pHqua1NKQWY2NCR4YfWq9+yc+3KX5DIY8fPwypuIFEicEAsCGz8GeCLdrT?= =?utf-8?q?TWRrNF3ddUVGJcQ3o1iB+ly9PQ3zjC68D7ovgpyfHT+Xna7+sAw6lGU9IE/XesvQm?= =?utf-8?q?ow1GUUo7wuyeYGJZ4EjJOkba3AzCKBRmp5uqwwZS+emyUpYDZNaqNzQrtdX1W2aRh?= =?utf-8?q?EUu4fRo7J/gRNYarQKmq1nkObIkQhdZKMHrX/NVY/uuTbHjw2UQANd3VEIwJlD+67?= =?utf-8?q?m5+8nfeSBeKVyf2sIVmf8H22/9B1EwDhAP5Q7i/luL1m9aiPjnKOS2S1NM/jZYFv0?= =?utf-8?q?W7Wc0mbioEVxbFshJk/hRS9KHiQvYiprKCiXX1Nmlvnwc09bS9f9eOrQXaSTcuYjz?= =?utf-8?q?ObQ8aYK5gRl0n0fqPPlY0EssN4EC8I7F6BLDxldvPSR/h7FGUOVAnM2Q4pRFPaOk7?= =?utf-8?q?x+zSAzw0jnHVHeQ3Agr0By0NyamREns+1iBCHdPu1JY3roHvXw3pGHbndxm6cUO+C?= =?utf-8?q?Sw5kr1Ns6rqwzxS1IabpAI7dxYmTZ7WI1YC56DAWeV74K17i9uwK5qcwy9OiVdFJ+?= =?utf-8?q?acZThe6EQCJQhNJQoP1mgEWGkix3dtrVEBaDO1+blhQ3gTn6Ws2djh2YHaNZ/om68?= =?utf-8?q?i4jZrkIM7fM53kKQ0N3zm1qnrhhK/KwbP7/vyC2p9EEPcgijc3B15z93jgVwwKJgB?= =?utf-8?q?vhqK66bHADjtH4FWHCXjws65DEuWiTylY9ybn+df4SeWrvN1BkS6QPk=3D?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(376014)(1800799024)(36860700013)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 23:20:24.3302 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 194d5db6-4582-4bfb-02ae-08dcefcb71ae 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: AMS1EPF00000048.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB9706 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 Fri Oct 18 23:20: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: 13842496 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2074.outbound.protection.outlook.com [40.107.21.74]) (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 A0A571917E7 for ; Fri, 18 Oct 2024 23:20:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.74 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293631; cv=fail; b=gUj3XIvtmKIkSKeATnVUKdGju7R2/+3zhIc+KP30PMu5mu4/0wMwXlZPt6yGEcJ42qwyhiFRBhFwEqG+LeHvracL7o/TZFeyXLS/4H03q9xbX8xddYV6E8tfqpKkgWtelfKyZlGMu7d0o4M9GYxwsHjK5N3VwpV+5xD28cKsors= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293631; c=relaxed/simple; bh=3zGp58t362CmVtDa9QFNHZzzdy0EVtxL7MMUb+yZxbI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=fgDYW3FDIRzqoU23dQD1Zxqsh75U2Ny6qVFAWDr9JcqDRHbo4CTc8lov6QdoolM2mMd1fZCa7JRMsGtI/JXeXzNbp/UKYTqJm5XE9wgVoW2R+xZELJMdkSWiqwkQOM/5WC+ggVYUyhobh53gmSUvwSErbet/476Rc5l2Uvn5TH4= 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=EPRF9oXN; arc=fail smtp.client-ip=40.107.21.74 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="EPRF9oXN" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=yrnrEYxFnd1SHs6dIbBf5jrxvnSzPs17Jq9REZiCYihukewdpwRBhkr1Y4SNjutfQRRKhdzBNpWXUQ4o8Edg2dO/opur5/Y9Hl7X81jZUhZlJ9tZOjatf0Ve2Uj15xlwrnUVGkxbU2KWl2wx/55b6pCsSjZxG3TNZSb2lbti4caY3H8+DmEyu/kGQUW5VL0O4zBlQlauOMs1XgR3S+pzsvdFU9pblwV3lGIKXCkS002m5bTPRGKUGYp5RUz33iK6PwDG/mb8akRIaq79I1ZdTZEn3JAIc900kpuXKjzis2dHAtWyAmiwuqDvwco241Q/Vpkr8dw1ace0qe3damS3yw== 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=/Pf9hlyv6o7rclrqAn0mftxD+MbOfoa7s/42MqDOeUQ=; b=I/+/aP/mmfk1ae1hH2A4mDweyjbwkjtrRA1euSsP8OGvXvNrUwjYPH9SW9Nlwq99qbwVko6A4n13DdXbUitgF59bGE6dd9XtjdecmkT+YKf1EoEJ93v3p2F3JJlhgZ4uK98NyfppU3a5WfbaNzoW6DNMnR82Q8rBvhOcX6Dcv63JWNkSaXI+8EZ50BTYP9nDgDxA3yvvnNdOaxTxoTN162A2wM8yeecqNqYRljK3FABPut8RRx0UFnqgio1qLgTPBSKVc9Us97YM1YNxRYZaLMgNvesxdnuKGOuMFrqSo0t4CBkN30L+oTfKU7ctSFpUWZefwRfXqnCHONIeaZ3F0g== 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=/Pf9hlyv6o7rclrqAn0mftxD+MbOfoa7s/42MqDOeUQ=; b=EPRF9oXN2nUJD7SWKVrrNjyotZj7Dg/NhVDfwMLKf07s2FcOuZuN6QmscezOwByZiWh3ps3T6EzsLS8CsCi9J9ivqesc4kgZOCQ7g8KAMtk+qFN/rqpJkyFZPPNQNVMzc/LSdUHljG2LdlLHGjlRpR8WBPVnkP3lNuiWIrB43I8Al1cwZph9Ff/tRcqGvulb2LVVpfZAb9DK0P6wAO+jDpbNyDX/VQca2MHBCToKQITHIrTow3OHs5vuf59AglHsmGZ0luJfTQsn3I3K3JhqEeXp7M/sjtP6UpzFpLzse9db2rkekQ+BkOwczgXo1TcFO2R8XyU54fmtDrs4hO67NQ== Received: from DU2PR04CA0015.eurprd04.prod.outlook.com (2603:10a6:10:3b::20) by AM8PR07MB7588.eurprd07.prod.outlook.com (2603:10a6:20b:24b::21) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.24; Fri, 18 Oct 2024 23:20:25 +0000 Received: from DU2PEPF00028D11.eurprd03.prod.outlook.com (2603:10a6:10:3b:cafe::48) by DU2PR04CA0015.outlook.office365.com (2603:10a6:10:3b::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23 via Frontend Transport; Fri, 18 Oct 2024 23:20:25 +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 DU2PEPF00028D11.mail.protection.outlook.com (10.167.242.25) 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 23:20:25 +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 49INKJJR010239; Fri, 18 Oct 2024 23:20: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, 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 v3 net-next 02/14] tcp: create FLAG_TS_PROGRESS Date: Sat, 19 Oct 2024 01:20:05 +0200 Message-Id: <20241018232017.46833-3-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: DU2PEPF00028D11:EE_|AM8PR07MB7588:EE_ X-MS-Office365-Filtering-Correlation-Id: 9f3905d5-0102-4505-3613-08dcefcb7250 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?LbDpZgbYAJQq+s4Ptuvf8uiHzLGQHMd?= =?utf-8?q?02QjlUYD/oOj4qMl57aZDJkBuodWQJkJFe+ux05aa9N2u9kGGyvyrgWBnDwwNBN/a?= =?utf-8?q?UlaPbITaaArm+Kb+o7gKGS/CSRmpsBSSv3oT151TII5gfVl9Z9avyF9lN99ShzN5d?= =?utf-8?q?ylsnJgC+RgMOqK62yqCaVLM4PiN6kEVCJS32gsiZ1lQu0LduPGr1g94mHowj/vYWN?= =?utf-8?q?eFB34uRG+E7dOlFyssCP3XhD7gH57dhiExUz55P4P6dVfG7mGprSRYRWSVoTZAGFx?= =?utf-8?q?uKxJRfifYo5IOgDA5H1Us637raYIMDzs5crPeVDt3q+pCUAwNDRaCm0NgZTOIJXzD?= =?utf-8?q?VlKMw5FB+hR/UNrlc4sR/d8qmnXTKZwTjLSeaiIBF1kkNaGrHohSdObWM42Fo4Jnm?= =?utf-8?q?/t3SezFruu+c7/+7OCw2SjbD+hp4p47xAlAirY9+gBnQD6rr5nDECfh5CMKOgF8cj?= =?utf-8?q?16MNJym8NK7xvgtpBUWSS9sScXSfiMWFGur2hjFjizxNh0M0V14NSZKkr4yPj1jrs?= =?utf-8?q?NHeXkAt1jpLoLB7bA2MPLNb8yHmBHp6l4Vfw1T/lx3rWyX4BDuCjV9tealea7lfvl?= =?utf-8?q?EOrShbvleFHhiFyqP/7G4hnnTcbWsrhT9s3AnVIKT/osjp0xwBz5Se9onEKtfxqkq?= =?utf-8?q?hJBB1arqXVato3PnwEjsNVcg1TRBu4IAQ89YfRxYJqrwmDf0Kz0ULDiw9fA21X3En?= =?utf-8?q?pQLg7KZVunYcLrow1yOhQw7TK3HAbe8sxg/G/Pu7qjkT5pErsw76WDf8DWM18+zZ6?= =?utf-8?q?JFGWkRh7w4HzCyix3jlSOwCFyKXOX6TRKh1JMoBg4yUQVmRIhk3PmjYVziG0yLj2m?= =?utf-8?q?ehEE/JxHgg9SV4uWNL9NuRqSv7cMEFYMeI8PPvs4/1Jy2NEJVe5UZdKSAWK7srKNr?= =?utf-8?q?3HLekNfxAHJdp9CMOJH7P7uPcLf8EWcsIBUcQGnebgkNjDW4mgiGSqq4zwAiXOvAT?= =?utf-8?q?JcvxPffPPgr7zV96bWrTPgiTvtSKpfv0RrHmiFVLMXWSXBhZjOjXmwz3dZsmOaa36?= =?utf-8?q?uWJPa6EgxuuKQkmSGrYJSTLJUYG49qvKQP+YDC6UzJHrKfFDq6onvGMtEox565Emg?= =?utf-8?q?bzY+3uCdgOxw0XOfcb+Dofga4efzezNpHNEgDuvGqBnPPV+3IuvsiCHUOy7d2DWC4?= =?utf-8?q?JPPEXMBmyRgGdef0pYJrBtSi0ecTM6tY9060U4tMYJEmU1JIRSPsUW3NWDkg9fVQk?= =?utf-8?q?RiabC9Fmzzy1ctXGie/OLeLwXYnDpQq3i/ITkgqLfH2f4A9RTZAIOUaqpjpwTToNE?= =?utf-8?q?DP7NEuOoMCzJuQrfOPNgin5KGUYSVbT8ApOhWXQWqa3XBccm3OS29cEB1yBb1/eak?= =?utf-8?q?X9ZdNosrR3r5jpLkGlH6kKFTZA5LWyoIENkxtUTvUR+qxh/c+knbcw8=3D?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.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: 18 Oct 2024 23:20:25.3464 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 9f3905d5-0102-4505-3613-08dcefcb7250 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: DU2PEPF00028D11.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM8PR07MB7588 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 | 34 +++++++++++++++++++++++++--------- 1 file changed, 25 insertions(+), 9 deletions(-) diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c index 5a6f93148814..7b8e69ccbbb0 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,9 @@ 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 +6189,12 @@ 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 +6225,7 @@ 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 +6240,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 Fri Oct 18 23:20: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: 13842495 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR02-AM0-obe.outbound.protection.outlook.com (mail-am0eur02on2042.outbound.protection.outlook.com [40.107.247.42]) (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 A01731917E6 for ; Fri, 18 Oct 2024 23:20:29 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.247.42 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293631; cv=fail; b=BhHs9IBZPhn7splAX6LyaI5tDtBPR1puzRD+KUTks8x5NmY5mQ1qhZokpB778KBrIcKvZYf1sTGR3gUlYKSzQuop9JnewB5nusx/pdKp/tZfleOMaY8CTVBewtf4GoDA5zEuW+9MXPMAXzPL8qwCQ6kH2OrT1YY3sWkMSxuCFI8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293631; c=relaxed/simple; bh=VWfBnNyWjEH3XDaLA3UuMW35easf2rQkez0Pfq+GLhw=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=pqyh5dWyRDBilncNJgy7mQooJJyJtQqr7T38ANFcSx16UIGlgKfGUbh3E/tgQRckfwNcJ0d8K96FUHtWY77nurT85ed082KlKYnZ5Q+vbmmBYpcFPdJY9yKni2alfouuk3PghxrFrbfrTwh4s4E5tdYb/hf8Kf1rYI5sIjspudM= 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=P4wCUGkG; arc=fail smtp.client-ip=40.107.247.42 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="P4wCUGkG" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=JfWENAFU+4zaujOsqFIOZ54pQx7xxbFAbCE8q8ompQFaJVES5ZHGqJJk8nAl9cueiAwufI7amtM3x4+wEFK+hRU6TmOdt8hqSgkHDMNwVKFc2fS/M1j+wOGffEGmKcW16OzBXum3+LcMb4YddApBXefWwjORRvVOt/EAHfV64KAw1f0Ip09QoDkQRDIPKcAaXCpfWBbr7YFmOoDI8z/cYqOpRZOPWmkmJAO6BET46kWvy5wQP71xgzqP2cQaQ+eI0S63KNIhfS+iCaau0xD8wkEdoeeHtsUfN3z+EBzVjTVvv6NQUo0ZsLdE52DdMEBN0vBrfF9PypTCj3cUS/XYFQ== 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=h6BP2DRoGg8neBEpSXHtOYbDwuYcPs8fOTyU/up/H/KzSilZTj2OGVYikDhTM/lCOwms8e3KRIHtMrNt30+nrk904juJqSUJLGt8+92CTdzwBq+zicLmgMYqWfwhcaUe49Kdn7M4RZvOHS5wMHdnoEczkKPDazm3SLerLwKeoQIrPJXsNZ93E97S7TzThIFXmKfZjQR50ERzMV3rcoYsQ3DCGGaYIHYl/G3ZSMZ5PJzM6U5I+AiYKGqHQutMDZxKg4Yu3jqP4rOmjY93Y+Vc3k1XpIilnk7sUh/iEsvRdCj6agh6EOGHyfPrJH5769S73rOEPd2zqOzVKdleMDZ7ig== 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=MMx3u4H44x+CVsqgJMWoc4rn9lSzlzPywoG4I9GWyRA=; b=P4wCUGkGOcTzcdjPleHECwq6fZDtZ8YqdJ2EJCFd7wjrMwMVcl9tY63adOcwWz7aLrwiEam6KhkmsSmV0HNKfkRnQMaUjUg3oidbKFzkeVpVD8CSv/nj5caftOAbeKYH6hdjo5HTi1OxAxgCOyULpD1Bayk/XbcGqLAkSeukwKUZcqwzmZHm8q5yVqB/p+woXE56pe7TGRJua5eNwHmIINwkJWZmzEdaEt3aSAU6M7P2tffe7c4WMVBvKuV+BJOpS9rY/UL/0QLqAe8oKVGrnkJWFOFGLH9JRmFf4VDqoh6Qdw2Sm8AFUwaC2jqP7rMhmI5LCH/JBuEFJ+Far/tkFw== Received: from AM0PR02CA0217.eurprd02.prod.outlook.com (2603:10a6:20b:28f::24) by DU0PR07MB9316.eurprd07.prod.outlook.com (2603:10a6:10:44b::7) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Fri, 18 Oct 2024 23:20:26 +0000 Received: from AM4PEPF00025F99.EURPRD83.prod.outlook.com (2603:10a6:20b:28f:cafe::b9) by AM0PR02CA0217.outlook.office365.com (2603:10a6:20b:28f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23 via Frontend Transport; Fri, 18 Oct 2024 23:20:26 +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 AM4PEPF00025F99.mail.protection.outlook.com (10.167.16.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.2 via Frontend Transport; Fri, 18 Oct 2024 23:20:26 +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 49INKJJS010239; Fri, 18 Oct 2024 23:20: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, 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 v3 net-next 03/14] tcp: use BIT() macro in include/net/tcp.h Date: Sat, 19 Oct 2024 01:20:06 +0200 Message-Id: <20241018232017.46833-4-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: AM4PEPF00025F99:EE_|DU0PR07MB9316:EE_ X-MS-Office365-Filtering-Correlation-Id: 08833ebe-b08e-4971-8124-08dcefcb72b7 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|82310400026|7416014|376014|36860700013|1800799024|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?xF9RxnLw/eyc4otD5upBLSBUKPGqjIo?= =?utf-8?q?t+e2uoY9AawYLvo5ogZ09eHG+9bp66v5A82kLpwnRSLzNFJmWyRa4FKsot5rjCvER?= =?utf-8?q?q/oglqQP/b8hHOKvb/cDYBzWCWW3EXcxz6tKgIHgRiyBlBUVzR5m/lhHly2DZH7J0?= =?utf-8?q?RrO4RVjHbgk7LJl4vfNueac2v8F/uWO5YOun+p39A7KGjibYswLEtj3pJH9CkckPO?= =?utf-8?q?c6ZE2nYRFZcXomVQ283Szip0xTwKabk6/L+32gXOYOI9XDCKWqUYdfr6CyrbNuyvm?= =?utf-8?q?y/D3CGCMqpEOkvnZC5AaYQHeq2yW7boWtQt6RKr8r8KGJ3/s8T1t8mWIPYIIBfEQ4?= =?utf-8?q?ijuwaCyyZXNXHRUV5UvUqlRQ6tSs/upOREJb6SomKLQmKlRQtc+e1KjI5kqVYglaH?= =?utf-8?q?ed8lU2E5Zc4WpI+D8ST+ructkD1ydaA02esmdadCS6dZMYxKL+WQ3/xcBGof2pChw?= =?utf-8?q?p+drhH5AtG9rJh9L5aQikkgB+e/HhZVhv2SpOy+d6UdwpzTg50QhAhMAKdw10m1zS?= =?utf-8?q?jkH2D0NXK62FaDwzhhc8OghCpsi1H1+bGcwBGIa4Ztm4z+CBwguOgPzhcn4E90ND2?= =?utf-8?q?TpSKx5MFYaBZh2X4s/VKWQYu/P2ovIdshifriPr+LU2dPjQmjRmNcBA+QBs3hJz3T?= =?utf-8?q?6Gged1ggPaDybWxI2WvBtHe65Datw/Uud0F/7rn40dSfe9XjcgGUGZFD96wPuXmzv?= =?utf-8?q?kVFumOf7DVJM1w1mGIKt37P6CvM49iR4AEg3LDJhk2fcFTHphHRe9NZayrPo7ry7/?= =?utf-8?q?8Mt3CsOdjJiZhhD13GJi/qllBpUwFOqWl/KWAGvyMKigbfzP0d1WXBDfPbEZmBVTD?= =?utf-8?q?rqpowbTv3nKjNaMkD+vlHOI3ZGHGFl8TWzAMotH7i1BqG4GPVAboFmbaac4cF5XvZ?= =?utf-8?q?oCegZ/hBGC7VFl8SNEWJCQqC4e6GAC4m1M7kImOxrcI43uKcwPgzwSIuDE41U7VGk?= =?utf-8?q?HpCupU07WpynEcT9RvWdPouyX/VyIc4wAUdftW37a7NoHu2H50Qibn8sRelmtXxsY?= =?utf-8?q?r72BRKiht0hxV/ThCqHMvH4lt1IrLMkBxbcYo0828QYC/2D5HHnuG15Edp7O1DLQI?= =?utf-8?q?FUzhW/JNMIic5aO/LlBgqZBVW7drXO699edIHPaj2v9FRxeT8ETK4HxMPr+r4JkBi?= =?utf-8?q?948el0574JgCTyYIxMmX4J576Uw3JjflYDayRHBQfrQu1c5M9yyIUAWdNg9GVpV9Z?= =?utf-8?q?zZC/7n9j4oBehvSPVuVqa5dIm367ASdvIQ8OaDi4VQOC3dpX5/acqBWutx1/sCg+S?= =?utf-8?q?W4CqeNjGiUGXZfWZv7Vo9Pv1eoEFQsUtJVIlh/7dTchs+jsEz5zhUnI6y+ZdMQYgX?= =?utf-8?q?fxl1+odLhujI?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(82310400026)(7416014)(376014)(36860700013)(1800799024)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 23:20:26.0702 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 08833ebe-b08e-4971-8124-08dcefcb72b7 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: AM4PEPF00025F99.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU0PR07MB9316 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 Fri Oct 18 23:20: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: 13842499 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2077.outbound.protection.outlook.com [40.107.21.77]) (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 970311922CB for ; Fri, 18 Oct 2024 23:20:32 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.77 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293634; cv=fail; b=Qs051nyCjo7598TBDzLZcivClW7HQQua1PtK3lkrH3Z1GkPyS3bQT+qCKg6wFKlQcvGoIqMHE42a6lNWR2iAGdefdP3HQvseLCNM5k7jPe2nbIDAJY1s+hKxeuSJqngIWM1yu+8QKOEygFzAMipwd+E3XvFDoZbQSG9ZjKA/I70= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293634; c=relaxed/simple; bh=Hmdtr0We50ejAD355SghSxW3LOTq66I4DTi+GKYgG1U=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=kdsEJAQ9rFVzttgq85/tPTRwy+RCUVb49NCVR0+kmu/srUcUJiBpPOrNd4bVitVFSf94VcIAknmyPvxaZNCJYXECq3cvBbEEB/wG4GKDPsYxowvLPA9FiP2kFtKi2t+Fdkbuw3P69b8RBMjxdQ9o7uHmnPq0wiQ2i7kbG5elQNw= 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=PBfuXMff; arc=fail smtp.client-ip=40.107.21.77 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="PBfuXMff" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=AHc9O2VO968LpgHjia9g6FZuYm9TbErcGzmOKQQYITGBrooGwyykANERsAPhqUF83ZxmMOzLdZtCmvfg5tAYpB4UJYjsRBqg8CAhmVlyN0dk1Zwb/rqkKG9qEGnk0wtAiafdACW58sxOAAms5z785bq4O7/ZPcYpfNVxJ4Gy30i/VLdKGFLiHe3Hdy9mBc39vYWsW2FO5AmcKkpvNZeseZTjSO6U6vjqFpq34i1aijZttN/TkBzAex4yfUEnKZsPaYga8n9n3Y9wb3GbgPiswTzCGy3GUq0l/QCKgOW9R4J2JbaZMDkiKUyX27Nl4twMoDXhnpjqiEZxs82ss8g4kg== 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=WJtuM1nTfrSpcdQnGQbMn0HkkJCOFzlul0aCRL1BYBc=; b=F3Bx2QxIbWKvNPfxnCIOAzzLOn9bPJHJ5Fy/ukcR2zpFlqDqthDsit4phrqRpN48gbIBAKtc8yZkY4eQ2kYNvEOIr2ehtJyaxgR2t1py2Dyzz+ZlSHC6rPigI1zm2JydR6GMPy2rpEMj2uIZbDci+XqMBaTjy52D0/QNfuLqaZf7ap1mpPuJSpXVY32eumlh3ex6rvkOFKb7gk1JzEQ1GXAMp/MAK2TxSn9twhb+2aEal1qpxoT8OJ/cLeldZmRjiWiTat2oLnMqiRzxFqod7+3sjbnZtDGddyvU/epo8LN0M33U/Iio6knBBvEiUKIqUHJba0fS3AKzTjY5s/8PWg== 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=WJtuM1nTfrSpcdQnGQbMn0HkkJCOFzlul0aCRL1BYBc=; b=PBfuXMffAHCE02J8UfPzPA7Y8lk1UD28PFuVt2JHwdaiIFnv8FYwNsBTsLgWdqeEtBmuO5S0zNTW4s7TmUXCYXbTBEppW9L3W28qXV/vmBSoGlVs/bi3bElD+O1fd3+8atIZ7Y9M7Dxdio3zPaR1HqZuV0phHTx6HUb4P2Xfrs3G+zSTNayXg6PnODVCkQpxHrbNfb1ni5oXAWSGVE53m7okr3QPbgqFJ4282L2fwsgxY9OZBODTZmKqmuyKAJ0gvL1CR/bus3tEAWv37ws0VnUesGuOqo4qWlZGszWmlgrIfv39OOWrKg0xkMBO1aXl7SxPDife5/qQIz+Xhkbg+w== Received: from AS9PR06CA0651.eurprd06.prod.outlook.com (2603:10a6:20b:46f::24) by PAWPR07MB9663.eurprd07.prod.outlook.com (2603:10a6:102:383::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.21; Fri, 18 Oct 2024 23:20:27 +0000 Received: from AM1PEPF000252DB.eurprd07.prod.outlook.com (2603:10a6:20b:46f:cafe::70) by AS9PR06CA0651.outlook.office365.com (2603:10a6:20b:46f::24) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23 via Frontend Transport; Fri, 18 Oct 2024 23:20:27 +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 AM1PEPF000252DB.mail.protection.outlook.com (10.167.16.53) 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 23:20:27 +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 49INKJJT010239; Fri, 18 Oct 2024 23:20: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, 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 v3 net-next 04/14] tcp: extend TCP flags to allow AE bit/ACE field Date: Sat, 19 Oct 2024 01:20:07 +0200 Message-Id: <20241018232017.46833-5-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: AM1PEPF000252DB:EE_|PAWPR07MB9663:EE_ X-MS-Office365-Filtering-Correlation-Id: 3566213d-8d34-404c-7857-08dcefcb7356 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?uuVEgEt/8dZz044A2ESM8vbBx9XbpNc?= =?utf-8?q?8QzOtGds2zS9keCWk69WDZ8Uy1VF/vXaIc/KkHgZw+dX/tbAaOf3GlwmV87uig4NS?= =?utf-8?q?PAKQ/a3wEY9K7/JJo0o2SYgcpREOuF0CV1XO7mKcKPcFgDtFeiaI3iBY8FBIhx5k+?= =?utf-8?q?TKkceTH9aZvoeDtjW+Vpg+CnNkAZckZC7eGqzeoa8TBjV350ZPW1JTZWAAdvCtPVN?= =?utf-8?q?yqNqH/JNsHzg9EttJYZ+MKuzqmb5oVbS1BU0+jUPNasUtVbuPPBFxC5MX8g34TZ1U?= =?utf-8?q?B4iDkTo0fJaOPhX2bVa6UJNU13g7BeuXOD1HTzwxke0XPXcsTa5ymJCIcE313qE3T?= =?utf-8?q?h0WvT79Qlhi4Kwzxh2zTzHUVaHsKmoeCGe6xCuL/JjNyXOYHGxX0QpeqBqAzLEqWy?= =?utf-8?q?l73iXLkIHywlhJrC0oQ6YVXO34LXVRiT7RYVoxRdYr2/aclHxsHKTHF+A9lrL5Ih2?= =?utf-8?q?wfi3JaMn0hIhemChRldB31IUJZx5JrsGIWrfBq4jwawb+Ghk9n8Xo95vhh25rkc3g?= =?utf-8?q?Z6ZzqBdJ2vVYqSuJTV2K3ml6UnakspDC4MaYnTkdNfDjtctLeOzVHQW+BAfqa1h5F?= =?utf-8?q?CdICKG+745AH7+QCD6wTQB0feufHTI4fM3pixmxQycWnrT8HVegbg4dt9OyQB6l9p?= =?utf-8?q?63Il4RK0aLC1HEL8hVz0fzwDR/FS9ynFGEFknPvZ1rChSjiycbVcwlbIIWBeFCPyW?= =?utf-8?q?7V+U9MTJyQB449YvLL7NWIfk5VNYwuSSwCHSLFMhZdb04LrDSVbmsi24pyVifnORA?= =?utf-8?q?9G0HAlKiyNexARjWYEUb+WIgY6fEpd+nSv9WzwIjSTdyamk4bzN/cFKf8Xa7ZRxCU?= =?utf-8?q?KrnTreWlfGFVKIxHV2qFhb+WIeftYNEsgMABdBr5M23BAyhQtW5k9W7TVASwQRSUe?= =?utf-8?q?BncSh2B/DC7abFYQzZEl7MfcTlvFXvIyDzrFONCqiSQK/U5J9PrzR07k/jFfijcuO?= =?utf-8?q?AVXC6f+6I11zCRGTfINkABxnih62j0OrCrimpknSQK0duHBWiU6FftL+lqEQRPMSh?= =?utf-8?q?9ZxwpF2BVslz7i9pUcLJ8bRNeCb2HmhIyRvCw0OGTziiUX5uLwU43ZtDNyE/BRnwv?= =?utf-8?q?3ZVrXOn9wuhkKL3k+eENqJ/jQcdiF3qdrSmfPICXEafhMO8zGPO35DX5Ntp/FzvUV?= =?utf-8?q?Od8cIIUZ3HGbGJFWEptPAAo89VBfcG7UGQQvWrfybx8JFFzSH9aVyynWIGXvAduV2?= =?utf-8?q?BUBK2SnogJrOKFdx6Dt1DnEZ/BkybQG2fwsjW7W6O9aFgLbpo0nmSu2fy2VjqlvyI?= =?utf-8?q?tyjtmToqMlNdjB0jP3oHxqFDIzDBWDzPv5NHuX1EtgaveB14Vjtv8jZpKrBnn1ZCk?= =?utf-8?q?K6yhQr3lMidzGub/diPyklnJu8IJD184IWRFVdkb/x3NO+vyeHNBC0g=3D?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.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: 18 Oct 2024 23:20:27.1120 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 3566213d-8d34-404c-7857-08dcefcb7356 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: AM1PEPF000252DB.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR07MB9663 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..549fec6681d0 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 Fri Oct 18 23:20: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: 13842498 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2080.outbound.protection.outlook.com [40.107.104.80]) (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 1FA70191F95 for ; Fri, 18 Oct 2024 23:20:31 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293633; cv=fail; b=MDCqgcdXGB0nUicna+2WG2UBC2CKKfm/gsntvzrw8VbVrYFCwrMfdSRkO6iWneC9VdTOsBjq0Otvc4nKJkTZuRQRvtxB00kVqcxqTRMcO1bsXBmbaLFok+sFQtOyYD0IP1Q1lpjonnhGLjHBQDrs+Rv9zZdfvDKSUBSIy3JZB4I= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293633; c=relaxed/simple; bh=/DXiP48JvOyuu2neVkASCL/V6m9Qs0aUxatR2JoMVD8=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=mqxlM/yYLwBakymTA/70j4PJWVwnH+Chwk/OXMZjIJLXUJJ8V7flHDTjvQ8dbdgNU6TmtLwH6iJlh0oYdeFLb/OQ3zEesVD6ZP6lV7FwnbdDMjQaNe3cfPlfb7rrsL4h+XVZiIW3akN9I/ccGMPMtpX5vLnce0aW4gsjmNqaQpU= 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=qbuKfVTA; arc=fail smtp.client-ip=40.107.104.80 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="qbuKfVTA" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ucA0TprMZoDKCCvkn4IOKOl5USA5iLAYJ4X4uEmH/h5ESDQUUHmlj14l7dx1cCLyNOr/N2JFHTui2ZV9A+XARtHFWHXuAp51VQyIggDvUB/qkzYpxVi8+a3PzrzRDp3fbRN0pEmjxmNFh8fHdn0/REMKnIozuPFMSezOBF66R8akpn2wTFxrR+Ou8rz3Ay2p2eaAXR+lJMYtcp+twloul1TVXUJV0MIX/ZlVLDzXUnXhn8yJ1bH45BG4txwdyLnf2+dJXvH0FxYppigXFW80hRNfXHzCMCsiM0gr6yhxg6hi3GWqfgRnEgMXE88pS6x8P9WeX61poe82A3Pp9/qNSA== 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=menLbY/T4sSpxoPKGkjIT/lGtsoGaZrFkKbZErdzlF/2qgNelix19NLVJZ/6jryCgoe5s1JWQ6EXEHVkKqIToG0JpvPCS0jMi6r5xloYeQO65Z9GtplWWp6cy/Gtrk/LysdIJAl2XBeKUJG9yFOgI/PKEQwTQgEZN3cIVYzge4ilbv4NpvgluP/T2APoeCuMUxeDuBJY1bzMfWiBMnpTU7cvypYL8YSeXyB2tBEm7cxYYLFOgtdH2mEttk3FlbQWgq+AUYYRHHN0Xx723VSc9hRBWjiPMm2LgEqk5eB8MVBvAZnvj9fcnkkSMl6H1rH1oPeWD6bPyOthh++dvITK5A== 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=slhYpgNbfxS31y0O4s9n10+y1xuaFQsDE8kARtPSdOI=; b=qbuKfVTAWeM++dVTOOW3kzHUUTE12LxQ/WABxVFwspBDgeSk3cIUl0zVn74X2Q951Vd3hUl4MplKiquJd1kpTxU8/oMSD7ZdmVTBcd0ZsAEabEt/Qq22DlV5o6mHdF28jKxjw4C6fYZGQm3AcXlz/5DOkbVSuyIM6ST4QR9KiJoRyy/rLqVDT1fa5cT8tAsPCpYNjCchBh02FZp9OlC3725dsAtcQlu8so6uc0nFtkoWjdw4Il0VQE0lbqzjm8czd8zNt39PFTikhLQx2QHyG21gbADp8jFz6WMMDF0Hs8AdxKBgVANIbmPgLyIgKOJ9ibZ3JiBseJBAWhl0yFoP4w== Received: from AS9PR04CA0044.eurprd04.prod.outlook.com (2603:10a6:20b:46a::22) by GV2PR07MB9012.eurprd07.prod.outlook.com (2603:10a6:150:c2::11) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Fri, 18 Oct 2024 23:20:28 +0000 Received: from AM1PEPF000252E1.eurprd07.prod.outlook.com (2603:10a6:20b:46a:cafe::ad) by AS9PR04CA0044.outlook.office365.com (2603:10a6:20b:46a::22) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23 via Frontend Transport; Fri, 18 Oct 2024 23:20:28 +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 AM1PEPF000252E1.mail.protection.outlook.com (10.167.16.59) 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 23:20:28 +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 49INKJJU010239; Fri, 18 Oct 2024 23:20: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, 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 v3 net-next 05/14] tcp: reorganize SYN ECN code Date: Sat, 19 Oct 2024 01:20:08 +0200 Message-Id: <20241018232017.46833-6-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: AM1PEPF000252E1:EE_|GV2PR07MB9012:EE_ X-MS-Office365-Filtering-Correlation-Id: b37cda1d-ae5e-4a23-e1a6-08dcefcb73e5 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|1800799024|376014|36860700013|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?Krrzvd68aMZUlQ2yt+HBHqlyYTXDkqc?= =?utf-8?q?64D9HeUZgartDh4xgPyGwlaRy07KBhwphIAQItCxwp7hZxFN/9whnShcBwOK8+fq4?= =?utf-8?q?1t+BrI+XgWPWEW+HvW3dpfv0/afSfKJKmqqRTBMU1eQ8lMCP+KIXzYmWymTNw/xSB?= =?utf-8?q?dcAofjQiVC+uwDIgF+S+6J1NIhIR4dPLBXuG4MHDRLaO8CQflu7w16zzldpHpiFsw?= =?utf-8?q?Mpr6PkIlupehUDgTr4bzDwZ1nY4GpAGurCkRjjUte4CDMXf1Kvsofd9fPFtGkzWFX?= =?utf-8?q?dPwBH5kcdNtKOwSl5uOX3htu9Us9j3YCuUbNZZVFd8WIHwPQUCvDJCxpLrI6apFB/?= =?utf-8?q?1Jng8JFwnVg6KqUCX+4db32cRjIYyhv4YcMft6xMxRiT05d3hmJS+8m28vR5y3IJf?= =?utf-8?q?JYdAbUNVrcht7eb0dVdBKu3A0tfzRjhj4CdEB686dltmfIuxABpwfdahLvfpdsuoV?= =?utf-8?q?4ruTd48QxXHX+tHT9x0BaBrZgrWYjwwh+0V28+9/7Gg8/ZUbC+xZCloxYlToYY723?= =?utf-8?q?f0HuG7X/06XQ7k3SiUN3AC9MDhvYF0FjiwGA5zT6kM/ZpkS5SWuVrk0aHmDVXFrcU?= =?utf-8?q?i6sk8U7qA4gRkkNt6vMy/qondWiVZiVHb1vkXXaMiX5GBcKEQfurhfwymLMP/YgMk?= =?utf-8?q?zSy39ljxRnlN85JFLpl8EXN+nObYmKVB3T7udycYHb41wsjVn8ECmLyvJFR2J/nnp?= =?utf-8?q?P3p2BqiEVJrqye2CwOPXl0j4JzXy0bt+BdNPrId4eDE0eG0t8WVcjolxzdHOKXFe0?= =?utf-8?q?UZueu8Q1AIRIkp7y+A4+lPDayD8orbZfoj5R6/wRTkvyg0bt6YSwA+WmUdQEP/D6k?= =?utf-8?q?9NSL4TWOD+ARj0VYS1jnleEOTGTeVASlqSYnOdq08GcEoXaM3vlIlPcHWADw4o8gI?= =?utf-8?q?4ma17I+uf/58wTcXwsixalVoHkkNgIo0cEmIimUZMZpejOFazt6XFZUwJBTOttQXc?= =?utf-8?q?S/uA9M9SlVpePFGfrCWrpaRiG3xNtgxsH1EIGp+lqdKxW/UlpWeTCsSRR0ake9JIx?= =?utf-8?q?/JKIKyc0pGwRJFnLgdJfYj5NPB1QeFUfk6PuPEcE/A/xs+ctWc9zFluAJhFWxIGwP?= =?utf-8?q?F6n7Hn0vbYOzGZ/l1wTnApdZxjcFbNEqdBbKM6ZkUoxDpRuXJKXUoI8nV5ohfgpcr?= =?utf-8?q?zzldRi1yJ7tJKs71fHNLNdCVjBfV/oSPTSo0UXTjVcZQHw6AUwV6GMmohZe3WZ8Uy?= =?utf-8?q?stolfVCY54/6PucNtfEsWXvWpp8iFdZ39qTbqVSflDrwaxbcY01aqGFb14HRljynv?= =?utf-8?q?BD9nUSP+mCmAjY6wHgy18FdHFcGm/5wQBOv5kx616DeCzjA83gZvoVHm/MVu+avT8?= =?utf-8?q?yujbNJz/Lb7uVH9iiurTDbngOYI3Wim5d7Pc2vKbaGYo3C84v3iDUwM=3D?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(1800799024)(376014)(36860700013)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 23:20:28.0362 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: b37cda1d-ae5e-4a23-e1a6-08dcefcb73e5 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: AM1PEPF000252E1.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: GV2PR07MB9012 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 Fri Oct 18 23:20: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: 13842500 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR03-DBA-obe.outbound.protection.outlook.com (mail-dbaeur03on2048.outbound.protection.outlook.com [40.107.104.48]) (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 A0F671922E2 for ; Fri, 18 Oct 2024 23:20:33 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.104.48 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293635; cv=fail; b=rfGsBXt67mEGvR7QhVxxYOKwY8/bIKLLGKugh4qX4aXxiV7xuySVOqKNkBJo42ZEs+TSLpU04CR+aTgVbCZ1LvOJqju0iVhzdeTgIa86n3D7I+k1hpWAOqbYPsozgNs5a/IqUJ1A9dSADKxxY8GPXroR+67KEXgOzpkYFB50YJA= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293635; c=relaxed/simple; bh=/jUnhM67qhllbqUJmPtYVGiT6TZs/a8KJ6py5OD7NWE=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=m8jnsZI4snjtJPXIdqp21tIEa6j/q2ACpFv3NfA5v6j27bxtMYQAGnajkQIwKxU3y44yjCNqfd3vjRN+mBEwszsjsu6mCOHdJCK05m7ff/cNL93t7J0NcLe62XoDBqXK+l+tqswNSyr8JLenzAMkQBx6NdtGwOBgldib2WxSNiQ= 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=K5DCBuaj; arc=fail smtp.client-ip=40.107.104.48 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="K5DCBuaj" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=ESGxa0zpH3jfTtUYvdFkOn2wUz6IlUOzOSoQbo5FMoQ/jJRx1kwuyCCEylVGhXxWqN5iA3VS+v5wi7RRhoIRbm7cPLaXUDMqbqISoSYdiUFkF9bdMy8CW/9M0yjXZdjjhbyXASitgj8C2rFKhjS5tWE6f9fQEIdw6WbyrsRnFXyByFy9teYxqr6wK7+zXz0EjIZogLo9Vgg4FsyXhrrn8FW8JeaG6NzFkg57D873Idco16NmN2WgWR8KKsWkSbECJz0jvptsHDcD9thBuLkfAL9pErWqaGOuko2amq29Ar6P5haesTltgyMrhZmxtX1lodDOLaqWS3TkEpoNtZ4Vrw== 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=06rvrvJvhApG7LYRr6bC4vZiKxPmT7OwntdkaM2HTEk=; b=jKRrfpcHST38ggUyq0EZNTI9KGy25ykcmz0Y4IOEW6/trDbVDksGtc2KZv7KZR3ty7MrfnQzRl/vGZvgxwBrnHKC2yj7L351KBZaH/YU628dPROhtyELc+Z5wVC5vxItHy8C5+P66pi1Cu66PtmA1+1vmPvQHsd9KhJ867oZUFvJE4PhYeSPJ+xqHli39RweLK+uLhYZEOcjXm7M22KgSGsmm+xe0+2g24Lt8ogW/7sEf3xnnarEcWS3VZp/u5XBxKAsIvKO9utlWySgKqvWSyMIEAFlvBXtLlnt/EK45E+3DPz2iKMiPIsDmv0ff9ZM7DMCPoxvpIfPINBU9X+cMA== ARC-Authentication-Results: i=1; mx.microsoft.com 1; spf=temperror (sender ip is 131.228.6.100) 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=06rvrvJvhApG7LYRr6bC4vZiKxPmT7OwntdkaM2HTEk=; b=K5DCBuaj12av9WVV6dHiwalmYn2e2ev488x7Qe70gLS6w63IE5V61nPT9vF/sZLzuoMxaJUHYo7ZnlziELwIgP8XYgCDKSsFYr7fla6o4jfWy+ZxEAKtpw4R9POCEsgKV2jU20XL3fKiaXAo1AnC8q9OZGteLkiJwVZ2Q58GX21JIiLGMc1qJbRvVthD8AlZyQAHnIU0nKAchrVemK+XZRrIs2Y1QGO7Zw3hbuKzn23fmsdOV6kamFKWnwmkw0YlOBqnVlDs6sACVYDBUBWFq4tWXXkvF/fhlMZuLnMrdsqxPNugnhYJ/vTbpzqI1cKuo4peI3R6ctVd4fuTqKEotQ== Received: from AM8P190CA0010.EURP190.PROD.OUTLOOK.COM (2603:10a6:20b:219::15) by DB9PR07MB8728.eurprd07.prod.outlook.com (2603:10a6:10:30f::20) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.20; Fri, 18 Oct 2024 23:20:30 +0000 Received: from AM3PEPF0000A79A.eurprd04.prod.outlook.com (2603:10a6:20b:219:cafe::53) by AM8P190CA0010.outlook.office365.com (2603:10a6:20b:219::15) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23 via Frontend Transport; Fri, 18 Oct 2024 23:20:30 +0000 X-MS-Exchange-Authentication-Results: spf=temperror (sender IP is 131.228.6.100) 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 fr711usmtp2.zeu.alcatel-lucent.com (131.228.6.100) by AM3PEPF0000A79A.mail.protection.outlook.com (10.167.16.105) 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 23:20:28 +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 49INKJJV010239; Fri, 18 Oct 2024 23:20:27 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 v3 net-next 06/14] tcp: rework {__,}tcp_ecn_check_ce() -> tcp_data_ecn_check() Date: Sat, 19 Oct 2024 01:20:09 +0200 Message-Id: <20241018232017.46833-7-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: AM3PEPF0000A79A:EE_|DB9PR07MB8728:EE_ X-MS-Office365-Filtering-Correlation-Id: 95ffa877-193e-401c-c578-08dcefcb7470 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|36860700013|1800799024|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?0cdyfl3tPkXksc4reVN5N1ZM9r7PNnI?= =?utf-8?q?xL8y28hLontZcJcCi2TdF4lOf2Fsvym6rQhFSRAHkXyiwYwS1HsiMdf0pJTD4Elny?= =?utf-8?q?IOiq2OqA8bGl+Hb7HLi/ogX8wKo0cxTorpsdI8iThlUnLrNudxQ0v53IQDbBW1D16?= =?utf-8?q?3+3vX0pZfTObyVCVjwbwo4d+AR/+wjytMO06/VySA9oPVCR6LFXFq8bltHsbbDdwq?= =?utf-8?q?/jDf+vA+vGWLrlyB3QjLmt/Q2r4XDGztM1ulGNsp5DPkY6lVH1P0ftIH7cQi9Ya9L?= =?utf-8?q?ljdBWhINvZGot+V9KeXLqt/41eVWggdsggzzrIxNsRGFV3WCcUHN9RkLF/cywZ+Rt?= =?utf-8?q?dogyzji2/llhE+LgRGxs6/Gq/7v/coUHv2P8MFhwRGsGa0e804mWTf+78RD7SKiK1?= =?utf-8?q?d8pTOUpo94s2xm+9BLLM5sk8RmK85FTL6XqaFUaktdyytO3o+hk/u6RDvMss9S63T?= =?utf-8?q?9OvxNvGBOv+QU8F0xdbXSkd2fZr/SUyCmWeXcr6BK52S/EWzjshYsGCp/LAFy7uuM?= =?utf-8?q?kstPgw6kFf/MSyAOpSfDO4F7btHJdzBuLWdC0Ix9ZzBfOlZt4Us3jXVDaWrl7BnvD?= =?utf-8?q?bnNhdwlu1sMUM/fC7TDJJ4RKJSg/jlQddlWiyvQ3CsWtxoWxOz3I8TZdHteAas/CM?= =?utf-8?q?oDsdJZNQ2oSfN1VR2LF4mLhxUAro4z+rGzPDpryAnmnGn4Bj/Dyjt2sXhAF3RZuWW?= =?utf-8?q?PF069pof2o39PTBdyerfsmVzjx0HquXpBhAV2Hl09Pc2X1EAMJmbyAmiFTKBZh9+X?= =?utf-8?q?w8WYTV8D+cEfRT6o3I5iJ0/doDzkDRjvyn5kREHDL1/E1q9w9joMFpr3NM95tdB8t?= =?utf-8?q?FoRVHUp90Nzap9CARw6bA/QJTIKu+p5n+Zn6GksxHbQ5nF8JLDpA72L4fPXBF37T6?= =?utf-8?q?uyiR888aovuevlkaKU7/novBAAhGXcZISkLgwo6KngTUs9wwj/a4qmRKNef5VrDol?= =?utf-8?q?7C0AqKdCQ0LtyfSrU57dJMqSjs4+3FhUgiM1NXAW5GJsGMkl38xUuEtTiLNnhLk4d?= =?utf-8?q?o0cUxuojQiex0z87VctKQbC5rDkzRVQ6u8Fcov1ogzwwEBe4U9TYjxnJ284gSRKWR?= =?utf-8?q?bHcSjhk66P89hBpkgMMB9J5USZZ88Ay39EydxZ0Xa186WB+wSfY0BPga2EeY37E9n?= =?utf-8?q?e0aRKGGKil3eDitbxSeeL4OEU/uWVs1+OMSv4RYQLPD5E4hUC4cuY6pr1MilL2yEU?= =?utf-8?q?s5gEbXWVOysr+yg/2CkYs+dOM7yLo7y5ohQHnfR7P9DcYbRHnuAB3ff/TFN9tTrha?= =?utf-8?q?OIW67yLQ/3F/pveupdUjJMzbjtawiOyFbhnURXfvUz9aHdekWK/r0+ttUYMl2j2X8?= =?utf-8?q?2Aos3mLXneY1AMCh87ejMgzAUNldHpsthHaq9iLdtKR05dEeb5JV5cs=3D?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(376014)(36860700013)(1800799024)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 23:20:28.9465 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 95ffa877-193e-401c-c578-08dcefcb7470 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: AM3PEPF0000A79A.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB8728 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 7b8e69ccbbb0..7b4e7ed8cc52 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 Fri Oct 18 23:20: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: 13842501 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2060.outbound.protection.outlook.com [40.107.21.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 8D1BC1922F0 for ; Fri, 18 Oct 2024 23:20:34 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.60 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293636; cv=fail; b=aS/UUlyQouoim1KQjwiKgWkv56iC9yrHY9EU+pljqGLtX7mtN61AlDrUVE7lewj7uoev+kfnd524/QtEZwCFkZX/th2Jl0CosMtWUSwe+dLzzQxBBXGT8b70w72wz8yMXvhPEHtgX+ieY5OcLZ5QqT9ivhhK2P1WXIN950u18c0= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293636; c=relaxed/simple; bh=jdXed6V/Yh0NaH+TDgmUGtmxQ71q3BvRQy9Z+lTQNLA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=Ni3mGk6TKzQsZ8Xo7sULEmBjWZUooRHPE59MlY0KI2Fzq+KJ5+/ykGInVLlhRZfNcx+6gcnyIP6dVNxT1iNkvOWN/VD7PjRtKH4dtNQ3sqHMAMq+mQ19PV1N5uAN0dWXAoVxOxxKtWUHOpS7mCNYq86EQJKKlwxqzKouOvm+OyU= 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=KQ2oGKye; arc=fail smtp.client-ip=40.107.21.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="KQ2oGKye" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=D5HtbD2jLVXyZ7PKW1EzoV6CIftfPmb07n05Z2c/a9xiwVaR+nncdLkKh4fRTH+n9q4E26d9rIjcuCsUDxKGpI2ciaHLSlgnLnNvs5NgM4E71g0lAtJyFiJG6QIChvRZXxii6bi7q2FY7hRk/uUEo0eSOB7zoLOP1V9rbnmhq8h6XJBwWng4rrTPOzHNRjK4gEY5bjZMRpq/zxzIncIu7AE18kF8Q+8XBv25iLMRzpELyGjjOrSRI7A5E3gt5wBJVfwlV1eNVaxNHt3S3iI4f/heDwMiPuHcrqKeBops1Kwt0ytY2BfcGLIekhNqY19SIyWUoZz+KQBFkwqolt4glQ== 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=ULMd+A5h7VJxRvwiM7CWeriIZLgKm/nirYpOmNuOV6E=; b=l5bnThfjpKnbNHBd2dX4dpMLPk30zLfjSG0BR59xrp6oLhPAjAV4QC2HkQnyvkjZXm3BtgZVTOgEOknMr/tLvW/gLIwySJ2VU9mFWMIphrs4Sy5S5fcCkK137VFLOuxVD0Zg/pLeZWAaaTSg/7qzcl7IdQFHA/JpQSLO90bMKsWBzCvbrzOdaXmTJm/rxgeuATpFVqnOUzLCs5m2zyhJx7WshC+jMxT9WO6fcQHxrPtq/CYTbp1+WyU3xiETTG0vvOLhKDx8PfO2qhATEifs2k5qXTcBFjeWLj8XXts9bqenR+w+iX7YQ/EqYDYWHmESXNnuIXQbEFx3IQlODM0btQ== 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=ULMd+A5h7VJxRvwiM7CWeriIZLgKm/nirYpOmNuOV6E=; b=KQ2oGKye9hOtNvEharYp5ds946r0pQSX7hO5fVlRiYNCn4iqQLKxJhhtxvcje90wpxxh3k5RoviArumXJl5PEzWnV2ebl+DkjiNk7T/HWRzW0IW15Lq0ZDxRFN4kjZW/REM4zRw6/lvqjy7Eay79Vv4OEy1CikkMUXe81CJrA8drI8OYkLRWicGTEQRpKCMERdFQshnHnVVs2ZH+1TnmDolgeUCqIASdyLbZ3XBJ8mmGaGjgn/CuPvwGcvxp2suVo1bfDTuNmQzNWi5Qt6FjQxCUaYQCUDzs8U07AZ4v+46MMqku7uCvlYQxZ12ixiEI1WLnpLXueI8kFvMNeUQWdw== Received: from PA7P264CA0253.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:371::9) by PAWPR07MB9323.eurprd07.prod.outlook.com (2603:10a6:102:2f1::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.20; Fri, 18 Oct 2024 23:20:30 +0000 Received: from AM4PEPF00025F97.EURPRD83.prod.outlook.com (2603:10a6:102:371:cafe::c6) by PA7P264CA0253.outlook.office365.com (2603:10a6:102:371::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.24 via Frontend Transport; Fri, 18 Oct 2024 23:20:30 +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 AM4PEPF00025F97.mail.protection.outlook.com (10.167.16.6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8093.1 via Frontend Transport; Fri, 18 Oct 2024 23:20:29 +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 49INKJJW010239; Fri, 18 Oct 2024 23:20: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, 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 v3 net-next 07/14] tcp: helpers for ECN mode handling Date: Sat, 19 Oct 2024 01:20:10 +0200 Message-Id: <20241018232017.46833-8-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: AM4PEPF00025F97:EE_|PAWPR07MB9323:EE_ X-MS-Office365-Filtering-Correlation-Id: c8f61cfd-8647-4015-b805-08dcefcb74e6 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: =?utf-8?q?WxtEpgPbJVvW3VQXReuO9bAM3B8cj0Z?= =?utf-8?q?0U+kpfFs6PGQ6aluqSPXARslQ87+cbBc+RvUqmUTmPsQ/CfF1f/vWXWFCFRmRjEkd?= =?utf-8?q?t4mwOvbKf49kZ7B/S3ueNjRL24xCLJFqwb895JOPfajGL5joQaMLdPkxn8DCOQqlC?= =?utf-8?q?P8G91xWIThvH/eknmSieqUBv+/p8ooJ26PzpP1xAY0VLgmLJ+RjLxIfMBu8h57b8+?= =?utf-8?q?hmrcdmv57P130yLnbSf8Kn07ILEhdzGJRAQ8NSKVafkri4zAAYun4tWoiY8NpU7Mv?= =?utf-8?q?OSMUst2QdXTMr0xl7UkjKZW7nhtcYX7vFHXiC55WlvsDevAzTUEdD+/QI44yAkmed?= =?utf-8?q?MozTteF1sRpblraeKIQRToGTeLB+fy/lbaOIzfzTk+mg7BJVxazEBsu/mf7dY8nS9?= =?utf-8?q?nwD9RjespeFIcTozZC03Yoxc0P397ArIXnOxN/3PRQOhzzSllVr6wEd6ek503f9Jg?= =?utf-8?q?uegFLHJx2/GwUUaDNFuBgmlRJGDFKVhPc88B1B70REXAUCVi8fFHOJrMlTILxyFlI?= =?utf-8?q?2yJzWwVFQf3RtPR9lXbIMaKWMx6ZgUNqDehSkXCgVoIdtQFRQakFxG2TK/fO7ga4o?= =?utf-8?q?E50x92YQ0MtrmxeHG66L7hpniKwHTeBPi6ouvwatleRKcL/s9kZZXRH4B7R3VjB+E?= =?utf-8?q?vcmue1AeDccFik0Nk6X91RfEn/xkKSPvt35mApOiSz+ja+8QBzgsPGy0mIAzQB9dI?= =?utf-8?q?4UV/s2m9dHlEuS9ARfwuwy1J9Vh+aAEBaoekpZVGYotNsJjiajeBae39l0My7bUeZ?= =?utf-8?q?RdyHoaTzs2QGhNowOBSXsk6zNKmGrZsHSue0Z5jpl2GCCte3JmQTd2JJD2HrMYL4f?= =?utf-8?q?ygEQEEd9qGK1Z1I70NC/j0OagtKuB/pBK+WpEKg8FX9YCr0GXHrrQKkus1Yxydu8Y?= =?utf-8?q?A1DSXgSbrB/Pj9+BMzkmTUoIYmN7Rp2m8rwQmKoCRgZ1Sj81jrK7y7toNAymVqdgK?= =?utf-8?q?3AuYcugW+XOBnra641k7+mFqd2I3Pye3Vuh409DqjbjI3D6meXxDuZFVjfca31c8y?= =?utf-8?q?6sfGa7fK7DRG58bTCIgaDiD8jeOys+DM1/7ojdYUJ4VbBRqIpLi4sSNkPxP7PGYJI?= =?utf-8?q?AhYhYbZz5zXdj/4EoxxoowIUgzOxSosfZ1Kvf/ZLmsys8+UvlqFQciKuhZ8Lf9PXr?= =?utf-8?q?//hbZqCUKa8aqshh8cRopMTWpYPzwFy6/c3K2KtdCKaa5r591yB3yzT79hhiCBizS?= =?utf-8?q?Z2uH0BrADwNbdl4VrxHf9ALKCK4lBLuBK51+gsRcL0tg92ONMUu27VlhnecXkdPKa?= =?utf-8?q?9JXkr0pHc93cEV0I0by97bB7bq3RfK0zk4G9kkxurmkGicYJDAAjc59Hl2CcV0YaN?= =?utf-8?q?/FvFZnxool/HcjNPbqm15txQBnrcPn7GMDJ4B7Y0ePZVQ2OWalMLeIc=3D?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.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: 18 Oct 2024 23:20:29.7351 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c8f61cfd-8647-4015-b805-08dcefcb74e6 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: AM4PEPF00025F97.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: PAWPR07MB9323 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 549fec6681d0..ae3f900f17c1 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 7b4e7ed8cc52..e8d32a231a9e 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 Fri Oct 18 23:20:11 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: 13842502 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-AM6-obe.outbound.protection.outlook.com (mail-am6eur05on2063.outbound.protection.outlook.com [40.107.22.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 A596F1922E6 for ; Fri, 18 Oct 2024 23:20:35 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.22.63 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293637; cv=fail; b=t6mEp9CyMCzzhUhAnllosnDNwcqzrrxZXsT6tsabqLQH2m6VcGZLVSxKcP32SW6+KoCE/CYK6hwd28X/Xhv179EivnoQaGohoBiu6l+SzKV+kK5ttfgAWtImX99lvuc2lXOiZbBnG65K/pabym9mpmso14IvJxjRp1tFAidTLH4= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293637; c=relaxed/simple; bh=97pAa0ubJvv2b2H2vaQitorxp/V/N06gJgVq+O02mMI=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=EcxlVsQ21/4DQsq1EO5vFBvnODGUahT5RlHYUNyVSaSF7syxyRuWhPRtT9GmdI6EqwzZzVVKnUFmYAtdPVOhQv1RcQFp6DNBsmP5IuxoppalblK7vHz2hqFrNgjtOrCUewClqkTaPeq6ZG9mhM0EUjPVvll0EyR+DLOMVC9nmAg= 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=owOnCipa; arc=fail smtp.client-ip=40.107.22.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="owOnCipa" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=y3kgcLfCPobjhooVVxHsPc6VYRRFB/Euw5KM7ZiYehgokhyg7inx+fDunihZ4Ix8QmRPglFfy075bfj0IJaB1lSjF8PQZnFTTE+czfdXI0iSrE/gKe5p8eZqHi3e5YjPoTNbzRfJKQJNhSR1RoswzjVEWB5k4eZecTZkQmVwpiYTOub0+mn3fEG3Gg2TlttdmiZKwqIIRYWaN9v1Hm5U7+XPVpplo1NsDNdqbq7oXntHcYsCE/hudlgbvifxDlwR+qG7Qlvc5jvY0QZ42LOJDhMF3fZHC+0TlkqoVOeCly6ORy5Ck8GiV+/7RGLRuBmj0clcW7Ale+FsZBC1lGcT3Q== 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=nz+kGr7twXFVeAzwBX767IWNa4dYXoelwJ2FNEIOVhM=; b=bag5gd/g9ZDTpmlAkCYtEjX11FkiLP+2tKEaa0feE0OoPmlYHjh43sLQUz2J4jNlZivTm5UCZb449CLTvAvEIWdt9H7BejzgCogIwKJBX9J0qi8lgW31S2OsUulk56TFlgp8Jr+yBc75vubGeaeGTj7RVpYveEE23dYVZThhx4Ae9LN+IcjciwWF8P1XnYgnY9mHr/R6RtuolZOFOaZwdIR1WthKe+9auAn44atKhF3VX7verNZ1gAzamamC3VYpSICOw9xnPLcqAMcfyeYD3AIfSiv6/c2DNYewnr1bdtBc/1b3Dx9Xb7z2pVJxZNQJSJntOJUixfms6dT3kh+2NQ== 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=nz+kGr7twXFVeAzwBX767IWNa4dYXoelwJ2FNEIOVhM=; b=owOnCipa7ZALK5Qw7bVUHN9x1Bw+YyZ8Yd+PrrdYshyheTs+i3RKCMqvVw69MnmPr/Gl/5ap38ca9ldlbA60d5n5lN2fh6iyZuKT5++XYlYkYJi33VnhONEwCq35g+EhDwS3D/bxoYqO1t1xbI9HNtE+hjaozVoKedMYUhQndSXLKMOcph/Mbd+C7nIvwsupEUKLHuEMcTY1Q2QuiWyTzCV0SL2x2d/EoW9OrZaY4pQ02Lnt9EHRu+VNgSXImhM6COAos6YKUvMtBWKZHEHglPUEKoJSJjTyGoiq5BVW9ZILKbW3tZDR7EJ/E1yGY7V4uxOLTBtDz1C5hoIOH6wA7w== Received: from AS9PR06CA0737.eurprd06.prod.outlook.com (2603:10a6:20b:487::13) by DB9PR07MB9956.eurprd07.prod.outlook.com (2603:10a6:10:4cd::6) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.23; Fri, 18 Oct 2024 23:20:31 +0000 Received: from AM1PEPF000252DF.eurprd07.prod.outlook.com (2603:10a6:20b:487:cafe::a2) by AS9PR06CA0737.outlook.office365.com (2603:10a6:20b:487::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.24 via Frontend Transport; Fri, 18 Oct 2024 23:20:31 +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 AM1PEPF000252DF.mail.protection.outlook.com (10.167.16.57) 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 23:20:30 +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 49INKJJX010239; Fri, 18 Oct 2024 23:20: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, 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 v3 net-next 08/14] gso: AccECN support Date: Sat, 19 Oct 2024 01:20:11 +0200 Message-Id: <20241018232017.46833-9-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: AM1PEPF000252DF:EE_|DB9PR07MB9956:EE_ X-MS-Office365-Filtering-Correlation-Id: 11df40ac-c393-41a4-223a-08dcefcb757c X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|36860700013|7416014|82310400026|1800799024|376014|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?f/OlkdNdk/D5bgAAywTCwCsvikv37VH?= =?utf-8?q?E+83Adfa6GH7Sj/gPn5K/JERAPx9vYff1qLoT0pXVgW/wfkCI/EiNO3ZBl+sHiEjv?= =?utf-8?q?wHxx+kSdJcRMXSMGJ5rLg8TBY0mHblX69YePylQIeUXuDJfVDvMgrnzvfh06P1Ugh?= =?utf-8?q?iRgBPe8lnotMXae1dUJvu/YuBG4CzAmULPkO+XiHdvDvlY6pp90Yu4gSpuIk+lDca?= =?utf-8?q?oyztSSPqPnuFQzBPvnpGUTa/BoYExhnxOM/W1hrCZ+lzwHxBZI5Ng9UFfkVOFFo2t?= =?utf-8?q?n33OiH7DnDkgTsPTTrR9wYPt/D7YaBKnN8fbNfWXgjSh1lAtFuDelRE36e4mzpBRm?= =?utf-8?q?O7Ar8MCmkhme6bxi/h1YXwIWSnPuwUGX7pr0X7TrGcw9AVlhIuiUOjK3L32uId+lo?= =?utf-8?q?343dqu/wXx8zBeSNz3aQThu2snPe/I8tq6aY9jC/U4wFfOSr6XTkWgPazKlWpqV+f?= =?utf-8?q?1IOH2y4HhRo8on2HnVelbC+yIifhn0RkG2k4v32p8aZdsRoaOGK+f2n3haQv775EO?= =?utf-8?q?RoK/Cpk8ZwJocx6ONP60HXmbFXfrgjI6vGoBV0ScmqAO+ge7aiF5Am3QJ0YOvWHLE?= =?utf-8?q?XGmSPVcgJJyXvMgagXjO+TEOhL1xk8m01EQGlEsBIcaZoDBBG6WOdDuY3T9RrTP6f?= =?utf-8?q?3x/vdmOGsnqsPbS4X3gEH1ckXCFrg/cnSmUHP4glvZgIdyaH9v7220PkoioS1bqOk?= =?utf-8?q?VVRCU6lbrgQ7ZiuWIXRn3DEuhtoHQeDy75Dq9dzyOKBFlVuB0/vfHxOuIxXrtaRWw?= =?utf-8?q?5kABPyQxNxEQxsuDN8Dd0xp18YrFFftwy9swU3p1omMzXmAMT59JmhpcPoGuTrWZM?= =?utf-8?q?UcRKVz/0kJPyAMR9fuaTFdpwKQlxSo9m7+oiT+BZ80X3KHNGmKkfe2P/MAebT5rmR?= =?utf-8?q?+tAlJ4KxjhGSA//mIFJPKtkH3ufa5cR+07NxiBfcpGaB6OlWHcPg402pYLdVP2yee?= =?utf-8?q?DOn7sUZNYuHGnlO7+YIMpgWf4h7T9RKVf+aILTjnboMUYZvN6onWu1Z1aW4WDXgys?= =?utf-8?q?IxtjFOXSbDT6CZe1LRf7nzZGbzFJyz/ebK+SAyhvw6G+bbjasN5AQCapc2QYNO9ZH?= =?utf-8?q?Wz5qvENij+dQXpslwTVXFFs1S1kGHb7KDjXFdz2cY7RlL4Q81riq4tUktrHBqFcXC?= =?utf-8?q?XJychGP4P++OsFhB/NW4vY5prhxQ+VWjcTVvfBaw+BkYlaCjLdYl6QKLwv7gL/Kh/?= =?utf-8?q?EQP3L1+q3ZpVsSopFYDf4KITD7zQf3kZCMGyYEHwlWPjdvY7Izi/98K4uz4/51eCl?= =?utf-8?q?qrFsGlK7DzDQnJXzsHW/cWyj7J4StCOeTFW4DNqNrJ7LglD3le++uBYmPrncIRFrM?= =?utf-8?q?8UzCmBS2nrHtBv599RP7g63s5PE6yZEIi8/kHf4uX44yAAtdJ6jgvTU=3D?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(36860700013)(7416014)(82310400026)(1800799024)(376014)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 23:20:30.7143 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 11df40ac-c393-41a4-223a-08dcefcb757c 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: AM1PEPF000252DF.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB9956 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 | 1 + include/linux/skbuff.h | 2 ++ net/ethtool/common.c | 1 + net/ipv4/tcp_offload.c | 6 +++++- 5 files changed, 14 insertions(+), 4 deletions(-) diff --git a/include/linux/netdev_features.h b/include/linux/netdev_features.h index 66e7d26b70a4..09ebcb19b463 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 with TSO (no CWR clearing) */ /**/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..6ccae6933aaf 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5066,6 +5066,7 @@ 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 Fri Oct 18 23:20:12 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: 13842505 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR03-VI1-obe.outbound.protection.outlook.com (mail-vi1eur03on2040.outbound.protection.outlook.com [40.107.103.40]) (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 356B71917C7 for ; Fri, 18 Oct 2024 23:20:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.103.40 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293641; cv=fail; b=e+GAWYoPeut5+vYHP+wc0aurYaTtiKQpkCAcVjCN9Q2KC/85jutwTr0S3gwaAh+Jxfkai6PDPbwEvL8ngMf0ovoz8IOshP5gElNcf7aAiHLTyC+D0xrMFE3iFT8pOQkWZ/GN5Ndwu64bxiV5dhxklGLlHix8GuncivLi500wyJQ= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293641; 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=hb9FH4aF+PLn3kSZr35RQa2pf8FldjxOoWeKcNOiAfqevHXVHnDbB4Z2kSAxxxa7lbjv9XDmHkv3bbzWScbBGiOE0elqG3W9TW/TYvG1HghkSSH20sNnWe+C3okA2dwQrMoXQ2C4PNNil4rRhlB3bvczf1klspnBWFx8Ot+GFys= 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=E9L3hGxk; arc=fail smtp.client-ip=40.107.103.40 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="E9L3hGxk" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=u4rw7rFREmGJoAPC9mdThqyJKmCMZLmXH59cyUoVlh8V99ZwC/FAKdgBuX1iGuiXcZMoh/gFa/udOClYDy6TpwKJaaKJLqEAR/806qy4SZ9Q7L4mQrPqao4Iv9lEsWNo78nxccrj6KJetxNPqo0nLOHNccggBJbIMgVEvn3I2FNIalxxc1NZPQh4a8+w+ZMHzSDyOJ1qUhBwNsQc7OCyzWi+1DSORd5jciRyuExP/ZhmFdc3mc8xkts7bE/4pRPjHlInIWt/3ZH9qKkI6y19HwlOoezyvCjH3tRf5K5swJZZGhEKV7zn0ukaQWhWUL8e/RwQcR7fHIkubcohNYtfsg== 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=h4d21AdKXmVgjz5sxYmww6m1+FDTpJqMdbG9AqSI9HDyF72pHgcO5mYpzWEdWOHdqB9U3kJyY3jjJmME1aJ0LNQsneGWAt/fll0JZtj8+E6teSGjfDV4tN4jLnD69GuqnKMiDXRpzgMq6IC/5RjoPvqUTlAulLH9vvhTQlQJj9GemM7T6vzvr7w1b8f2F8CV7QaVBCNwPkDssW5+5hxWlbx0R3BnqOx7NjPNg/cNShnN6ZkaYrQzA+Urbq2ZogPUnYzZltOltF3Rw1OZWYrIDe5Y8iUe7E4e715NlE31c/R3X0Yscj9R1XPRhcvk7VisRr3qwLd1p4t4I8cKnOWIKA== 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=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=VSA7eqx5WtqjVvMOGIZmeD65xQRrVJgg0ZR6KM5OeDg=; b=E9L3hGxkXRMn3bYY/K6vL+huo8zFDJ55Ug7MHhyWK9XpaslYjLughIX4BBK/U2Z11ei91R+BmQ+XXrC0zA9KODcuceGBB8OMZfjZgY0dTdl0Ey+vCoFwcQML35LsgGXSSMsTgEfP47xdp7X2FUVcHhVZW5y2MLPxIPW7O8S9Vkd2nXZOsukX+vcz0kpapKFi4sqjann/a+uiAQmp07jFBrXnBJ/2OM9fxQ6PFGXjFadh6ukBI5gojPFNs4iAphQ+22wpuzj646B9mCpdjdjJb4HDsPncW0HTT+oMH6B9XJKqYgUn1NfCwNyyaGxgcJ79FNS9wy6tN2iVfQom5HKjMw== Received: from DUZPR01CA0340.eurprd01.prod.exchangelabs.com (2603:10a6:10:4b8::13) by VI1PR07MB9421.eurprd07.prod.outlook.com (2603:10a6:800:1c0::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.19; Fri, 18 Oct 2024 23:20:33 +0000 Received: from DU2PEPF0001E9C2.eurprd03.prod.outlook.com (2603:10a6:10:4b8:cafe::10) by DUZPR01CA0340.outlook.office365.com (2603:10a6:10:4b8::13) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23 via Frontend Transport; Fri, 18 Oct 2024 23:20:33 +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=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.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 DU2PEPF0001E9C2.mail.protection.outlook.com (10.167.8.71) 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 23:20:31 +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 49INKJJY010239; Fri, 18 Oct 2024 23:20: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, 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 v3 net-next 09/14] gro: prevent ACE field corruption & better AccECN handling Date: Sat, 19 Oct 2024 01:20:12 +0200 Message-Id: <20241018232017.46833-10-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: DU2PEPF0001E9C2:EE_|VI1PR07MB9421:EE_ X-MS-Office365-Filtering-Correlation-Id: 0b919d95-9b72-44b6-0547-08dcefcb760b X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|1800799024|376014|7416014|36860700013|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?dEwkwQSxZCP7I7oTLWaJRjmh7+eZ3wE?= =?utf-8?q?u1mDObXiNMbJ8L5NQJVEhhTl+WmNje9ytxqORKYsgy4Hk9CvmMG9yzBRXli9zP2wp?= =?utf-8?q?M/qGe1ZPVK52G8GQcsNM6vjJ/OEWnmjq0LsGy0Fz2F4fgrX8FWqdd6oWI+yUslfcR?= =?utf-8?q?OUdGYJGqcHZZfwB8HBMW1a7pVuG89NTE/Yt8SvKJzOkwKR2DmrGjiU88Iyhm/pQwz?= =?utf-8?q?lwUiB/igDW5eL3pujhgkgRWdBp97dZq7nDahNxQYR1VwJmMna3+ObutmN/VSKZ+1U?= =?utf-8?q?ykc5gEt8rCG0F22KJVCkBbYh2B+Cy6eYjuSlfdS9YnQbRxrOvDQYOd+dc6sZI5pmR?= =?utf-8?q?kE23zFFC3uhYMpEOWZTGRT/Uwr2ZHEyhPkyXihGmB7zQnmkv20MXhex9DI5qX8VCQ?= =?utf-8?q?rpquDEVAslvF2W71Pt4ZrF7xhYzZDW6e403R+g388zgF+sin7MQLJMFH2SgjxYke8?= =?utf-8?q?0ztNh56IYh7e+DauajvgyDhNTMvrkmcGxGR9JaAzvlSg8kF9g59LK8TX29cM80Mbr?= =?utf-8?q?X0uwPlbS1hKUEnGN76XSDz9QyqIebeec5Cq01nQ6czbmxBrRVWMj4dZ53BObEGlQF?= =?utf-8?q?nku2eV5THWUWl62S7F/3RHQH7YitMm9jzgO91Jn5KbQuLmbC3oz/ub7/ZyfQNWnM+?= =?utf-8?q?W0wtYGz0BNJCE0tzrJZLUKV5Sk4vjLjASqT6qho3YZcO06p31Nvf5M75wHkS0aeQ2?= =?utf-8?q?z9Jfnmnly1KhCpvymu3PZgpi4TgYMPtRmJ6kfDns6e83qIKkVE9nOUdFCsQTn0gpp?= =?utf-8?q?S7hbaSyhr2d6ltBnnptoXDhdIwW2+LyP5Nc7diqK50F5YkXr2iUARcAy3dVjUdsLM?= =?utf-8?q?SNVvBlWeJV5HFA+T2rRTkr1GkMNvcENbXVU0kriuWk8ttA1IKmCElma8Fob1ZO/3c?= =?utf-8?q?VXoanyeB7tEiw2o5ub933L8JsNCzGpj3Ob1TAdmR91LdbkwVccJwVsAs+XWE7S0PX?= =?utf-8?q?gFM/wtlFCEF/CiAzdZaw5+fI3ptEdHor28D6GCWVVtRaQm1MIhVM2OUa/QvxMYhPR?= =?utf-8?q?zNZZ9XGAubt9WKkXLcFblFlHSNClFFEglP/Vcmo++3S19YLxqGPIezxbCARLWkvZy?= =?utf-8?q?eL9RsFNEtoipQ7jr0PgtK2bbrpesKpTs14McbZJah2jQYd6tn53b2MJVvOoyTUBHP?= =?utf-8?q?Fyrc2dlhmE0O1kPQvlBTq79ZuON2ssWjxaDva4NVzGea+D3pExanB2zNiO/YMSDsC?= =?utf-8?q?SWbua83dZaZTtpq53g1JJQs1Otu0jP8jFAfVCFX5MUsgVdO63RJ1o0mi5WfzIo+CQ?= =?utf-8?q?v/r7XKmvYTrgmZfEhJUqfzzilxTtsw4d+PqH8VyMwC2T5zEW9waO3LwECTC5lZQ5G?= =?utf-8?q?rZb2QynEx0o1CP59DjBze3BWnpT5TVkNzrmueq8/UAQU9GHD7DXLfrE=3D?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(1800799024)(376014)(7416014)(36860700013)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 23:20:31.5882 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 0b919d95-9b72-44b6-0547-08dcefcb760b 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: DU2PEPF0001E9C2.eurprd03.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR07MB9421 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 Fri Oct 18 23:20:13 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: 13842503 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2055.outbound.protection.outlook.com [40.107.21.55]) (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 7AB3A19259A for ; Fri, 18 Oct 2024 23:20:36 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.55 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293638; cv=fail; b=djRFQHS04TrAMsxzmTfgv8ObCIKsBKCI20CeHe3Tq4VNNB+hnGEbtsubCWhZ0deU1XfzUEyB5QTyqyBsjn7VxVAK9oE85O/iIkoSKkLOT8CTPw4BlCfGQQSdqUDE22twkgX5mlVURA3fdTJ1H8OD/3SXSmXOh6UH+CH3vA1eLos= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293638; c=relaxed/simple; bh=fKBbeaPVW8DcZ6DYlD8c8/FTqvLtUMcI3CoRxLvDMr4=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=ED/jmWYLq1LRKbz/TEENkfdc9H3NrRViSEPaP++DVdfUw+wSQ8dlLC6R3LMU6OwA6yl+iZEnZMR87ZZkovxqepoCWW3VylRzz/elPEWAYsgwEQSi/NeZOTSBBY5+Loc0j/CKbSxVIzC57inyRUSJpPOhPsDh2ETtaJaLW7Hu0VU= 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=YrtDuW4E; arc=fail smtp.client-ip=40.107.21.55 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="YrtDuW4E" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=bPFLNFOnKkakfAF5RcF4FpxAOXgLri3NChCsJQozp8jDKLJ6O5tb75g+g0QvDvnwp1LwAbpB0KYgvoW/MGJ2VOHybqti5EWlAw2LTpoNhUJGy9J0hiTLB7Glqgmwd4vHjnkNJ+hFaYJr0hZBVeaOYcPRj8YYaEU/Ns5Ncl/XHvj1nzy7ztgMQO9Vh3rRmSN5oYrTGOdjkht6B+RoozBEwyiVtjkcigvVCqUjvMlRbDoXC6MA08McHvrSj7OTetF7GENqPUjGHeiPGxlj+j9KFE/u+e1pGsDmS8k1oHgopTxJCP1o2vnVea+/oIPQO6sCj6sEWGvo/TBEZ7nKp9WZ3A== 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=JS+bjUXzLdWxU/fiVihhJtOmIUpj4scV3/uP4j163Rs=; b=N7OzOgGMzk4Uzdtef4aEFeU7Bjq0JmqDsrpRf/Cwtpf+1/G5ap6+AGEr53I7Pf5yxykHkVsYIq05OJxlTy2Tg/jkwLFLBMkHjTTzxR0kS5bKrEPLMSlxBQjpzK6DIRVdc2F6e1NzvRuyNPda13ZYf6KqURWLAqgVowikHpk1ctOQws3t6QSCjBm8lBgaa8bomR1kDQJ4QXeMp9x2+jo3pT7O1tBM9MjOanubzWY4DfhlV6oQCY3mKkWGyefFkF+1/2eFS9K8F+84wSE8GHxb+dt0qWSsv37aXUxtt4LTQnBXHqyS23Ra/HQejpBML5w0Yai/CK3DPUwC0g/Ofb8YRQ== 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=JS+bjUXzLdWxU/fiVihhJtOmIUpj4scV3/uP4j163Rs=; b=YrtDuW4EcPysS8Cacv2vWbprGp7YI30lNN1uxdr5t+4j2mxOpjVaxbEojNyVx/yxSFoiFDCUD0LZZPaexgqe7DGcK1D17uO+ZWMmL6wO7EztNE+5RsWDsYBsGRav2VqcjnkdBXI2DJBvZ5Kf/Uthl2DqDkQnzgdKeEopFrrOFyNI7i2HVw5Bbcxq6hk9CrDM2lGv7iZbabyifIIpYIrfx2sewUpMw41FEwmE7h86t1LLH5bPmQAzxtGDtufRxh0pKPV/5vqTLVAN24RMrPDmh6Vz/Sz+cbrMzlqjpEOCDjCEexNDCpFLVnlRzxp+8OPVviUQvPD5MIyoZ4SraINN6g== Received: from AM0PR02CA0186.eurprd02.prod.outlook.com (2603:10a6:20b:28e::23) by AM0PR07MB6418.eurprd07.prod.outlook.com (2603:10a6:20b:158::9) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.24; Fri, 18 Oct 2024 23:20:32 +0000 Received: from AM3PEPF0000A796.eurprd04.prod.outlook.com (2603:10a6:20b:28e:cafe::38) by AM0PR02CA0186.outlook.office365.com (2603:10a6:20b:28e::23) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.24 via Frontend Transport; Fri, 18 Oct 2024 23:20:32 +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 AM3PEPF0000A796.mail.protection.outlook.com (10.167.16.101) 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 23:20:32 +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 49INKJJZ010239; Fri, 18 Oct 2024 23:20:31 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 v3 net-next 10/14] tcp: AccECN support to tcp_add_backlog Date: Sat, 19 Oct 2024 01:20:13 +0200 Message-Id: <20241018232017.46833-11-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: AM3PEPF0000A796:EE_|AM0PR07MB6418:EE_ X-MS-Office365-Filtering-Correlation-Id: 981c5f48-0e84-4b88-8f12-08dcefcb7693 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: =?utf-8?q?aSln5LrJsPtcTIORsrrBVf6rO0d0hyP?= =?utf-8?q?X18PmKUSssHMEK1nlrzdYYopyQd/WMfpHKgJ3jM9YeU6CjlMo/XmoJlnnJ4JTmOmD?= =?utf-8?q?PJa/Ku+SN/4A/eo0bkZvlghUPql6jYsvg++v0oDT60p0MSLEgJ6ggplpeOlqNYg38?= =?utf-8?q?GbDSoj2BVIZS2YMpOQmY+rxiXILhHVH44OLugOsLMvtsyOWhUF4GSRy+zBTpzmAQX?= =?utf-8?q?PQoTC5q5qQrnMjS5eog/0VwwOz6pnJJlFwr5iBVcEv9mekRaABsshc8iyHSG7zYLz?= =?utf-8?q?KZh/MaG2M7E/LyOLEG0nFudP6VctfejMBU0RQR7ygJNGk09ned2zsx1Y4giYb8cGc?= =?utf-8?q?oyFpMa1YtA6a3Dmcx6FpVoxURYvbOqf+0wFRNI7CQ1E47EUHuewpIvh3HAa7e5fyD?= =?utf-8?q?/649+KRRUNexaDTSZzIblV6aqePuZNpC1kdCdtUuIsWd9PshXMl4ke433gKJlAdt0?= =?utf-8?q?IkgbJJT1VOo4lpp1D1Gtfng9KbaPHTdBmWdjruIvOCBRVyWFMBFgnRFnyopUEGw1a?= =?utf-8?q?1G+E+KN3bVYrZBlDnyEAqf3LfRLU9wT0RhVXJ6TAvUD42z7AY9ck7+PqH8ba8eb7b?= =?utf-8?q?zJXhohrfedZ7hPIbsAot6Ia+9AdzdLDWcnR8DmCQ8X+WnpeBQFukEAxtpYw5nsvV0?= =?utf-8?q?m7liCBfh9DmroxbuVq2WwhP5DQ5nrIVrGHUmz6xkvkeKA+ksZc+9IHzBGYYZ1izKR?= =?utf-8?q?uj8xhRVFhNf2ZkzQglQJXSEoHiy+UG0bA5o+F2iyshWI3mcV5gv76rWSLSC4M5RbS?= =?utf-8?q?B++0wVrYBdpyE4k3q57JIUsP2wiOfTcJ9aFhIBpvdDvshPKGnihUI3RPPjuJTRGfr?= =?utf-8?q?obkf0gQ0Ab2iFuG6mxpiqcwlh17Q4C8IGH6HKFeEHlD28ARJLpPRAzJcb8MtPNmS4?= =?utf-8?q?eo+kWCz6ATRQCTvLyKFxOszj8AQt0fihulmwgi+oBDM9Sbbl0XaznQuxG3N/E/rnW?= =?utf-8?q?kZEhm1SJhKZPS2aNKxwbjIBNli6SimOa/cGP3MX3GzO5s9gthGEEef3QnZGJz2DAO?= =?utf-8?q?MR3KP1UeF1AZylxx6aopwW+xbzOrZIUE+TRLfDRIO3t5sNsdj7no9GA4Zb/l4GSRg?= =?utf-8?q?dK5zjZM6nyEreqjFotlyMKIWTe4QDsdLKEpj7skWZrLQ4Nw71N8/25e/DulHaCf9w?= =?utf-8?q?B4jcSAdGQUZb+0j0Y264P8LG0VhCgRTqqI18jLnzF9ykElN7KPvReSyOKa1rHiTGC?= =?utf-8?q?HJ+KNrDjbvLTCicEOBMaG0n3aPf/JfK674b4I0epr+0609uDguDibsMteoZoaWSgH?= =?utf-8?q?OxRqA8qfxIvz/dTsuJEHQ3nEhf4AV3TE0YXqOwPFJ/vnxG3E5+9d4WMFWSmi8nTSi?= =?utf-8?q?eQKRLa3Zrqf9tjoumrhYsBtJGuTj+oP+Brq1SNwRfapUjS6cEiJEyms=3D?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.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: 18 Oct 2024 23:20:32.5299 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 981c5f48-0e84-4b88-8f12-08dcefcb7693 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: AM3PEPF0000A796.eurprd04.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: AM0PR07MB6418 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 | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/net/ipv4/tcp_ipv4.c b/net/ipv4/tcp_ipv4.c index 9fe314a59240..d5aa248125f5 100644 --- a/net/ipv4/tcp_ipv4.c +++ b/net/ipv4/tcp_ipv4.c @@ -2054,7 +2054,7 @@ 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 Fri Oct 18 23:20:14 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: 13842508 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2082.outbound.protection.outlook.com [40.107.20.82]) (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 927D0192B63 for ; Fri, 18 Oct 2024 23:20:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.82 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293642; cv=fail; b=AIybKDiK6phCq0vyS/SbZwDuhSYE7kgmO1/K6PK1oOse+2yjNXdn3F9FK/6VqheuifpcXb+VJP3N445o9ucKFxjxm/XNiu3C6KQkMSKRxZPDc06x+Q3tjzp2taZyDY+t2vPykxaFXXE8epkErwySOl7vw1uqFcH+F5fXF15WbnM= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293642; c=relaxed/simple; bh=ZZLBBPsXEl76UOxnvAZ1AxEbusKk9Gb/BZJI0Ei8xMU=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=QpDYLGz68MyDPKFI0VFDSv51WzQfBpraNXR1NusEypvJHQwO29LPJOIQtCAcyK2zw9xsS9ZrCAQHYqyYt6a4DWi6+DcFRskSjd0T8NuM/io4M15U5fPdg+MVORHSq2ZTuNumd9N0PgpslnC1DcWYo+8yhPWoPEoEgqeAXJmDtxY= 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=TnYKOhMC; arc=fail smtp.client-ip=40.107.20.82 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="TnYKOhMC" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=KTY+SLNOrgeeq/ZS4L5x+yBzzhHeF2nSFb69q4H7eVe/7Tx1pn3i4afdSpP1SHH4cZ57AN6ZATVnSM+gY9K3lowTMMei7IT4rQEL/HsZyp6aBevfkWWGl/3y+TOHYG8DjBb4e3Y7GnQL/DgSKUSb/wPXGQLvX5qAlXffoxmRZuuC+OVwTjtHeXrTNT6YucEHWDvE3bpkNJSO8Z4It8RDZ7RRG7vrmj5xz8RtmVbmVm8BLWnkUM0xDLce/etHem7Fg9nt8VAf+g2leCzQGiAPEMa9z4iQl9plPUZUrJyAFXa/O77JWkxoerNCJ3rmWy9oG8serWEdse/QfwQFQOJsWA== 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=sTd4kCFgA0flO2yxP58SbyTLmsBf6cIegpV9zqGv+Ho=; b=wRR4XvHYlLkAsu0AoSTt1qhbuTpjv7HI3yro988sWIeAdrBYMKfoAJbYUdjCIEoST49LLHCTTSHlh+ztyetLuv/W4Ivdkrte7xK4kFI8TZvPq4m6IjqwWEq3PC5MmTbRQ/lw4LPgpWTwfOdm9vlN15hYrmzgB0gWyHqemu36suZMw4hU5T5A3ZJkpKC+B5bFZYuXa1DaXQLUnqwzld6KdPchI1i01dlNDX5L3yI82z8H+QC6B13289T3ss+qgae/aNgwzlawZbvdVnxwq4PysTqRQ0bQQHScYDyvRIEyboiwLjE74rGfjuPmffnfiVHxKL5nYbJtfj9WjmAnQAoTKg== 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=sTd4kCFgA0flO2yxP58SbyTLmsBf6cIegpV9zqGv+Ho=; b=TnYKOhMCELafpPXMCKFeVdwIixFGjnT6Ur6Fclqjz2/SS3MRieTIFn5e0czeeTqRZL2PeerO2xTFwGhgBLG22AxO7z0V78oVbR4d4U1jQrX5qebDn6EXUDD+TtHjifs95Ljf15pPnU0yBSc6tV9EXJ3j9CNkORetoB/A9hfo4lTaEao8/fcbO1NgyjYEtRHZ++r+HWm2bY3bAU069dCoW3PrTLc9Qna3wXukecJCnWGF/J8c+xmR9ntGUU82AWE2cuZw7LBb/t+XBIzHOxBFeO13WxEUB9eZOGOCh133jNV5bhQtfHCSONmGxlk0Hi3hGdZIRKxB1AbzSpg68+3Uhw== Received: from PA7P264CA0145.FRAP264.PROD.OUTLOOK.COM (2603:10a6:102:377::17) 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.8048.26; Fri, 18 Oct 2024 23:20:33 +0000 Received: from AM4PEPF00025F9B.EURPRD83.prod.outlook.com (2603:10a6:102:377:cafe::f2) by PA7P264CA0145.outlook.office365.com (2603:10a6:102:377::17) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23 via Frontend Transport; Fri, 18 Oct 2024 23:20:33 +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 AM4PEPF00025F9B.mail.protection.outlook.com (10.167.16.10) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.2 via Frontend Transport; Fri, 18 Oct 2024 23:20:33 +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 49INKJJa010239; Fri, 18 Oct 2024 23:20: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, 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 v3 net-next 11/14] tcp: allow ECN bits in TOS/traffic class Date: Sat, 19 Oct 2024 01:20:14 +0200 Message-Id: <20241018232017.46833-12-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: AM4PEPF00025F9B:EE_|DU0PR07MB8945:EE_ X-MS-Office365-Filtering-Correlation-Id: c4a5bbf4-1ed7-45aa-0121-08dcefcb7712 X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|376014|7416014|1800799024|36860700013|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?kLivgRDxB7jCbcsA9Ek3E4rtUdtykvY?= =?utf-8?q?YTzuGTBwp+vx+O3yrZOQF4bWbMmIZPm9R7ECIc0Yd4OfpNjaS5yN4KY1xPKrmWR/4?= =?utf-8?q?cjnjX/F1b2ln56v3tUVB46KzynuqAQ7/Yo7meqCMb2J+U5IfP/CpC4WI6zbESUcPK?= =?utf-8?q?FnCnBgMxYXZY3cR8kWJd5VZP7NAYifhfYjhqOaTIKN2kKqWDKMizNIIyrOurz19//?= =?utf-8?q?R0jAYDFPnnwFBBexfg/cYMaIp0hVtrSegAqhdDQnv/WnyODYUmSr/1Md7i8G0OPgH?= =?utf-8?q?hCTYcOJcPprYcu5k1SgA6/FRL/0HRVCsFB2eo/jxCPVGiWKXH2eyr/wkeMYHO9rCg?= =?utf-8?q?lpWcT3dEkUMmx0YlDCxJSzx2PdSPHh90kVrgHB2ZTOOy7Sb84B8f9SDkhm3DHxlLx?= =?utf-8?q?GiEXJzI0kMRyRvwsj84AIu3xiMhxovYthaC06w9+dOLEDg4Nh4+S47D6f88rOKkga?= =?utf-8?q?MwyiJxi2wa83sdhApnvh7+IzEMHMc8lwtXLWt8BvqyYKnWFuaUUUBi8odIgaqAG4d?= =?utf-8?q?t+71xS6SFBWBphus/xxxM6Ev/O4L1GyoXjE+SOL5nfWvL2F2k17u6vHso8G0cQmsL?= =?utf-8?q?a3oqsT4TRlL/FWUE4QsDyhJ4AsrZy68GVUgi51LMrZgIWvnSz8/2GSl3/gyC+7fi3?= =?utf-8?q?GG0Gug7gjZxALPjxbRuZ6k0wMtlBT3y7jpXpHbUB9W8wePshvZ1C/2yuv5J05sZoH?= =?utf-8?q?pY5SE2qqrO1cMo220CDzVHORQfK1xbVSQR4U3PN2zThO7ROt/Yy7XOn5ab6Umowo7?= =?utf-8?q?3w8V/c1POQZnT4sbVhv+fqic6hPUuDVxkwbhA152M8i7pwQEhyaH5EJ1N5DxFZHA7?= =?utf-8?q?l87nr9FKMHClCbUC3bDkHJ+WcJxs32BwA3ckyYrVBQMxkQVGGqiBNeGAuSFvmAhB2?= =?utf-8?q?S7uUVxSlcY3WbsVajgl5t9pQQ/i0cCgtBV+ZBVHc5uU9NCzMPZ587vt5m//3nWxU/?= =?utf-8?q?ty0nHz3htXpAUyu1iy8rsLnyJ7aX94do0dqRPX9Pjl6Xx1FrEtpbukrWh7mXYpqNv?= =?utf-8?q?nt5jKH8rLkJWK+cAI99hoy7gOVPk7EthRWRjHjp57VszEeTSmbVWPSuCX42eR+iA/?= =?utf-8?q?LC2//7zZWUFa3VbPpX/JHPs3CiBVSO5InGbsAOxx1Lu71fOSNHDRaqLsP3pLcdhyY?= =?utf-8?q?D7wEVso9ZK/EYZELKqKIbAwtkU4G2i2SeWEciUVsvfwog/CEbpMDmSAOrJFXtCd2G?= =?utf-8?q?q0RbK7QWXjJKLm2dTezYpLI+AWfUFiboT7DprbCj1V7mgQZNXjFtb7iI2t6beWW93?= =?utf-8?q?4Q9MIkzxD9NRZmsYuyThnwxpZkigtMHkGM5O5667KOkTOYbomcN+nTDKG7dEECkBz?= =?utf-8?q?d9927U98Cznu03AcrApnaR/IG14grTgitWkYwQgplHTwE8Yh30UF744=3D?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(376014)(7416014)(1800799024)(36860700013)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 23:20:33.3586 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: c4a5bbf4-1ed7-45aa-0121-08dcefcb7712 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: AM4PEPF00025F9B.EURPRD83.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 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 | 23 ++++++++++++++++------- 5 files changed, 37 insertions(+), 17 deletions(-) diff --git a/include/net/tcp.h b/include/net/tcp.h index ae3f900f17c1..fe8ecaa4f71c 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 d5aa248125f5..9419e7b492fc 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); @@ -2177,6 +2184,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); @@ -2404,7 +2412,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, @@ -2425,7 +2435,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..d9551c9cd562 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,7 @@ 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 +1753,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 +1975,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 +2001,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 Fri Oct 18 23:20:15 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: 13842506 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2062.outbound.protection.outlook.com [40.107.21.62]) (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 70289192B75 for ; Fri, 18 Oct 2024 23:20:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.62 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293641; cv=fail; b=p1MhYLdVFkKxY34OVbUJuHl6L377PRtZatZtjlW6JSlU7guaBqnm09ByEc2MKWv/JcQM1IqVeDluZ8JSCH2FGJiQJFl4BVBRJ3QgxvwEo/55IfH/rP7s0WH6ch3YkysNOhM1Uil0lUwhX7M7GEg0FR8Qcs0Z5rxsyXmXrajRsKo= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293641; c=relaxed/simple; bh=Hj0kpmxspiVLJX8wpFuphNG9SkyVLpob5NDj2PecjNo=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=J5ojd20ssSD6INxD9lbD0E6CYi5ayvwJfn1AMT7eibLs/jxEC5nEZPIPZuf5Fky9NLeam/2fKTh5r/ukP9VADKP3JvNZ4a/94vRefd3K/H5M3X8E6EA3vH8rqNNRnMXiPaOBnKceLJN2NsO0xFFI/ZrRGUL4bA2fY2zDrtCKvis= 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=LZyIYUA9; arc=fail smtp.client-ip=40.107.21.62 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="LZyIYUA9" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=vzLFMP8Sr21yLgcfGbgVD204ILXGPjmhbiBp9xFpRuXYebzr41E2dckDdAQPhKUtyPrxG+TTMn50hAsiKNj/YYgQGZdHwYpEleTi1lgOH5zwTFvlu8FzBe2B+4QI2Yt7QmGzHBr8Pn3YHGHQVPY5W2gaSjkE3znCN8bVcIuXUtU76z7jvfbYHy9pyd1zZsNhMACZ9qeUOOEYJC5JDcIqK5qBJP3dWFgjyVQFvXbEW3oge8OntmwajwSMi6P3oH5/TlGO53fXpzDr+BCOKfXJOjDxlfXYO9gaXSj9cHjaT3KMFtt5R1/MgoRa9i4GZuiOg7bpOUnhhXYqlCpJf1KE0Q== 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=rCqXZgcVxEPh9IHFf2QtfPO7QyYHVQhvrr8fzI5X6LwfGgMOXmk83G0UNSogcU1UIHqr6uoV4oZFVaWFrxemxsmFP9fuCe0ePfaA8fRrxSsfYb9LDdGLT8Lxi0KkZnLEgfA/DUIzmjhFuAH2GxfNb+kcZC1hEuASUrFt1gKirh5t4Nc+OLWSw0LoGEOQLD19VEf19d2/quAQiXvCUioD2ANKCz8mMkWpEmhc91cIM7wsHd38GsR6M1tSso2tZZ1d8eW/zxna53elaZCdQFvrSGfFfTzjq2EIVpMVdzOTqXq1GMYUV3j6NpL/E96DxpFV4zBHXLBPTLWVGvtbO137oQ== 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=LZyIYUA9ZeY17RlbMjQY4urH1TUgZl4Am+MDmc0o3A560zIWshuvHhGChg7McDtL2IvLqi5MTx4DqCBQVuI6wgpxraLnMwrEai1a1SG7byrb1ctchfygL9siruWheZhncbpYru/6oJZhdwfC9UuphdjpNC2YpJW9ydompGaN+rOBK9NWccK25HC6iss3YPXcIbi8RpIXbZyaf13Iw/zWMV7cpNpjcy2ysXJ79wkwurVrGp+gTQVfwfTqeMQAG18dx/8k9osIZ18k2XxdqiGt7gPpGZLK06qc+3EvyF/Cb2vqTCeV2/n8RQIyKYJGdH9dBC4uIZ6pDGI2igIuLzfFSg== Received: from AS9PR06CA0640.eurprd06.prod.outlook.com (2603:10a6:20b:46f::8) by DB9PR07MB10073.eurprd07.prod.outlook.com (2603:10a6:10:4c7::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8026.22; Fri, 18 Oct 2024 23:20:34 +0000 Received: from AM1PEPF000252DB.eurprd07.prod.outlook.com (2603:10a6:20b:46f:cafe::d8) by AS9PR06CA0640.outlook.office365.com (2603:10a6:20b:46f::8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23 via Frontend Transport; Fri, 18 Oct 2024 23:20:34 +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 AM1PEPF000252DB.mail.protection.outlook.com (10.167.16.53) 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 23:20:34 +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 49INKJJb010239; Fri, 18 Oct 2024 23:20: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, 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 v3 net-next 12/14] tcp: Pass flags to __tcp_send_ack Date: Sat, 19 Oct 2024 01:20:15 +0200 Message-Id: <20241018232017.46833-13-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: AM1PEPF000252DB:EE_|DB9PR07MB10073:EE_ X-MS-Office365-Filtering-Correlation-Id: 4b677275-6329-4b1d-e1fd-08dcefcb77af X-MS-Exchange-SenderADCheck: 1 X-MS-Exchange-AntiSpam-Relay: 0 X-Microsoft-Antispam: BCL:0;ARA:13230040|7416014|376014|36860700013|1800799024|82310400026|921020; X-Microsoft-Antispam-Message-Info: =?utf-8?q?zaF94WRro/2WGhGstvkTeNjKRovi7/U?= =?utf-8?q?UJgsd0CEAz7C1wmr02PaClV5g/K7lIAk7TrTkMrbllZmFQ9R29IrR74UUjo1ZUuoT?= =?utf-8?q?mY3/ii6Ht1pgi3ahUBNuul/vF1LzBwMDJ+lPu84IM77SsUjY33sg5wjepX4DI/+Od?= =?utf-8?q?RHwGkx/1X+6lPOueKo7HPakGHl219tZq2YUoqNuSGJgGsS9q2hEBPOh/jwC1fi0Vf?= =?utf-8?q?t5Flp0Dv+HnOH9/hMuynn04ZqBFznSnCkQxRwGWoJ9atiF+FMJYklSG9mCCOHtdI1?= =?utf-8?q?b2TaDC/eKIc8VYqQTXQ0TCj1L9w69qUShowarGCBVxFdk8Jo7PbEtTE+T3gOPyVIX?= =?utf-8?q?s7sBc7xFQHBSUp+h+QVmNU4e+538GHSgXPWRKNKa2mrUKrTa88TgLJoPE4sXGKBZG?= =?utf-8?q?2ResWqjRVvNADhTs3FfLotmMyyiWCkGwXyDJHFGj6CqYJLBumQV1lHfoAJo0F35Pu?= =?utf-8?q?aFQPoXxKg2mkkSU0+aoY75XGeqEIojQ9/nJ9ou+cMdtcHWRPrL7o67XBmz3K4V1tJ?= =?utf-8?q?utzg8ov0rruTYG5Rn6ApFCOU9NBZCyBdQ14+PPDbH9oJScXjY5o1xqFKTr+x1SciO?= =?utf-8?q?O9W6iD1vCvGmudUA1nBwuTS0P56Nsc2W+9v3Y3X1JKmMUzF/nIipi6ScFYd8Rsigy?= =?utf-8?q?nCAo7JKC9C20CvYtccHO46vBDit+z2VCwmjQDGZNoyjfRbsVmy0rVMe7EkxiwYSrC?= =?utf-8?q?94rkwEbwy3i3kT2Y+iH4FP6BT5bPbe/HV2rELVjjmN7a454CO1v+/ec51Z6tzl8sh?= =?utf-8?q?SCNANXuLuxfN51EVF9ADaG9Zc5XXIpAftAwnWTZaWBfmnX5HEGqCd52mWFevT7O7y?= =?utf-8?q?cVdA+pol+lge0sv570O4NKLQquYawLr5dB3RUfe/CKUwK3a4tB659an0zwoiAlCdt?= =?utf-8?q?BPVkeXOYH08cp3uL5a1X62reF+K4Jaj/KIsuYxNMtTXoWIBJyCS5NqY96hGGhGkvk?= =?utf-8?q?ebpsR/qzw5jF44GJ4oYzjE/vU8dYy7oB5/peTLXMYs6py410te1Rrd35st2Wm7SZj?= =?utf-8?q?ywvR8fejlunZ6icxeh3jD0a/GC6ZH8MiFzhUgzztOMZPOaABDcGTzS3LTcTgcWrJe?= =?utf-8?q?Qd4h4KyxVfWcktJguiK9O4ciwUMv7HIdUN11BDCWD7QEW39WzupH/IvaCkK1qxI8I?= =?utf-8?q?Yvkdt1uOhYsm7wQkFEuZCblRD93ihobQHKQrEkJVdpfH34LEPV1rBtNeP7p7NP4wG?= =?utf-8?q?dmt6lmq2iG04tdqNIL1oHd4DYTJ/L4oH6+aQ4RCJZXl6UB6X5UzOJoK4t91e90NuO?= =?utf-8?q?u9VTIZkJuXIpYCOUaUp2Az+2DS2pTEKureHA1+p/yJzNL2iiI9WEFU+XlyS7d33Px?= =?utf-8?q?M9gFGbJ7lpDxi6SyFw9Ax9Z+2rQV8LZ6D/rJSpsV6KjsGldZ98J8ShM=3D?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.zeu.alcatel-lucent.com;PTR:InfoDomainNonexistent;CAT:NONE;SFS:(13230040)(7416014)(376014)(36860700013)(1800799024)(82310400026)(921020);DIR:OUT;SFP:1101; X-OriginatorOrg: nokia-bell-labs.com X-MS-Exchange-CrossTenant-OriginalArrivalTime: 18 Oct 2024 23:20:34.3463 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: 4b677275-6329-4b1d-e1fd-08dcefcb77af 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: AM1PEPF000252DB.eurprd07.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DB9PR07MB10073 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 From patchwork Fri Oct 18 23:20:16 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: 13842504 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-VI1-obe.outbound.protection.outlook.com (mail-vi1eur05on2080.outbound.protection.outlook.com [40.107.21.80]) (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 DA7B8192B6F for ; Fri, 18 Oct 2024 23:20:38 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.21.80 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293640; cv=fail; b=HI/BLfGyIgIy0st6TQqtfGUeXWQ9JZalwFMPjxx7xGUjDOztU8AbdKyHlD/5wA9bLyZ2Ie9wR01v8bPE5PiiOX56gOCkp6DLmgYAuWLy4Ih5pkr3zONBpbk+zt7/xNEmchb0lC9KEkSxF77HAxOaeJbneqVP+0p3u+5PvBeMz+8= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293640; c=relaxed/simple; bh=aigVrtFmdlODcoDzUAkTu2EEDAXuRELqVFW7iXHciWY=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=rLVkkENnPGsXNLryjVHd2cte/VUfjvsVZIoEySeKLwtjL4nATJWrGE4BrRvON0NPR4fKB9g6Cq0Pn3srlIunadIw2BMW8yqXwZbP7+XroUD2RbwunDSgV4z3USTmo0QSICLFCzObyW1P/UQrOLx+2wTA471Hc6Jn/JgYcIANzFs= 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=IRNqT4WK; arc=fail smtp.client-ip=40.107.21.80 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="IRNqT4WK" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=fH5099sG/x20iksmuBxuPhw8uHM+EQFVyjzVgGpx7DSj/l0xqzJE8EY6jxL3FEeSMm0usB91WOeQWtgr6aovmq2Sf7FESKb2+E2ieayI6+T8hmalEBbsPVv8z2hkBU7vc3P4TuAc5l0AHfiiV0KCwwhOkyXICcpJfYOEfmUWpQHNbLtqReQUpOu5ssuapdwz4ZwZzCBCIxgLfNHIMZ2OMmKXe04Z8IPbxpgvjVpIbCQZmK7yFbh7xoX5fuDP+9miEc1kWjpAiWwcEhXv+CLa5fzAEKa9jJelVajeRZreIed2kalYNNmmfnnolFr4RECcvmRSe04N0m7NcDo9h7dt9w== 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=vJ2Zs2Gxo2OyAAcJoMPJbYwF6OJWjtnEVb5FPocbnWIQI8lGM+ynuPX6LqDWx4FFi1wOMhcnDtZBUQbnNp+RVgm4zh7f/Xp+Sy95rY3fz7XW1ST2tyGXzgk8W9/b428vhq178jPTlhVgcjgVbnvs/a1R0Ub47LhptilF7/C4+DVXdEZYNYFd7I/AxXU6JJyhxfQ1Y/8neYl/jDmR7qp8/Dik89sHBrCC72ApWOSYrauz/+UhzMmpmLc0CcqY99LjTfc+j3gqBITZxRDDiqVNdLAhRTHzmzrjpX0g/QCZJAGm4CnoU/1JY5DmaSoi3E8iMqQrdep/RS7naxWK5Q5yKg== 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=AwpGt7LZQgUGaYqfl+JpsnW8PuU1p5tVsq5y1AfhjMw=; b=IRNqT4WKzbMjmKa6p0+FCiMcR1r8u0WiEeVTYtN88Xz6L+ZE85nrw+SJbiQE1Xac3vL9jMm1na+8kgAZ1oBnEy9U6wfXSmZWmC5X+HKOonNWAKoTa/jpvXR0aDPBsi+A3ji8wQozhUAqm8YOttn7fCDpTEO3e+yydKx4lkTLPbXHME1lwCcmvovYPHpt1z0b5GXqQaM24NOv5oP+RAF6Vewk0Lw8mgxakNkGKVEPPfsAWer8caXdAHRcoWqM8W3QI8tafz18LmMI4kKvMaPPz/TrLclbXdSqnFniFVZD1URKE9zh2wdv6w1dJ3n0IstC84On8XEFpu99+JNfjPPW0A== Received: from AM0PR02CA0207.eurprd02.prod.outlook.com (2603:10a6:20b:28f::14) by VI1PR0701MB6768.eurprd07.prod.outlook.com (2603:10a6:800:19d::17) 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 23:20:35 +0000 Received: from AM4PEPF00025F99.EURPRD83.prod.outlook.com (2603:10a6:20b:28f:cafe::b7) by AM0PR02CA0207.outlook.office365.com (2603:10a6:20b:28f::14) 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 23:20:35 +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 AM4PEPF00025F99.mail.protection.outlook.com (10.167.16.8) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8114.2 via Frontend Transport; Fri, 18 Oct 2024 23:20:35 +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 49INKJJc010239; Fri, 18 Oct 2024 23:20: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, 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 v3 net-next 13/14] tcp: fast path functions later Date: Sat, 19 Oct 2024 01:20:16 +0200 Message-Id: <20241018232017.46833-14-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: AM4PEPF00025F99:EE_|VI1PR0701MB6768:EE_ X-MS-Office365-Filtering-Correlation-Id: d353debd-49e3-4309-454c-08dcefcb782a 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: =?utf-8?q?FPsBZRSH9Bo8fkMiHsGZfrJ/VSm6Gcc?= =?utf-8?q?FmxoUo1n3TuNI1L+lMx2CO42l/A83rktUmeUNje5MWZ2sGYuY0aOndV2WJA+YpzLt?= =?utf-8?q?ohEFwlRsz1ZiUaIA+2seMQRjpKE9ze9cLzEE5H2sC5CdKusXKDayHVKNzewajt2pF?= =?utf-8?q?KQZAF/XcXU/2tRUNvO2YGjdyx/d1MkJDLMLR/I05J11J62NmLUIxs2mjgp2cL2DYp?= =?utf-8?q?mWmuoHqwd8qROlSqq7/A/u24aEtwi4fO8AlWrRGfz9y2q6YFS9IaBanCqd+v35KpU?= =?utf-8?q?H52Zy2xThNDpqTExx+WpgVAuFriUopK9pPguWfGs79UvOYagXWVmzXV0Vqe76Z29C?= =?utf-8?q?b1lDmsbv+nxjhpwDNZjRYSJ/Jd+bf9JCa2C4+I+BD/uKQJwBOaytONq+KSLR+BNYM?= =?utf-8?q?8DCTQxcSVmSdbP5r1H6RJIUZFpupsbEwwoJPqWMSkTVLewjGx91L85bkzO0pGnA2e?= =?utf-8?q?xRAC0J2dQMTl7A8CDlEgrUX4EBMmBx4piYLOewIuDuufvcchfi5bMMPXr3Whn0PKa?= =?utf-8?q?Peu7rC8njq4QkiiYUZH/7AL54D2N3SKvJLNF9u/rUUzh64gutf4L2UqhqAN6F6hf/?= =?utf-8?q?BaKje0Zvo3CkoyFxxeehmioXuhcCaYCyrK2eOEvczoCRXXH9Fgnw3bOUJ06a+HU9D?= =?utf-8?q?d0JjcsLSwGTTZfMrhkVFx7yUX2MuUKpkOpBc6WugS2/FcK0IpLRK4WvV1Ru+ykTxc?= =?utf-8?q?7HAN1TGhK8d5M7jgueYt56BMqnxjQjt0Dc7r4ztoud+a0hgfOE6S1aj1aSeGCAYuG?= =?utf-8?q?EN8plPePKyph1BrccAhBLl4gaRvUItQJktSiaXYBERU2Mv4uolFTeuNwCdjGk09su?= =?utf-8?q?f2DVIrYn5QhvMyKcHzqIZXacNPHJXtng8JgDUxhEtsikZoh9laaRrB7xmuMVd6Qes?= =?utf-8?q?vOD8j4NQJQLZ9RZ7BAmSofHfF775kbvb/h73WTRLW0esbUw4UGthxhrMmP86664sp?= =?utf-8?q?xJrAucbHKvJIhhHdPBCk8xXnbsQJ9kXpHBFlN0YPLYsaw7OyYH2FwYCY+OSmleTBx?= =?utf-8?q?HSh7gaaIjDeAwjTjVYfGOFV02DQGLPg4Hd0mxLN7TmYFHrXbsHGXp/exdukPaJNCS?= =?utf-8?q?msN3JZkd/Rm/NNc/7U1QNI5RzV9a4MuQJzEYj++T+ycd//Q48WI1talx3pTEzF/Rq?= =?utf-8?q?cLPp2SBeoA9zX23nNcYutjR/FEpwcDVTSM+jPXRA5L9/ifdk4JSqLYvlRGL6rxOC7?= =?utf-8?q?688Cb69GffJoJiVdlsWM2NP3PuiCaxm5VpH8IhbwI+kpbGfNV2t+PdvDFW1f5UIVU?= =?utf-8?q?xfPLL6X0l0xvPVLAMmIUMueyrT4ZV4EWSeapClFsNXWgYImge4IaYIMnx86bOaLKB?= =?utf-8?q?BaXsueDsZOM2?= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.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: 18 Oct 2024 23:20:35.2109 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: d353debd-49e3-4309-454c-08dcefcb782a 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: AM4PEPF00025F99.EURPRD83.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: VI1PR0701MB6768 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); From patchwork Fri Oct 18 23:20:17 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: 13842507 X-Patchwork-Delegate: kuba@kernel.org Received: from EUR05-DB8-obe.outbound.protection.outlook.com (mail-db8eur05on2073.outbound.protection.outlook.com [40.107.20.73]) (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 B3901192B81 for ; Fri, 18 Oct 2024 23:20:39 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=fail smtp.client-ip=40.107.20.73 ARC-Seal: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293641; cv=fail; b=ihZMQEQPlZZYnKS3wkIpx3WKL0zQSE72lQIKDhEDTQu9m4cJI6aiRHUz+u10fTwZS0tJjVhFzY3UCsxocC5HSXX4bPq3XnSwlxu0okcZLuvgY83K9CfZVFFuYscjwRyfdpSB5tygmPIGFDSnwRCT6rwLdyGJzo5+4ZmRM61RCIE= ARC-Message-Signature: i=2; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1729293641; c=relaxed/simple; bh=gRq09LiTvCqu77G3UmHFbQ+dx7jyMQRVGfRk6XwUonA=; h=From:To:Cc:Subject:Date:Message-Id:In-Reply-To:References: MIME-Version:Content-Type; b=gLtyEXXwoeeyrZfHqwVftWH/rjfsvyTvsfssq3isW42V0ItjegofOP9gUVlXUOhcEkmxcCNwyr1EhjGxD3e25UQvHiGBa9qqOH6aFeQaH+4QB8zOSY7Cyc8DRitNjGyJN3CPs+TYAS23424siJ3RQj7GyFM5b5ILD/fC0r+K7WM= 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=PxnvI+85; arc=fail smtp.client-ip=40.107.20.73 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="PxnvI+85" ARC-Seal: i=1; a=rsa-sha256; s=arcselector10001; d=microsoft.com; cv=none; b=EQrBr0DG5iCZIUVZtizDGycS5ZsjZXkZK11gFJxCCzyAWcTtLJ4NoHJcq0TXIVSSb3Mv1O/1n0zGvjOE/2NqwjzD3K1to6d8ky7CwRtZziFWE6DHrIvgn4FGD9hQDWfGEfculyF12K1tX/4dX3umCd4a4ZdC+tp6f2EDh3ztwxyjwRuZCfMtYOHHXOU4KLXOYIDvVIrQcq4CxYrVqR4aJOVvSvHGEO1u4q5J4N61XZ8JjvHO91B6iy58aP+ytIPdiZ+OZUA4qc9hYe9vsl1rzCZ+Vx6SaMi2u83/MBDa2dR9Ly3i0ItOw3R+lqMYDX/dAcQbNXMragfLbwxfpopOiw== 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=anYE30uqxh8PVEBZAC+XD5FOG2Mh8l8iyfB2oxTXqwk=; b=nYmxYZyv0NOsWOJIHePe1rkTP7xOMt2HWjdikEcJ+kAv34/IrJv55nrs+m/9wTIPI0oyKk2NVNRp/sZcbb5AR9ZBGngHB+U4L61WhBuese1uQB04ndhu22Ky5T+vDOLRa7v3artGJfpvTmsWDfjLp5nqMSLNNY986AReRYR8MlavUUuox5nMMjEspZMco3ZMxDPYB7qrFY9a0dBhuLvnHnmrElfXBga1SWFzjbuCpEVxt8cJn4rWOD4OD/aFBxDojbKHv1o/fH/agQ0C3cCFKLVfQL7XQ4zKGgyAk8oVZQyuBIdk7ew4OWwNcTO/4RcmOEI+9d0AaGnH2xS8FQkZLQ== 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=anYE30uqxh8PVEBZAC+XD5FOG2Mh8l8iyfB2oxTXqwk=; b=PxnvI+8562+16QCmG04O19wXu5T722l5gEkc2l/D4Zfz6X/yF9kG7dKJz0RorSH0QFs3tcQCzOwaFUuWD0ESlSSKD9TcRYwqcf111DgZqzlWCPmkshujguB8uqJwMIh9ox9jihyMfb8DPeF8cd3FEOx1Jk/JQMRmX6de/yk3fjomF9+mKSGt6OwCvv3v3WpC4DQ68D9Irtra7TrhaeVmu6I0we3vup2fk4a57qHG+FgDGXEcfEU0ws0ZJp6bVXNA6VNRpecRk9J/mpxKm1TZSl0dPNHedpfvqP3XmwP8WZz8/cO7zglPmXMhMP/wqGA/EWc8pK//OJsAi6BcZvshLA== Received: from AM6PR0502CA0063.eurprd05.prod.outlook.com (2603:10a6:20b:56::40) by DU2PR07MB9434.eurprd07.prod.outlook.com (2603:10a6:10:495::14) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.18; Fri, 18 Oct 2024 23:20:36 +0000 Received: from AM2PEPF0001C70F.eurprd05.prod.outlook.com (2603:10a6:20b:56:cafe::34) by AM6PR0502CA0063.outlook.office365.com (2603:10a6:20b:56::40) with Microsoft SMTP Server (version=TLS1_2, cipher=TLS_ECDHE_RSA_WITH_AES_256_GCM_SHA384) id 15.20.8069.23 via Frontend Transport; Fri, 18 Oct 2024 23:20:36 +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 AM2PEPF0001C70F.mail.protection.outlook.com (10.167.16.203) 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 23:20:36 +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 49INKJJd010239; Fri, 18 Oct 2024 23:20: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, 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 v3 net-next 14/14] net: sysctl: introduce sysctl SYSCTL_FIVE Date: Sat, 19 Oct 2024 01:20:17 +0200 Message-Id: <20241018232017.46833-15-chia-yu.chang@nokia-bell-labs.com> X-Mailer: git-send-email 2.34.1 In-Reply-To: <20241018232017.46833-1-chia-yu.chang@nokia-bell-labs.com> References: <20241018232017.46833-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: AM2PEPF0001C70F:EE_|DU2PR07MB9434:EE_ X-MS-Office365-Filtering-Correlation-Id: eb5a53f8-288a-479c-91cd-08dcefcb78b9 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: 5AC2hR6akY5lkIfUL7LxfOVDil3M5YA9i1oLi5B5+25jGQVjKvLjkbnlztRGNQ9PmiWn1uQ1TrC4o14qjmAY86fX9fagLQksG+K+QzqgtI7wzEO5Mjf9my/AgSAcLRci1Als4lb0ShWHZoDge1Uaoxg9j+f4V38sUg+PBV4VF055aajLTbqz0zIbtfo425j63ly3IQj4ILBn9ofgKG0dh8/NKairh0ND5I+3GvqWBbi0BNyOzOTzQUhiLBoREmoIDOwvTwO5TNdI9k2gLPQX61yOA6semsqnxWx975QqlUxDE4gE27I5GAKR2jNmQnNl+zOePKz0ez0F3bK6kBrfnICiWn5niRD5XUGFdwb9GVg77fwS1WPoU4KYum9B/aPDsIo8J7bT3GTg3qwSIvgwWxzxIv6uaC/Ax83+nsqJBvfFUTnp2EY7Qw8a6E/4j7moPczvd8BPf+Llz/UnT+6X94Ze9iiRZvUx3Yvflqw9G/zRHsW5vqSW97pA3qDSR5zL8h2PSKqFXCU/KuXLZbjBfeI1paN+VSwRu7l0vaDKwrK7vRbMGP1aeXKgLI5FCjItCmovwTn0e9Sc0Dw6hhenmIl6Mtb0rI7XkNzCiRzzn+ZqiIsO/0ncf0vvfT+egGj4InqltKnV9Wm5kmusTMGAUkwz7Y1MoeLcjRu/CEyk0CKw89ZbP5KyXVr2hBEOaAvMXfRIIng6cwyDV56rMTVwIuAFQENW7bCwHiPckwyRJ3ic2cJRFFWagzdXIN6ekXjKyVXz2LD3pIiw1xjUnAoyUrrZcVo02m5wLRDVOTyZIxUwg3Q8h6OYSYRZGk2ul/naXwTRLe5J38WIo9hwWOK+qvBITkNWWYLGACSFDE5CZa8qRm0pRraDN38ZCFdyyybAeY+G9xYhPG15cuv2Mf52ghVt7qQBYo+Lzui+ukNdv9fMXxr9zQXDQIjKJNJ2/D3Dfi9IBk239NKcDMKE6wO1DWpi2FpA30KK7Ta5lyrQ+a0WolcEMYc/IDAFoXatJ1blZF6nCCAb82NzRtjXsRJTfqt1OSewznxn1beHEaED28CZjutPpcKYbJVtv35EEC59aslYP6MYUIYFaFFjLPAZNjdo0FNQpJ9If/+n3qTjOD/2BLX90wilpKZIJcEUH1A3/BfGeFlQfUdOtetRdXaUvjomh0vcT2C9paV/wOldJsH6lflIyr6TrHTyCfyD5WHHTZqkM9mC08i68XyOQ470yszD2dJI04zUDAXZrilxlxdwxc72JO+V/EDDcCDGVeTUPWtxMTM9kOZP73Zs5yB3rGc9XArEOyAJE990oSFXRKwCT4ut2YXYxS8h05fFDVEZwzjBMENMM2bu27/GxlXpOn/qzuCxA1KWlTo1JSOILmslzTqChUDiV+J8zKMLnxAC2ql4fnOmBxvIsK6/0lLrvRyyL3XrPaCth7DqWHKy5zo= X-Forefront-Antispam-Report: CIP:131.228.6.100;CTRY:FI;LANG:en;SCL:1;SRV:;IPV:CAL;SFV:NSPM;H:fr711usmtp2.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: 18 Oct 2024 23:20:36.1032 (UTC) X-MS-Exchange-CrossTenant-Network-Message-Id: eb5a53f8-288a-479c-91cd-08dcefcb78b9 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: AM2PEPF0001C70F.eurprd05.prod.outlook.com X-MS-Exchange-CrossTenant-AuthAs: Anonymous X-MS-Exchange-CrossTenant-FromEntityHeader: HybridOnPrem X-MS-Exchange-Transport-CrossTenantHeadersStamped: DU2PR07MB9434 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 | 2 +- 2 files changed, 10 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..a922b44eaddd 100644 --- a/kernel/sysctl.c +++ b/kernel/sysctl.c @@ -82,7 +82,7 @@ #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 };