From: Zhiqi Zhang <zhiqizhangg@gmail.com>
To: Eric Dumazet <edumazet@kernel.org>,
Neal Cardwell <ncardwell@google.com>,
"David S . Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>
Cc: Kuniyuki Iwashima <kuniyu@google.com>,
Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>,
Tim Fuechsel <t.fuechsel@gmx.de>,
Lukas Prause <lukas.prause@ikt.uni-hannover.de>,
netdev@vger.kernel.org, linux-kselftest@vger.kernel.org,
linux-kernel@vger.kernel.org
Subject: [PATCH net v2 1/2] tcp: roccet: do not restart from idle on RTO retransmission
Date: Wed, 18 Nov 2026 10:28:12 +0800 [thread overview]
Message-ID: <20261118022813.9778-2-zhiqizhangg@gmail.com> (raw)
In-Reply-To: <20261118022813.9778-1-zhiqizhangg@gmail.com>
roccet sets .cong_control, so tcp_slow_start_after_idle_check() returns
early and roccet implements the idle restart in cwnd_event_tx_start().
An RTO retransmission also raises CA_EVENT_TX_START: tcp_enter_loss()
marks the outstanding packets lost, which drains the in-flight count
while tp->packets_out stays non-zero. If delta >= icsk_rto,
roccet_cwnd_event_tx_start() then takes the idle restart and overwrites
tp->snd_ssthresh with tcp_snd_cwnd() == TCP_INIT_CWND.
When a TLP probe was sent, the RTO timer is rearmed for a full icsk_rto
at that point and the probe is the last transmit, so the first RTO is
affected. Without TLP, the first RTO can escape: the timer is armed
when the first packet of the flight is sent, and pacing spreads the
following ones, so now - tp->lsndtime < icsk_rto. The second RTO is
always affected, since it fires one backed-off icsk_rto after the first
RTO retransmit.
roccet_state(TCP_CA_Loss) calls roccet_reset(), which clears the private
state; ca->state is already LAUNCH and last_max_cwnd is already 0 when
roccet_cwnd_event_tx_start() runs, with or without this fix. The only
field the idle restart breaks is tp->snd_ssthresh: it overwrites the
value preserved by roccet_state() with TCP_INIT_CWND.
Skip the idle restart while packets are outstanding. The packetdrill
test in the next patch fails at the first RTO without this fix
(snd_ssthresh == 10) and passes with it.
Fixes: 819d59638796 ("tcp: Add TCP ROCCET congestion control module.")
Link: https://lore.kernel.org/all/179179785248.434549.16829837649351382748@kernel.org/
Signed-off-by: Zhiqi Zhang <zhiqizhangg@gmail.com>
---
net/ipv4/tcp_roccet.c | 8 ++++++--
1 file changed, 6 insertions(+), 2 deletions(-)
diff --git a/net/ipv4/tcp_roccet.c b/net/ipv4/tcp_roccet.c
index 04b9e52466..1769e4bbe3 100644
--- a/net/ipv4/tcp_roccet.c
+++ b/net/ipv4/tcp_roccet.c
@@ -1144,8 +1144,12 @@ static void roccet_cwnd_event_tx_start(struct sock *sk)
ca->epoch_start = now;
}
- /* After idle periods, go into LAUNCH with slow start */
- if (READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_slow_start_after_idle) &&
+ /* After idle periods, go into LAUNCH with slow start.
+ * We are not idle if packets are outstanding (e.g. RTO retransmit),
+ * see tcp_slow_start_after_idle_check().
+ */
+ if (!tp->packets_out &&
+ READ_ONCE(sock_net(sk)->ipv4.sysctl_tcp_slow_start_after_idle) &&
delta >= inet_csk(sk)->icsk_rto) {
tp->snd_ssthresh = tcp_snd_cwnd(tp);
tcp_snd_cwnd_set(tp, min(TCP_INIT_CWND, tp->snd_cwnd_clamp));
--
2.54.0 (Apple Git-157)
next prev parent reply other threads:[~2026-11-18 2:28 UTC|newest]
Thread overview: 6+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-11-18 2:28 [PATCH net v2 0/2] tcp: roccet: fix idle restart on RTO Zhiqi Zhang
2026-11-18 2:28 ` Zhiqi Zhang [this message]
2026-11-18 10:07 ` [PATCH net v2 1/2] tcp: roccet: do not restart from idle on RTO retransmission Eric Dumazet
2026-11-18 2:28 ` [PATCH net v2 2/2] selftests: net: packetdrill: add ROCCET RTO test Zhiqi Zhang
2026-11-18 10:05 ` Eric Dumazet
2026-11-21 22:40 ` [PATCH net v2 0/2] tcp: roccet: fix idle restart on RTO patchwork-bot+netdevbpf
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=20261118022813.9778-2-zhiqizhangg@gmail.com \
--to=zhiqizhangg@gmail.com \
--cc=davem@davemloft.net \
--cc=edumazet@kernel.org \
--cc=horms@kernel.org \
--cc=kuba@kernel.org \
--cc=kuniyu@google.com \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-kselftest@vger.kernel.org \
--cc=lukas.prause@ikt.uni-hannover.de \
--cc=ncardwell@google.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=shuah@kernel.org \
--cc=t.fuechsel@gmx.de \
/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
all inboxes | Powered by JetHome®