diff options
author | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-18 11:25:14 -0400 |
---|---|---|
committer | Linus Torvalds <torvalds@woody.linux-foundation.org> | 2007-05-18 11:25:14 -0400 |
commit | bfea13d4a127aab4c10085b6f9b6e2ff4f023f79 (patch) | |
tree | 4195848eb43a12409511cea39903c3e4c6249281 /net/ipv4/tcp_cong.c | |
parent | 32f9306b161a5e0c892132f7227f36de94090289 (diff) | |
parent | f6c5d736af6bc71cebc017e4001ec5efff1ee116 (diff) |
Merge master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
* master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6:
[IPV4]: Remove IPVS icmp hack from route.c for now.
[IPV4]: Correct rp_filter help text.
[TCP]: TCP_CONG_YEAH requires TCP_CONG_VEGAS
[TCP] slow start: Make comments and code logic clearer.
[BLUETOOTH]: Fix locking in hci_sock_dev_event().
[NET]: Fix BMSR_100{HALF,FULL}2 defines in linux/mii.h
[NET]: lockdep classes in register_netdevice
Diffstat (limited to 'net/ipv4/tcp_cong.c')
-rw-r--r-- | net/ipv4/tcp_cong.c | 40 |
1 files changed, 22 insertions, 18 deletions
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c index 86b26539e54b..1260e52ad772 100644 --- a/net/ipv4/tcp_cong.c +++ b/net/ipv4/tcp_cong.c | |||
@@ -276,30 +276,34 @@ int tcp_set_congestion_control(struct sock *sk, const char *name) | |||
276 | 276 | ||
277 | 277 | ||
278 | /* | 278 | /* |
279 | * Slow start (exponential increase) with | 279 | * Slow start is used when congestion window is less than slow start |
280 | * RFC3742 Limited Slow Start (fast linear increase) support. | 280 | * threshold. This version implements the basic RFC2581 version |
281 | * and optionally supports: | ||
282 | * RFC3742 Limited Slow Start - growth limited to max_ssthresh | ||
283 | * RFC3465 Appropriate Byte Counting - growth limited by bytes acknowledged | ||
281 | */ | 284 | */ |
282 | void tcp_slow_start(struct tcp_sock *tp) | 285 | void tcp_slow_start(struct tcp_sock *tp) |
283 | { | 286 | { |
284 | int cnt = 0; | 287 | int cnt; /* increase in packets */ |
285 | 288 | ||
286 | if (sysctl_tcp_abc) { | 289 | /* RFC3465: ABC Slow start |
287 | /* RFC3465: Slow Start | 290 | * Increase only after a full MSS of bytes is acked |
288 | * TCP sender SHOULD increase cwnd by the number of | 291 | * |
289 | * previously unacknowledged bytes ACKed by each incoming | 292 | * TCP sender SHOULD increase cwnd by the number of |
290 | * acknowledgment, provided the increase is not more than L | 293 | * previously unacknowledged bytes ACKed by each incoming |
291 | */ | 294 | * acknowledgment, provided the increase is not more than L |
292 | if (tp->bytes_acked < tp->mss_cache) | 295 | */ |
293 | return; | 296 | if (sysctl_tcp_abc && tp->bytes_acked < tp->mss_cache) |
294 | } | 297 | return; |
295 | 298 | ||
296 | if (sysctl_tcp_max_ssthresh > 0 && | 299 | if (sysctl_tcp_max_ssthresh > 0 && tp->snd_cwnd > sysctl_tcp_max_ssthresh) |
297 | tp->snd_cwnd > sysctl_tcp_max_ssthresh) | 300 | cnt = sysctl_tcp_max_ssthresh >> 1; /* limited slow start */ |
298 | cnt += sysctl_tcp_max_ssthresh>>1; | ||
299 | else | 301 | else |
300 | cnt += tp->snd_cwnd; | 302 | cnt = tp->snd_cwnd; /* exponential increase */ |
301 | 303 | ||
302 | /* RFC3465: We MAY increase by 2 if discovered delayed ack */ | 304 | /* RFC3465: ABC |
305 | * We MAY increase by 2 if discovered delayed ack | ||
306 | */ | ||
303 | if (sysctl_tcp_abc > 1 && tp->bytes_acked >= 2*tp->mss_cache) | 307 | if (sysctl_tcp_abc > 1 && tp->bytes_acked >= 2*tp->mss_cache) |
304 | cnt <<= 1; | 308 | cnt <<= 1; |
305 | tp->bytes_acked = 0; | 309 | tp->bytes_acked = 0; |