aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
-rw-r--r--net/ipv4/tcp_vegas.c37
1 files changed, 18 insertions, 19 deletions
diff --git a/net/ipv4/tcp_vegas.c b/net/ipv4/tcp_vegas.c
index b49dedcda52d..007304e99842 100644
--- a/net/ipv4/tcp_vegas.c
+++ b/net/ipv4/tcp_vegas.c
@@ -266,26 +266,25 @@ static void tcp_vegas_cong_avoid(struct sock *sk, u32 ack,
266 */ 266 */
267 diff = (old_wnd << V_PARAM_SHIFT) - target_cwnd; 267 diff = (old_wnd << V_PARAM_SHIFT) - target_cwnd;
268 268
269 if (tp->snd_cwnd <= tp->snd_ssthresh) { 269 if (diff > gamma && tp->snd_ssthresh > 2 ) {
270 /* Slow start. */ 270 /* Going too fast. Time to slow down
271 if (diff > gamma) { 271 * and switch to congestion avoidance.
272 /* Going too fast. Time to slow down 272 */
273 * and switch to congestion avoidance. 273 tp->snd_ssthresh = 2;
274 */ 274
275 tp->snd_ssthresh = 2; 275 /* Set cwnd to match the actual rate
276 276 * exactly:
277 /* Set cwnd to match the actual rate 277 * cwnd = (actual rate) * baseRTT
278 * exactly: 278 * Then we add 1 because the integer
279 * cwnd = (actual rate) * baseRTT 279 * truncation robs us of full link
280 * Then we add 1 because the integer 280 * utilization.
281 * truncation robs us of full link 281 */
282 * utilization. 282 tp->snd_cwnd = min(tp->snd_cwnd,
283 */ 283 (target_cwnd >>
284 tp->snd_cwnd = min(tp->snd_cwnd, 284 V_PARAM_SHIFT)+1);
285 (target_cwnd >>
286 V_PARAM_SHIFT)+1);
287 285
288 } 286 } else if (tp->snd_cwnd <= tp->snd_ssthresh) {
287 /* Slow start. */
289 tcp_slow_start(tp); 288 tcp_slow_start(tp);
290 } else { 289 } else {
291 /* Congestion avoidance. */ 290 /* Congestion avoidance. */