diff options
Diffstat (limited to 'net/ipv4/tcp_htcp.c')
| -rw-r--r-- | net/ipv4/tcp_htcp.c | 13 |
1 files changed, 6 insertions, 7 deletions
diff --git a/net/ipv4/tcp_htcp.c b/net/ipv4/tcp_htcp.c index e47b37984e95..3284cfb993e6 100644 --- a/net/ipv4/tcp_htcp.c +++ b/net/ipv4/tcp_htcp.c | |||
| @@ -207,14 +207,13 @@ static void htcp_cong_avoid(struct sock *sk, u32 ack, u32 rtt, | |||
| 207 | struct tcp_sock *tp = tcp_sk(sk); | 207 | struct tcp_sock *tp = tcp_sk(sk); |
| 208 | struct htcp *ca = inet_csk_ca(sk); | 208 | struct htcp *ca = inet_csk_ca(sk); |
| 209 | 209 | ||
| 210 | if (in_flight < tp->snd_cwnd) | 210 | if (!tcp_is_cwnd_limited(sk, in_flight)) |
| 211 | return; | 211 | return; |
| 212 | 212 | ||
| 213 | if (tp->snd_cwnd <= tp->snd_ssthresh) { | 213 | if (tp->snd_cwnd <= tp->snd_ssthresh) |
| 214 | /* In "safe" area, increase. */ | 214 | tcp_slow_start(tp); |
| 215 | if (tp->snd_cwnd < tp->snd_cwnd_clamp) | 215 | else { |
| 216 | tp->snd_cwnd++; | 216 | |
| 217 | } else { | ||
| 218 | measure_rtt(sk); | 217 | measure_rtt(sk); |
| 219 | 218 | ||
| 220 | /* keep track of number of round-trip times since last backoff event */ | 219 | /* keep track of number of round-trip times since last backoff event */ |
| @@ -224,7 +223,7 @@ static void htcp_cong_avoid(struct sock *sk, u32 ack, u32 rtt, | |||
| 224 | htcp_alpha_update(ca); | 223 | htcp_alpha_update(ca); |
| 225 | } | 224 | } |
| 226 | 225 | ||
| 227 | /* In dangerous area, increase slowly. | 226 | /* In dangerous area, increase slowly. |
| 228 | * In theory this is tp->snd_cwnd += alpha / tp->snd_cwnd | 227 | * In theory this is tp->snd_cwnd += alpha / tp->snd_cwnd |
| 229 | */ | 228 | */ |
| 230 | if ((tp->snd_cwnd_cnt++ * ca->alpha)>>7 >= tp->snd_cwnd) { | 229 | if ((tp->snd_cwnd_cnt++ * ca->alpha)>>7 >= tp->snd_cwnd) { |
