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
Subject: Re: [PATCH v1 net-next 04/10] tcp: Call tcp_plb_update_state_upon_rto() after rehash in tcp_write_timeout().
Date: Sat, 05 Dec 2026 09:17:53 +0000 [thread overview]
Message-ID: <179646227380.3146.960047539338687598@kernel.org> (raw)
In-Reply-To: <20261204085551.1518105-5-kuniyu@google.com>
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 <kuniyu@google.com>
[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
next prev parent reply other threads:[~2026-12-05 9:17 UTC|newest]
Thread overview: 20+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-12-04 8:54 [PATCH v1 net-next 00/10] tcp: Introduce Generic PLB Kuniyuki Iwashima
2026-12-04 8:54 ` [PATCH v1 net-next 01/10] tcp: Return early when tcp_plb_check_rehash() does not rehash a flow Kuniyuki Iwashima
2026-12-04 8:54 ` [PATCH v1 net-next 02/10] tcp: Don't call get_random_u32_below(0) in tcp_plb_update_state_upon_rto() Kuniyuki Iwashima
2026-12-04 8:54 ` [PATCH v1 net-next 03/10] tcp: Move struct tcp_plb_state to struct tcp_sock Kuniyuki Iwashima
2026-12-04 10:34 ` David Laight
2026-12-04 12:33 ` Kuniyuki Iwashima
2026-12-05 9:17 ` netdev-bot+sashiko
2026-12-04 8:54 ` [PATCH v1 net-next 04/10] tcp: Call tcp_plb_update_state_upon_rto() after rehash in tcp_write_timeout() Kuniyuki Iwashima
2026-12-05 9:17 ` netdev-bot+sashiko [this message]
2026-12-04 8:54 ` [PATCH v1 net-next 05/10] tcp: Rename tcp_plb_check_rehash() to tcp_plb_check_rehash_ecn() Kuniyuki Iwashima
2026-12-04 8:54 ` [PATCH v1 net-next 06/10] tcp: Factorise tcp_plb_rehash() Kuniyuki Iwashima
2026-12-04 8:54 ` [PATCH v1 net-next 07/10] tcp: Lower tcp_plb_suspend_rto_sec default Kuniyuki Iwashima
2026-12-04 8:54 ` [PATCH v1 net-next 08/10] tcp: Introduce Generic PLB Kuniyuki Iwashima
2026-12-05 9:17 ` netdev-bot+sashiko
2026-12-04 8:54 ` [PATCH v1 net-next 09/10] selftest: packetdrill: Add tests for " Kuniyuki Iwashima
2026-12-05 9:17 ` netdev-bot+sashiko
2026-12-04 8:54 ` [PATCH v1 net-next 10/10] selftest: net: Disable Generic PLB in ecmp_rehash.sh Kuniyuki Iwashima
2026-12-05 9:17 ` netdev-bot+sashiko
2026-12-04 9:03 ` [PATCH v1 net-next 00/10] tcp: Introduce Generic PLB netdev-bot+sinfo
2026-12-04 9:29 ` Kuniyuki Iwashima
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=179646227380.3146.960047539338687598@kernel.org \
--to=netdev-bot+sashiko@kernel.org \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuni1840@gmail.com \
--cc=kuniyu@google.com \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=willemb@google.com \
--cc=ycheng@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox