tcp: disallow cwnd undo when switching congestion control
authorYuchung Cheng <ycheng@google.com>
Wed, 31 May 2017 18:21:27 +0000 (11:21 -0700)
committerDanny Wood <danwood76@gmail.com>
Tue, 29 Jan 2019 13:18:23 +0000 (13:18 +0000)
commit8d21f9aa18c4daff238c987b5d2e2907f6355413
tree16fd2d512484c4d7c4cf697ff4fbdb98c20d5d22
parentaa28c7fa22b5ee93e948a9267aaba9d383091575
tcp: disallow cwnd undo when switching congestion control

commit 44abafc4cc094214a99f860f778c48ecb23422fc upstream.

When the sender switches its congestion control during loss
recovery, if the recovery is spurious then it may incorrectly
revert cwnd and ssthresh to the older values set by a previous
congestion control. Consider a congestion control (like BBR)
that does not use ssthresh and keeps it infinite: the connection
may incorrectly revert cwnd to an infinite value when switching
from BBR to another congestion control.

This patch fixes it by disallowing such cwnd undo operation
upon switching congestion control.  Note that undo_marker
is not reset s.t. the packets that were incorrectly marked
lost would be corrected. We only avoid undoing the cwnd in
tcp_undo_cwnd_reduction().

Signed-off-by: Yuchung Cheng <ycheng@google.com>
Signed-off-by: Soheil Hassas Yeganeh <soheil@google.com>
Signed-off-by: Neal Cardwell <ncardwell@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Signed-off-by: Willy Tarreau <w@1wt.eu>
net/ipv4/tcp_cong.c