Article View: linux.kernel.netdev
Article #1063Re: [PATCH net v3 3/3] selftests: net: packetdrill: test RTO fallback after partial undo
From: Eric Dumazet
Date: Fri, 09 Oct 2026 05:47
Date: Fri, 09 Oct 2026 05:47
84 lines
10248 bytes
10248 bytes
Le ven. 9 oct. 2026 ร 07:01, <nramaswamy@openai.com> a รฉcrit :
>
> From: Neil Ramaswamy <nramaswamy@openai.com>
>
> Tests that a segment that is lost but also previously retransmitted is not
> added back to the RACK list during partial undo, and is instead
> retransmitted by the RTO. It utilizes the fact that a TLP doesn't increment
> retrans_out, which needs to be 0 for partial undo (but this scenario may
> also happen without the TLP).
>
> Signed-off-by: Neil Ramaswamy <nramaswamy@openai.com>
> Assisted-by: LLM
> ---
This test passes with or without patch 1/3, so it does not test the fix.
It records that a 3-segment flow with one TLP and one late ACK has to
wait for an RTO, and whoever fixes that later will have to rewrite it.
A single TLP probe is enough to get TCPCB_EVER_RETRANS on a segment, so
I am not convinced this case is rare.
Let me come back to tp->tsorted_lost_queue [1]. I was too terse there
("often") and it did not get discussed.
tcp_rack_detect_loss() walks tsorted_sent_queue from oldest to newest,
and whatever it leaves there was sent after what it just marked lost.
So if it does
list_move_tail(&skb->tcp_tsorted_anchor, &tp->tsorted_lost_queue);
instead of list_del_init(), the lost queue stays sorted by send time
across scans, for free. This also holds for skbs that were retransmitted
(TLP probe, lost retransmit), because they sit in tsorted_sent_queue at
their last transmit time. No TCPCB_EVER_RETRANS special case, no
comparator.
- Retransmit: tcp_update_skb_after_send() already moves the skb to the
tail of tsorted_sent_queue.
- SACK and cumulative ACK: list_del_init()/list_del() are unchanged.
- tcp_fragment(): buff lands next to skb in the lost queue. Today, for
an skb RACK has unlinked, list_add() builds a 2-node ring that belongs
to no list.
- Undo in fast recovery: everything in the lost queue was sent before
everything still in tsorted_sent_queue, so this is a
list_splice_init() at the head. O(1), no walk, no timestamp compare.
The "often" is the RTO case: tcp_timeout_mark_lost() leaves the skbs it
marks in tsorted_sent_queue, and they can be older than what RACK moves
to the lost queue afterwards. So undo needs a check: splice at the head
if tsorted_sent_queue is empty or the lost tail was sent before the sent
head, otherwise merge the two sorted lists (the forward walk from Neal's
patch, without the EVER_RETRANS test).
Cost is one list_head in tcp_sock and an INIT_LIST_HEAD() in
tcp_init_sock(), tcp_create_openreq_child() and tcp_write_queue_purge().
Reneged skbs are on neither list and would stay as they are today.
Neal's point about per-socket state is fair, but I think 16 bytes is a
reasonable price for not needing the RTO fallback at all.
With that, B is back in tsorted_sent_queue after the undo at .490 in
your scenario. tcp_undo_cwnd_reduction() sets tp->rack.advanced, RACK
looks at B in the same ACK (sent around .413, rack.rtt_us 40ms from C,
reo_wnd around 10ms), marks it lost again and it is retransmitted
immediately. The test then has the same shape as 2/3 (untested):
.490 < . 1:1(0) ack 1001 win 20000 <TS val 1390 ecr 210,sack 2001:3001>
+0~+.05 > P. 1001:2001(1000) ack 1 <...>
+0 %{ assert tcpi_retransmits == 0, tcpi_retransmits }%
and it fails on current kernels, which is what we want from a selftest
shipped with a fix.
If Neal and Yuchung still prefer the stateless version I can live with
it, but then the 3/3 changelog should say that the test passes without
1/3 and documents a known limitation.
[1] https://lore.kernel.org/netdev/CAL4WiipKWgA-EcFWDQd3t7nBwU7AnkLvqs6j--he-dR-SAgqiw@mail.gmail.com/
Thanks.
Technical Details
Message-ID:
<CAL4Wiip9RyA-2=p0SVwBcn-oe0864FqqF3QMTCX_7=+ErcJp6Q@mail.gmail.com>Path:
mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343455-linux-kernel-netdev=dewy.ruReferences:
<cover.1791506907.git.nramaswamy@openai.com> <976f8457bffbc513197d6ff5c052ca7c4bd6ed03.1791506907.git.nramaswamy@openai.com>Show Full Headers
Complete Article Headers
Path: mbox-mo1.pugleaf.net!archive.usenet.blueworldhosting.com!usenet.blueworldhosting.com!diablo1.usenet.blueworldhosting.com!usenet.network!.POSTED!vger.kernel.org!netdev+bounces-343455-linux-kernel-netdev=dewy.ru
From: edumazet@kernel.org (Eric Dumazet)
Newsgroups: linux.kernel.netdev
Subject: Re: [PATCH net v3 3/3] selftests: net: packetdrill: test RTO fallback
after partial undo
Date: Fri, 9 Oct 2026 07:47:26 +0200
Organization: Usenet Network
Message-ID: <CAL4Wiip9RyA-2=p0SVwBcn-oe0864FqqF3QMTCX_7=+ErcJp6Q@mail.gmail.com>
References: <cover.1791506907.git.nramaswamy@openai.com> <976f8457bffbc513197d6ff5c052ca7c4bd6ed03.1791506907.git.nramaswamy@openai.com>
MIME-Version: 1.0
Content-Type: text/plain; charset="UTF-8"
Content-Transfer-Encoding: quoted-printable
Injection-Info: usenet.network;
logging-data="1041318"; mail-complaints-to="abuse@usenet.network"
Cancel-Lock: sha1:Q4153EuIOEPH2s/Ms9fL08uc04c= sha256:/zlC9231cE+hISM17Qjb4hUJpVDgNcOzMdYJig2/Fxc=
sha1:VYRkQvChtuSQAeEcfapOQKjCl+g= sha256:FTDzv5wKpJ9bkIzg9wPbPl926QbTu/EV5v6jHmIb+fs=
List-ID: <netdev.vger.kernel.org>
X-Mailpost-Empty-Hdrs: X-Spam-Level
X-Received: from localhost (localhost [127.0.0.1])
by mail.dewy.ru (Postfix) with ESMTP id 2EDDD10F5CD; Fri, 9 Oct 2026 08:48:16 +0300 (MSK)
X-Virus-Scanned: Debian amavisd-new at usenet.network
X-Spam-Flag: NO
X-Spam-Score: -1.341
X-Spam-Status: No, score=-1.341 tagged_above=-9999 required=6.31
tests=[DCC_REPUT_70_89=0.1, DKIMWL_WL_HIGH=-0.241, DKIM_SIGNED=0.1,
DKIM_VALID=-0.1, DKIM_VALID_AU=-0.1, DKIM_VALID_EF=-0.1,
MAILING_LIST_MULTI=-1, SPF_HELO_NONE=0.001, SPF_PASS=-0.001]
autolearn=ham autolearn_force=no
X-Authentication-Results: mail.dewy.ru (amavisd-new); dkim=pass (2048-bit key)
header.d=kernel.org
X-Received: from mail.dewy.ru ([127.0.0.1])
by localhost (mail.dewy.ru [127.0.0.1]) (amavisd-new, port 10024)
with ESMTP id BRhHMIG8fSwr;
Fri, 9 Oct 2026 08:48:12 +0300 (MSK)
X-Received-SPF: Pass (mailfrom) identity=mailfrom; client-ip=172.234.253.10; helo=sea.lore.kernel.org; envelope-from=netdev+bounces-343455-linux-kernel-netdev=dewy.ru@vger.kernel.org; receiver=<UNKNOWN>
X-Authentication-Results: OpenDMARC; dmarc=pass (p=quarantine dis=none) header.from=kernel.org
X-Received: from sea.lore.kernel.org (sea.lore.kernel.org [172.234.253.10])
by mail.dewy.ru (Postfix) with ESMTPS id 4BECD10E9C2; Fri, 9 Oct 2026 08:48:09 +0300 (MSK)
X-Received: from smtp.subspace.kernel.org (conduit.subspace.kernel.org [100.90.174.1])
by sea.lore.kernel.org (Postfix) with ESMTP id 8293A40ED7; Fri, 9 Oct 2026 05:47:39 +0000 (UTC)
X-Received: from localhost.localdomain (localhost.localdomain [127.0.0.1])
by smtp.subspace.kernel.org (Postfix) with ESMTP id 3ABE23EFD02;
Fri, 9 Oct 2026 05:47:39 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org;
dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="fozDY/ZI"
X-Received: from smtp.kernel.org (aws-us-west-2-korg-mail-alma10-1.taild15c8.ts.net [100.103.45.18])
(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 12D153DCDA4
for <netdev@vger.kernel.org>; Fri, 9 Oct 2026 05:47:38 +0000 (UTC)
X-Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=100.103.45.18
X-ARC-Seal: i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116;
t=1791524859; cv=none; b=dVVq2lv6xCoq0MAvCqa8niaelLn4Ewb6QxoMCHCWLWWWiSZAMQa5ws+jM1A0e4bDYEoQBwENq4cHeBanseylK6EPe0x4It9gQJ7mH7ea9SdLptanpveRFV/fhpgDkvRtwDiX3CuEcIwJ8ofAhobz4jVCPb0+JPVjCX1063F/7hU=
X-ARC-Message-Signature: i=1; a=rsa-sha256; d=subspace.kernel.org;
s=arc-20240116; t=1791524859; c=relaxed/simple;
bh=VYy2rbGQC2RdtOpzlrJiWSegUq9hlWo2pAx9579dENE=;
h=MIME-Version:References:In-Reply-To:From:Date:Message-ID:Subject:
To:Cc:Content-Type; b=onRCpXZY2gREpy5RKV5q/iWJqn3psCRaYG4lfszQ95OLPg195vyV8FJ3XTmRz6jzj4QAO/TNqo1JK+oKEOIFYZPbHHk0qF6QOHjBrvhvwweOOWuU7cJgpUKneP1W/Nm77MQbRd8Z2Z7W4CvF6rGJqTpwaFsPV13pPeko2OFaMsA=
X-ARC-Authentication-Results: i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=fozDY/ZI; arc=none smtp.client-ip=100.103.45.18
X-Received: by smtp.kernel.org (Postfix) with ESMTPSA id E914E1F008A0
for <netdev@vger.kernel.org>; Fri, 9 Oct 2026 05:47:37 +0000 (UTC)
X-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=kernel.org;
s=k20260515; t=1791524857;
bh=IsGx97RgM8+2NU8wXdDA6EIGSG1c/gLn7f6vrBW/zic=;
h=References:In-Reply-To:From:Date:Subject:To:Cc;
b=fozDY/ZIMuTebIYilL17pqjavQHqqp1QISyHsT7DGADT+C5p98gpoADxHFefiUiST
cjKi9zrNnE6+euLt97eK3JcT8BLhTxlQkPxcCyAUH9hhuRkNloZ9yiJdDo5qDOcsC9
uXTuC4zcqxymwzgK+NEXwntzUlX0DXQDhswYW/GC+vvtrpJ8p2GnzmXctf8JErUdxl
zXozCv4zyMJMRL4SvZbSBfJ8qRxoeiCUfiTXNtzcmy5aVo4PTb8X7XCdFELwR8/7Th
ZSVctqj2m7156xAImB5nMyNMaEn6SeJLbqTkWqUE+Cz+RhJgWalBcQnWlvVNKLF47J
k0wpzsHTO0IXQ==
X-Received: by mail-oo1-f45.google.com with SMTP id 006d021491bc7-6c1983dfaffso4852051eaf.2
for <netdev@vger.kernel.org>; Thu, 08 Oct 2026 22:47:37 -0700 (PDT)
X-Gm-Message-State: AFuF++nW/Z3R+M54QK+NCSbYUw6IZNntqs0TX0OKI7gqmfYlO+841Dx5
pCUuNIjIHpxrHrFCNgjWm8UpPPDrUCrL0EhDEaG6kcjB5TOMNqH/F9bvyY0TvaFt0051YzW6egC
SU+2pgIx6ODEh5IJrDfeoATGIco8lbH8=
X-Received: by 2002:a05:6820:8118:b0:6d7:c5f2:9c14 with SMTP id
006d021491bc7-6ef08c78a38mr747471eaf.4.1791524857192; Thu, 08 Oct 2026
22:47:37 -0700 (PDT)
X-Precedence: bulk
X-Mailing-List: netdev@vger.kernel.org
X-List-Subscribe: <mailto:netdev+subscribe@vger.kernel.org>
X-List-Unsubscribe: <mailto:netdev+unsubscribe@vger.kernel.org>
X-In-Reply-To: <976f8457bffbc513197d6ff5c052ca7c4bd6ed03.1791506907.git.nramaswamy@openai.com>
X-Gmail-Original-Message-ID: <CAL4Wiip9RyA-2=p0SVwBcn-oe0864FqqF3QMTCX_7=+ErcJp6Q@mail.gmail.com>
X-Gm-Features: AclHuK91G6IRlIqoAjVWmpyrxCrXqPKYP2WF59BVsz-PHSystkYQmdWjZCNt61U
X-Cc: netdev@vger.kernel.org, Neal Cardwell <ncardwell@google.com>,
Neal Cardwell <ncardwell.sw@gmail.com>, Kuniyuki Iwashima <kuniyu@google.com>,
Yuchung Cheng <ycheng@google.com>, Jiayuan Chen <jiayuan.chen@linux.dev>,
"David S. Miller" <davem@davemloft.net>, Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Simon Horman <horms@kernel.org>, Shuah Khan <shuah@kernel.org>, linux-kernel@vger.kernel.org,
linux-kselftest@vger.kernel.org