aboutsummaryrefslogtreecommitdiff
path: root/sys
diff options
context:
space:
mode:
authorRichard Scheffenegger <rscheff@FreeBSD.org>2021-02-19 12:52:06 +0000
committerRichard Scheffenegger <rscheff@FreeBSD.org>2021-02-19 12:55:32 +0000
commit853fd7a2e39802e46bd3d6476529796ac22412d9 (patch)
tree7de5d02aa32692bd8ad9e19e27cc05888249e4d0 /sys
parent248a47a4c2fb229ae815fa61875b3f62a2d6856c (diff)
downloadsrc-853fd7a2e39802e46bd3d6476529796ac22412d9.tar.gz
src-853fd7a2e39802e46bd3d6476529796ac22412d9.zip
Ensure cwnd doesn't shrink to zero with PRR
Under some circumstances, PRR may end up with a fully collapsed cwnd when finalizing the loss recovery. Reviewed By: #transport, kbowling Reported by: Liang Tian MFC after: 1 week Sponsored by: NetApp, Inc. Differential Revision: https://reviews.freebsd.org/D28780
Diffstat (limited to 'sys')
-rw-r--r--sys/netinet/tcp_input.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c
index dbe86e4e65c0..39039fe5b9a3 100644
--- a/sys/netinet/tcp_input.c
+++ b/sys/netinet/tcp_input.c
@@ -3990,8 +3990,8 @@ tcp_prr_partialack(struct tcpcb *tp, struct tcphdr *th)
* If there is going to be a SACK retransmission, adjust snd_cwnd
* accordingly.
*/
- tp->snd_cwnd = tp->snd_nxt - tp->snd_recover +
- tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg);
+ tp->snd_cwnd = max(maxseg, (int64_t)tp->snd_nxt - tp->snd_recover +
+ tp->sackhint.sack_bytes_rexmit + (snd_cnt * maxseg));
tp->t_flags |= TF_ACKNOW;
(void) tcp_output(tp);
}