mirror of https://lore.kernel.org/lkml/
 help / color / mirror / Atom feed
From: Jeff Jo <jeffjo@openai.com>
To: netdev-bot+sashiko@kernel.org
Cc: netdev@vger.kernel.org, edumazet@google.com,
	ncardwell@google.com, kuniyu@google.com, davem@davemloft.net,
	kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	shuah@kernel.org, linux-kernel@vger.kernel.org,
	linux-kselftest@vger.kernel.org
Subject: Re: [PATCH net v2 2/2] selftests: net: check timestamp echo after an old ACK
Date: Mon, 28 Sep 2026 10:47:35 -0700	[thread overview]
Message-ID: <arqoNxaxj50Ji5QS@com-94485> (raw)
In-Reply-To: <179037643415.2160803.14897657788666510697@kernel.org>

On Fri, Sep 25, 2026 at 10:47:14PM +0000, netdev-bot+sashiko@kernel.org wrote:
> Thank you for your contribution! Sashiko AI review found 1 potential
> issue(s) to consider.
> 
> Critical: 0 · High: 0 · Medium: 1 · Low: 0
> 
> If you believe none of the issues are legitimate, please reply to each
> issue of Medium severity or higher and explain why the AI is wrong.
> If any of them are legitimate and you plan to respin, please let patchwork
> know by including "pw-bot: cr" as a separate line at the end of your reply
> (one such reply per series is enough).
> 
> - [Medium] The new selftest
>   tools/testing/selftests/net/packetdrill/tcp_old_ack_ts.pkt checks for...
> 
> --
> 
> selftests: net: check timestamp echo after an old ACK
> 
> This adds a packetdrill regression test for a gap-filling segment that
> carries an old ACK. Two peer data segments arrive out of order. The test
> then requires the ACK that closes the gap to echo the delayed segment's
> timestamp (301000) and not the stale saved value (1000).
> 
> Link: https://github.com/google/packetdrill/commit/83f72d3f9085d0e26eb4d206fe4d7cfab5b6d872
> 
> > diff --git a/tools/testing/selftests/net/packetdrill/tcp_old_ack_ts.pkt b/tools/testing/selftests/net/packetdrill/tcp_old_ack_ts.pkt
> > new file mode 100644
> > index 0000000000000..f072e5e4c4494
> > --- /dev/null
> > +++ b/tools/testing/selftests/net/packetdrill/tcp_old_ack_ts.pkt
> > @@ -0,0 +1,22 @@
> 
> [ ... ]
> 
> > +0.300 write(4, ..., 17) = 17
> > ++0 > P. 1:18(17) ack 1 <nop,nop,TS val 300 ecr 1000>
> > +0.310 < P. 18:35(17) ack 18 win 20000 <nop,nop,TS val 301001 ecr 300>
> > ++0 > . 18:18(0) ack 1 <nop,nop,TS val 310 ecr 1000,nop,nop,sack 18:35>
> > +0.320 < P. 1:18(17) ack 1 win 20000 <nop,nop,TS val 301000 ecr 100>
> > ++0 > . 18:18(0) ack 35 <nop,nop,TS val 320 ecr 301000>
>                                                   ^^^^^^^^^^^
> 
> [Severity: Medium]
> Can this test report PASS on a kernel that doesn't have the fix?
> 
> The commit message says packetdrill versions older than 83f72d3f9085 do
> not check the outgoing TSecr:
> 
>   older tools incorrectly pass on an unfixed kernel
> 
> This ecr 301000 check is the only line in the script that depends on the
> fix. The seq, ack and SACK checks give the same result with or without
> it, and so does the read() of 34 bytes below.
> 
> The runner only checks that some packetdrill is in PATH. It then reports
> PASS whenever packetdrill exits 0:
> 
> tools/testing/selftests/net/packetdrill/ksft_runner.sh:
>     if [ -z "$(which packetdrill)" ]; then
>     	ktap_skip_all "packetdrill not found in PATH"
>     	exit "$KSFT_SKIP"
>     fi
>     ...
>     	unshare -n packetdrill ${ip_args[$ip_version]} ${optargs[@]} $script > /dev/null \
>     		&& ktap_test_pass $ip_version || $failfunc $ip_version
> 
> On a kernel without the fix, tcp_ack() sends the gap filler down the
> old_ack path, since ack 1 is before snd_una 18. That kernel does not have
> this update:
> 
> net/ipv4/tcp_input.c:tcp_ack() {
>     ...
> old_ack:
> 	...
> 	if (flag & FLAG_UPDATE_TS_RECENT)
> 		tcp_replace_ts_recent(tp, TCP_SKB_CB(skb)->seq);
>     ...
> }
> 
> As a result, ts_recent stays at 1000. With an older packetdrill, such as
> a distro package, wouldn't ipv4, ipv6 and ipv4-mapped-ipv6 all still pass?
> 
> Could the script add a check that doesn't rely on packetdrill's TSecr
> handling? For example, after the gap-closing ACK, inject:
> 
>   < P. 35:36(1) ack 18 win 20000 <nop,nop,TS val 2000 ecr 320>
> 
> With the fix, ts_recent is 301000, so the PAWS check in
> tcp_validate_incoming() drops the segment. The segment carries data, so
> tcp_oow_rate_limited() does not suppress the dup-ACK, and the reply is
> ack 35.
> 
> Without the fix, ts_recent is 1000. The segment is accepted and the reply
> is ack 36. That difference would show up whichever packetdrill version is
> used.
> 
> > ++0 read(4, ..., 34) = 34
> 
> -- 
> Sashiko AI review · https://netdev-ai.bots.linux.dev/sashiko/#/patchset/20260924224456.55690-4-jeffjo%40openai.com


Yes, affected older packetdrill versions can
falsely pass this test, as noted in the commit message.

We previously tested a PAWS-based assertion, but Eric requested a
direct timestamp-echo check once packetdrill was fixed and the
runners updated [1]. Neal has since merged the packetdrill fix [2]
and requested the revised test.

With updated packetdrill, we verified that this test fails on the
unfixed kernel and passes with the kernel fix. V2 follows that
approach and documents the required packetdrill commit.

[1] https://lore.kernel.org/netdev/CANn89i+nY499TfuGMvMq3P=Pxw6vBxe+uYH1zioK=bhU--GXYw@mail.gmail.com/
[2] https://github.com/google/packetdrill/commit/83f72d3f9085d0e26eb4d206fe4d7cfab5b6d872

      reply	other threads:[~2026-09-28 17:47 UTC|newest]

Thread overview: 7+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-09-24 22:44 [PATCH net v2 0/2] tcp: correct timestamp echo for accepted old ACKs Jeff Jo
2026-09-24 22:44 ` [PATCH net v2 1/2] tcp: refresh TS.Recent " Jeff Jo
2026-09-25  0:57   ` Eric Dumazet
2026-09-24 22:44 ` [PATCH net v2 2/2] selftests: net: check timestamp echo after an old ACK Jeff Jo
2026-09-25  0:58   ` Eric Dumazet
2026-09-25 22:47   ` netdev-bot+sashiko
2026-09-28 17:47     ` Jeff Jo [this message]

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=arqoNxaxj50Ji5QS@com-94485 \
    --to=jeffjo@openai.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --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=ncardwell@google.com \
    --cc=netdev-bot+sashiko@kernel.org \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=shuah@kernel.org \
    /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®