Skip to content

Commit 44abafc

Browse files
yuchungchengdavem330
authored andcommitted
tcp: disallow cwnd undo when switching congestion control
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 <[email protected]> Signed-off-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: Neal Cardwell <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e7519f9 commit 44abafc

File tree

1 file changed

+1
-0
lines changed

1 file changed

+1
-0
lines changed

net/ipv4/tcp_cong.c

Lines changed: 1 addition & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -180,6 +180,7 @@ void tcp_init_congestion_control(struct sock *sk)
180180
{
181181
const struct inet_connection_sock *icsk = inet_csk(sk);
182182

183+
tcp_sk(sk)->prior_ssthresh = 0;
183184
if (icsk->icsk_ca_ops->init)
184185
icsk->icsk_ca_ops->init(sk);
185186
if (tcp_ca_needs_ecn(sk))

0 commit comments

Comments
 (0)