diff options
-rw-r--r-- | net/ipv4/tcp_highspeed.c | 13 |
1 files changed, 9 insertions, 4 deletions
diff --git a/net/ipv4/tcp_highspeed.c b/net/ipv4/tcp_highspeed.c index aaa1538c0692..fa3e1aad660c 100644 --- a/net/ipv4/tcp_highspeed.c +++ b/net/ipv4/tcp_highspeed.c | |||
@@ -139,14 +139,19 @@ static void hstcp_cong_avoid(struct sock *sk, u32 adk, u32 rtt, | |||
139 | tp->snd_cwnd++; | 139 | tp->snd_cwnd++; |
140 | } | 140 | } |
141 | } else { | 141 | } else { |
142 | /* Update AIMD parameters */ | 142 | /* Update AIMD parameters. |
143 | * | ||
144 | * We want to guarantee that: | ||
145 | * hstcp_aimd_vals[ca->ai-1].cwnd < | ||
146 | * snd_cwnd <= | ||
147 | * hstcp_aimd_vals[ca->ai].cwnd | ||
148 | */ | ||
143 | if (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd) { | 149 | if (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd) { |
144 | while (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd && | 150 | while (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd && |
145 | ca->ai < HSTCP_AIMD_MAX - 1) | 151 | ca->ai < HSTCP_AIMD_MAX - 1) |
146 | ca->ai++; | 152 | ca->ai++; |
147 | } else if (tp->snd_cwnd < hstcp_aimd_vals[ca->ai].cwnd) { | 153 | } else if (ca->ai && tp->snd_cwnd <= hstcp_aimd_vals[ca->ai-1].cwnd) { |
148 | while (tp->snd_cwnd > hstcp_aimd_vals[ca->ai].cwnd && | 154 | while (ca->ai && tp->snd_cwnd <= hstcp_aimd_vals[ca->ai-1].cwnd) |
149 | ca->ai > 0) | ||
150 | ca->ai--; | 155 | ca->ai--; |
151 | } | 156 | } |
152 | 157 | ||