tcp: always seek for minimal rtt in tcp_rcv_rtt_update()
authorEric Dumazet <edumazet@google.com>
Tue, 13 May 2025 19:39:15 +0000 (19:39 +0000)
committerJakub Kicinski <kuba@kernel.org>
Thu, 15 May 2025 18:30:08 +0000 (11:30 -0700)
commitb879dcb1aeeca278eacaac0b1e2425b1c7599f9f
treefa8fcabd948e5c10e286264673b04ea0155e8eab
parentcd171461b90a2d2cf230943df60d580174633718
tcp: always seek for minimal rtt in tcp_rcv_rtt_update()

tcp_rcv_rtt_update() goal is to maintain an estimation of the RTT
in tp->rcv_rtt_est.rtt_us, used by tcp_rcv_space_adjust()

When TCP TS are enabled, tcp_rcv_rtt_update() is using
EWMA to smooth the samples.

Change this to immediately latch the incoming value if it
is lower than tp->rcv_rtt_est.rtt_us, so that tcp_rcv_space_adjust()
does not overshoot tp->rcvq_space.space and sk->sk_rcvbuf.

Signed-off-by: Eric Dumazet <edumazet@google.com>
Link: https://patch.msgid.link/20250513193919.1089692-8-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/ipv4/tcp_input.c