From f1b1d9510150c10aa14e24df27cc24e316cbb09d Mon Sep 17 00:00:00 2001 From: tuexen Date: Tue, 25 Aug 2020 09:42:03 +0000 Subject: [PATCH] RFC 3465 defines a limit L used in TCP slow start for limiting the number of acked bytes as described in Section 2.2 of that document. This patch ensures that this limit is not also applied in congestion avoidance. Applying this limit also in congestion avoidance can result in using less bandwidth than allowed. Reported by: l.tian.email@gmail.com Reviewed by: rrs, rscheff MFC after: 3 days Sponsored by: Netflix, Inc. Differential Revision: https://reviews.freebsd.org/D26120 --- sys/netinet/tcp_input.c | 3 +-- sys/netinet/tcp_stacks/rack.c | 3 +-- 2 files changed, 2 insertions(+), 4 deletions(-) diff --git a/sys/netinet/tcp_input.c b/sys/netinet/tcp_input.c index 9bf6f52855a..6d791565701 100644 --- a/sys/netinet/tcp_input.c +++ b/sys/netinet/tcp_input.c @@ -349,8 +349,7 @@ cc_ack_received(struct tcpcb *tp, struct tcphdr *th, uint16_t nsegs, } #endif /* STATS */ if (tp->snd_cwnd > tp->snd_ssthresh) { - tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, - nsegs * V_tcp_abc_l_var * tcp_maxseg(tp)); + tp->t_bytes_acked += tp->ccv->bytes_this_ack; if (tp->t_bytes_acked >= tp->snd_cwnd) { tp->t_bytes_acked -= tp->snd_cwnd; tp->ccv->flags |= CCF_ABC_SENTAWND; diff --git a/sys/netinet/tcp_stacks/rack.c b/sys/netinet/tcp_stacks/rack.c index 3b2f205ea12..5e9a568bd6b 100644 --- a/sys/netinet/tcp_stacks/rack.c +++ b/sys/netinet/tcp_stacks/rack.c @@ -3911,8 +3911,7 @@ rack_ack_received(struct tcpcb *tp, struct tcp_rack *rack, struct tcphdr *th, ui #endif } if (rack->r_ctl.cwnd_to_use > tp->snd_ssthresh) { - tp->t_bytes_acked += min(tp->ccv->bytes_this_ack, - nsegs * V_tcp_abc_l_var * ctf_fixed_maxseg(tp)); + tp->t_bytes_acked += tp->ccv->bytes_this_ack; if (tp->t_bytes_acked >= rack->r_ctl.cwnd_to_use) { tp->t_bytes_acked -= rack->r_ctl.cwnd_to_use; tp->ccv->flags |= CCF_ABC_SENTAWND; -- 2.45.0