Files
linux/net/ipv4
Eric Dumazet 21b29e74ff tcp: take care of zero tp->window_clamp in tcp_set_rcvlowat()
Some applications (like selftests/net/tcp_mmap.c) call SO_RCVLOWAT
on their listener, before accept().

This has an unfortunate effect on wscale selection in
tcp_select_initial_window() during 3WHS.

For instance, tcp_mmap was negotiating wscale 4, regardless
of tcp_rmem[2] and sysctl_rmem_max.

Do not change tp->window_clamp if it is zero
or bigger than our computed value.

Zero value is special, it allows tcp_select_initial_window()
to enable autotuning.

Note that SO_RCVLOWAT use on listener is probably not wise,
because tp->scaling_ratio has a default value, possibly wrong.

Fixes: d1361840f8 ("tcp: fix SO_RCVLOWAT and RCVBUF autotuning")
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Kuniyuki Iwashima <kuniyu@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Link: https://patch.msgid.link/20251003184119.2526655-1-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2025-10-06 13:08:48 -07:00
..
2025-03-17 13:56:38 +00:00
2025-08-29 19:36:32 -07:00
2025-08-26 17:34:31 -07:00
2025-07-08 13:28:27 +02:00
2025-08-29 19:36:32 -07:00
2025-04-11 18:58:10 -07:00
2024-01-04 10:23:10 -08:00
2025-09-01 13:15:14 -07:00
2025-09-18 08:47:51 +02:00
2025-03-17 13:54:11 +00:00
2025-03-17 13:56:38 +00:00
2025-09-19 17:00:23 -07:00