Files
kernel-sophgo-sg2044-revyos…/net/ipv4
Eric Dumazet 6e3a266098 tcp: fix tcp_tso_should_defer() vs large RTT
[ Upstream commit 295ce1eb36ae47dc862d6c8a1012618a25516208 ]

Neal reported that using neper tcp_stream with TCP_TX_DELAY
set to 50ms would often lead to flows stuck in a small cwnd mode,
regardless of the congestion control.

While tcp_stream sets TCP_TX_DELAY too late after the connect(),
it highlighted two kernel bugs.

The following heuristic in tcp_tso_should_defer() seems wrong
for large RTT:

delta = tp->tcp_clock_cache - head->tstamp;
/* If next ACK is likely to come too late (half srtt), do not defer */
if ((s64)(delta - (u64)NSEC_PER_USEC * (tp->srtt_us >> 4)) < 0)
      goto send_now;

If next ACK is expected to come in more than 1 ms, we should
not defer because we prefer a smooth ACK clocking.

While blamed commit was a step in the good direction, it was not
generic enough.

Another patch fixing TCP_TX_DELAY for established flows
will be proposed when net-next reopens.

Fixes: 50c8339e92 ("tcp: tso: restore IW10 after TSO autosizing")
Reported-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Tested-by: Neal Cardwell <ncardwell@google.com>
Link: https://patch.msgid.link/20251011115742.1245771-1-edumazet@google.com
[pabeni@redhat.com: fixed whitespace issue]
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
2025-10-23 16:24:30 +02:00
..
2025-04-11 18:58:10 -07:00
2025-03-17 13:56:38 +00:00
2024-09-09 17:21:47 -07:00
2025-10-15 12:03:49 +02:00
2025-06-23 17:04:03 -07:00
2025-06-23 17:04:03 -07:00
2025-10-15 12:03:49 +02:00
2025-07-08 13:28:27 +02:00
2025-10-15 12:03:49 +02:00
2025-04-11 18:58:10 -07:00
2024-01-04 10:23:10 -08:00
2025-07-14 18:41:42 -07:00
2025-06-23 17:04:03 -07:00
2025-10-15 12:03:49 +02:00
2025-03-17 13:54:11 +00:00
2025-03-17 13:56:38 +00:00
2025-06-27 15:34:19 -07:00
2025-06-27 15:34:19 -07:00