Netdev List
 help / color / mirror / Atom feed
From: Kuniyuki Iwashima <kuniyu@google.com>
To: Chris Mason <mason@kernel.org>
Cc: edumazet@kernel.org, ncardwell@google.com, davem@davemloft.net,
	 kuba@kernel.org, pabeni@redhat.com, horms@kernel.org,
	willemb@google.com,  josef@bacik.io, netdev@vger.kernel.org
Subject: Re: [PATCH net] tcp: clamp the u64 delta in tcp_rcv_rtt_measure()
Date: Sat, 5 Dec 2026 11:42:37 +0900	[thread overview]
Message-ID: <axN6EQ6EZCHDRPo-@google.com> (raw)
In-Reply-To: <20261203202930.14580-1-mason@kernel.org>

On Thu, 03 Dec 2026 15:45:36 -0500, Chris Mason wrote:
> TCP autotuning can leave the receive buffer too small if the sender
> takes more than 71 minutes to fill a receive window.
> 
> tcp_rcv_rtt_measure() uses that time as an RTT sample, but truncates it
> to u32 before tcp_rcv_rtt_update() clamps it:
> 
>     tcp_mstamp - rcv_rtt_est.time = 4295000000 us
>     (u32)4295000000               = 32704 us
>     min(32704, TCP_RTT_MAX_US)    = 32704 us
> 
> Without TCP timestamps, autotuning keeps the smallest sample as its RTT
> estimate for the rest of the connection.
> 
> The fix used here is to clamp the sample while it is still a u64.
> 
> Found by LLM code inspection, and confirmed with LLM generated
> reproducers on an unmodified kernel. Fixed by LLM, and tested with
> the reproducers and existing kernel selftests.
> 
> Fixes: 645f4c6f2ebd ("tcp: switch rcv_rtt_est and rcvq_space to high resolution timestamps")
> Signed-off-by: Chris Mason <mason@kernel.org>

Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>

      parent reply	other threads:[~2026-12-05  2:42 UTC|newest]

Thread overview: 3+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-12-03 20:45 [PATCH net] tcp: clamp the u64 delta in tcp_rcv_rtt_measure() Chris Mason
2026-12-04  6:16 ` Jiayuan Chen
2026-12-05  2:42 ` Kuniyuki Iwashima [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=axN6EQ6EZCHDRPo-@google.com \
    --to=kuniyu@google.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@kernel.org \
    --cc=horms@kernel.org \
    --cc=josef@bacik.io \
    --cc=kuba@kernel.org \
    --cc=mason@kernel.org \
    --cc=ncardwell@google.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=willemb@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