From mboxrd@z Thu Jan 1 00:00:00 1970 Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.remote-ip=100.103.45.18 ARC-Seal: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; cv=none; t=1796462275; b=G63Ge797dFIlqt+1OdaRw2L3SzFfJkF8kO6J/AX9qNblJCBVb9kq4R0GmlvHTXeEBm8k NAKpAa+JlCBU2lVmpjkMN+M9Kz9uJVwi/hUI5wc+URgNepUZdttebHNtnlB9HErznf8zk Wa7CqdnKGtF9L8xRrsZn1wm7sGyeBooGETtMrw3501FeuqW2nYyHQupgKzFai7xaroQAs qXVipNCd606wGSyi8I7vAtA6iw8ewECLEIs2XGFXsZkF8qbicC5h93lDH9kx6mJiklQfK 5G4VWVOicQhD91FlwnHGX3bcrPqjTwYr7lstd76obK9ogI54bIc0OKRKzz1WVo4wXuw== ARC-Message-Signature: i=1; d=subspace.kernel.org; s=arc20261015; a=rsa-sha256; c=relaxed/relaxed; t=1796462275; h=Received:DKIM-Signature:Subject:From:To:Cc:Date:Message-ID: In-Reply-To:References:X-sashiko-severity:Content-Type: Content-Transfer-Encoding:MIME-Version; bh=kNXCWsexSElFk2MetcF6YvXfXwfYpNIsW0ENfqHy9SA=; b=ITcEiqESUr+BA/6NFRWLFBw/bTbcebbf0bueDyL9CILD8wRUopVFobsbOXjIUbPT8pUk gdUEq8jTCK3KqbydTNmVYfiaLS9mxPuqSF8NnwSrVxuVnG0ckhBJG22bWhLlo8LGIuydt jJ0twP7uvEQW5vgF6t/iuCyKN16MwdlP/lTiILCRojumoybhJKnr85hAgPnJyTlalRjgN A6n1BAdLgYB3TZ4Lw4Lj7nI6RX0lVd6vZ/G97RreItdSue1Uhg/zZW7GMwYxnQ+nXTzSl IuntQ/uc5YoAcOe+lJ9fM6KilT4WBJdVfI9jB+nuyuvoxJ+ZW7//RLn7HqaJPa6pahA== ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PUQF5gXu; arc=none smtp.remote-ip=100.103.45.18 Received: from smtp.kernel.org (quasi.space.kernel.org [100.103.45.18]) (using TLSv1.3 with cipher TLS_AES_256_GCM_SHA384 (256/256 bits) key-exchange X25519 server-signature ECDSA (prime256v1)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 02680606A337 for ; Sat, 5 Dec 2026 09:17:54 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.a=rsa-sha256 header.s=k20260515 header.b=PUQF5gXu Received: by smtp.kernel.org (Postfix) with ESMTPSA id 361491F0092B; Sat, 5 Dec 2026 09:17:54 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org; s=k20260515; t=1796462274; bh=kNXCWsexSElFk2MetcF6YvXfXwfYpNIsW0ENfqHy9SA=; h=Subject:From:To:Cc:Date:In-Reply-To:References; b=PUQF5gXuQ8k7grY/x1k1+iIjbSlamv+LNpeNw4/WD1OP1jyCSjeqrWtTchME+fR2A 78/0rLbpZw6hxJXGyST61Ja6tkC5OJoyeFaSXNQjt5hTX4X5RT7MKRoO3cA9WxpVSF 1exydFiKzjyvqCL9sEgfe9PGL1PDXcTw3Q6H9cFW6kfgrkE92Djd+FBLXPSkPkbTEX YUE9Ldi4Ux8WkeaAYfSJxqOIA/xAcO4QcC/vEIea6nBi6ELaAen38e6TIguOid6zL2 5IH3r+24urjaCrgL9oeCwLsMG9lN2qyvfRv5JV3Np1/cmK6st+2jW4zWN11n+5yDee b+RRmUUzFMaZQ== Subject: Re: [PATCH v1 net-next 04/10] tcp: Call tcp_plb_update_state_upon_rto() after rehash in tcp_write_timeout(). From: netdev-bot+sashiko@kernel.org To: kuniyu@google.com Cc: edumazet@kernel.org, ncardwell@google.com, davem@davemloft.net, kuba@kernel.org, pabeni@redhat.com, willemb@google.com, horms@kernel.org, ycheng@google.com, kuni1840@gmail.com, netdev@vger.kernel.org Date: Sat, 05 Dec 2026 09:17:53 +0000 Message-ID: <179646227380.3146.960047539338687598@kernel.org> In-Reply-To: <20261204085551.1518105-5-kuniyu@google.com> References: <20261204085551.1518105-5-kuniyu@google.com> X-sashiko-severity: Low Content-Type: text/plain; charset="utf-8" Content-Transfer-Encoding: 8bit X-Mailing-List: netdev@vger.kernel.org List-Id: List-Post: List-Help: List-Subscribe: List-Unsubscribe: List-Owner: Precedence: list MIME-Version: 1.0 Thank you for your contribution! Sashiko AI review found more severe issue(s) in other patches of this series. This mail is only an FYI, in case you want to address the nit picks below when you respin. Low priority / nit picks for your consideration: - [Low] The commit fixes a real, long-standing behavioural bug but has no Fixes: tag, and the message does not say why the tag is left out. - [Low] After this patch the sysctl documentation no longer matches the code. -- tcp: Call tcp_plb_update_state_upon_rto() after rehash in tcp_write_timeout(). This patch moves tcp_plb_update_state_upon_rto() from the CA_EVENT_LOSS case of dctcp_cwnd_event() into tcp_write_timeout(). It now runs right after a successful __sk_rethink_txhash_reset_dst(), so PLB is paused and reset whenever an RTO rehashes the flow, even when tcp_enter_loss() skips CA_EVENT_LOSS. > Let's move tcp_plb_update_state_upon_rto() just after > __sk_rethink_txhash_reset_dst() in tcp_write_timeout(). > > Signed-off-by: Kuniyuki Iwashima [Severity: Low] Should this patch carry a Fixes: tag? The commit message describes a real behaviour bug. tcp_enter_loss() only raises CA_EVENT_LOSS here: if (icsk->icsk_ca_state <= TCP_CA_Disorder || !after(tp->high_seq, tp->snd_una) || (icsk->icsk_ca_state == TCP_CA_Loss && !icsk->icsk_retransmits)) { ... tcp_ca_event(sk, CA_EVENT_LOSS); Take a DCTCP socket in TCP_CA_CWR after a CE echo, with high_seq still after snd_una. It can be rehashed in tcp_write_timeout() without any PLB pause. Its plb_consec_cong_rounds is probably already high from the CE marks. The CA_EVENT_LOSS placement in dctcp_cwnd_event() looks like it came from: Fixes: c30f8e0b0480 ("tcp: add support for PLB in DCTCP") Two earlier patches in this series already carry Fixes: tags: "tcp: Return early when tcp_plb_check_rehash() does not rehash a flow." and "tcp: Don't call get_random_u32_below(0) in tcp_plb_update_state_upon_rto()." This patch only applies on top of "tcp: Move struct tcp_plb_state to struct tcp_sock." because it drops the &ca->plb argument. A stable backport would need a different form. If the tag is left out on purpose, could the commit message say so? That would help backporters. > diff --git a/net/ipv4/tcp_dctcp.c b/net/ipv4/tcp_dctcp.c > index bc3724d1da904..bbfff24ed5f0a 100644 > --- a/net/ipv4/tcp_dctcp.c > +++ b/net/ipv4/tcp_dctcp.c > @@ -198,7 +198,6 @@ __bpf_kfunc static void dctcp_cwnd_event(struct sock *sk, enum tcp_ca_event ev) > dctcp_ece_ack_update(sk, ev, &ca->prior_rcv_nxt, &ca->ce_state); > break; > case CA_EVENT_LOSS: > - tcp_plb_update_state_upon_rto(sk); > dctcp_react_to_loss(sk); > break; > default: [ ... ] > diff --git a/net/ipv4/tcp_timer.c b/net/ipv4/tcp_timer.c > index 814fadb30749b..a3210cda2515b 100644 > --- a/net/ipv4/tcp_timer.c > +++ b/net/ipv4/tcp_timer.c > @@ -297,6 +297,7 @@ static int tcp_write_timeout(struct sock *sk) > } > > if (__sk_rethink_txhash_reset_dst(sk)) { > + tcp_plb_update_state_upon_rto(sk); > WRITE_ONCE(tp->timeout_rehash, tp->timeout_rehash + 1); > __NET_INC_STATS(sock_net(sk), LINUX_MIB_TCPTIMEOUTREHASH); > } [Severity: Low] Now that this is the only caller, does the tcp_plb_suspend_rto_sec entry in Documentation/networking/ip-sysctl.rst still match the code? It says: Time, in seconds, to suspend PLB in event of an RTO. In order to avoid having PLB repath onto a connectivity "black hole", after an RTO a TCP connection suspends PLB repathing for a random duration between 1x and 2x of this parameter. After this patch the pause only happens when an RTO rehash succeeds. The zero-window branch of tcp_retransmit_timer() never reaches tcp_write_timeout(): tcp_enter_loss(sk); tcp_retransmit_skb(sk, skb, 1); __sk_dst_reset(sk); goto out_reset_timer; The TFO SYN-ACK RTO path in tcp_fastopen_synack_timer() doesn't reach it either. Before this patch, both paths paused PLB when ca_state was <= TCP_CA_Disorder, through this chain: tcp_enter_loss()->tcp_ca_event(CA_EVENT_LOSS)->dctcp_cwnd_event() The commit message says this narrowing is intended. Another patch in the series, "tcp: Lower tcp_plb_suspend_rto_sec default.", describes the sysctl as suspending PLB "after an RTO triggers a rehash". That patch edits the same paragraph but keeps the plain "after an RTO" wording. Should the sysctl text say the pause only follows an RTO rehash? The "upon RTO" comment above tcp_plb_update_state_upon_rto() in tcp_plb.c could be updated the same way. -- Sashiko AI review ยท https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20261204085551.1518105-1-kuniyu%40google.com