aboutsummaryrefslogtreecommitdiffstatshomepage
path: root/net/ipv4/tcp_cubic.c
diff options
context:
space:
mode:
authorYuchung Cheng <ycheng@google.com>2015-07-09 13:16:29 -0700
committerDavid S. Miller <davem@davemloft.net>2015-07-09 14:22:52 -0700
commit071d5080e33d6f24139e4213c2d9f97a2c21b602 (patch)
tree2dad35b407a5aef707769358a0cc61c43abf33fa /net/ipv4/tcp_cubic.c
parentnet: skb_defer_rx_timestamp should check for phydev before setting up classify (diff)
downloadwireguard-linux-071d5080e33d6f24139e4213c2d9f97a2c21b602.tar.xz
wireguard-linux-071d5080e33d6f24139e4213c2d9f97a2c21b602.zip
tcp: add tcp_in_slow_start helper
Add a helper to test the slow start condition in various congestion control modules and other places. This is to prepare a slight improvement in policy as to exactly when to slow start. Signed-off-by: Yuchung Cheng <ycheng@google.com> Signed-off-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: Eric Dumazet <edumazet@google.com> Signed-off-by: Nandita Dukkipati <nanditad@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_cubic.c')
-rw-r--r--net/ipv4/tcp_cubic.c4
1 files changed, 2 insertions, 2 deletions
diff --git a/net/ipv4/tcp_cubic.c b/net/ipv4/tcp_cubic.c
index 06d3d665a9fd..28011fb1f4a2 100644
--- a/net/ipv4/tcp_cubic.c
+++ b/net/ipv4/tcp_cubic.c
@@ -320,7 +320,7 @@ static void bictcp_cong_avoid(struct sock *sk, u32 ack, u32 acked)
if (!tcp_is_cwnd_limited(sk))
return;
- if (tp->snd_cwnd <= tp->snd_ssthresh) {
+ if (tcp_in_slow_start(tp)) {
if (hystart && after(ack, ca->end_seq))
bictcp_hystart_reset(sk);
acked = tcp_slow_start(tp, acked);
@@ -439,7 +439,7 @@ static void bictcp_acked(struct sock *sk, u32 cnt, s32 rtt_us)
ca->delay_min = delay;
/* hystart triggers when cwnd is larger than some threshold */
- if (hystart && tp->snd_cwnd <= tp->snd_ssthresh &&
+ if (hystart && tcp_in_slow_start(tp) &&
tp->snd_cwnd >= hystart_low_window)
hystart_update(sk, delay);
}