]> www.infradead.org Git - users/dwmw2/linux.git/commit
tcp: always set retrans_stamp on recovery
authorYuchung Cheng <ycheng@google.com>
Wed, 16 Jan 2019 23:05:30 +0000 (15:05 -0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Wed, 6 Oct 2021 13:31:19 +0000 (15:31 +0200)
commit9de7f0d60b996469a89a10e7bbf56e91d8ffad73
tree11b384c4ba5b6a11b09169cfcea136e417624eaf
parenteb6eeb056c992d20a4d3b4fb7dd05471ba32fea3
tcp: always set retrans_stamp on recovery

commit 7ae189759cc48cf8b54beebff566e9fd2d4e7d7c upstream.

Previously TCP socket's retrans_stamp is not set if the
retransmission has failed to send. As a result if a socket is
experiencing local issues to retransmit packets, determining when
to abort a socket is complicated w/o knowning the starting time of
the recovery since retrans_stamp may remain zero.

This complication causes sub-optimal behavior that TCP may use the
latest, instead of the first, retransmission time to compute the
elapsed time of a stalling connection due to local issues. Then TCP
may disrecard TCP retries settings and keep retrying until it finally
succeed: not a good idea when the local host is already strained.

The simple fix is to always timestamp the start of a recovery.
It's worth noting that retrans_stamp is also used to compare echo
timestamp values to detect spurious recovery. This patch does
not break that because retrans_stamp is still later than when the
original packet was sent.

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Neal Cardwell <ncardwell@google.com>
Reviewed-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Qiumiao Zhang <zhangqiumiao1@huawei.com>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
net/ipv4/tcp_output.c
net/ipv4/tcp_timer.c