aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_cong.c
diff options
context:
space:
mode:
authorStephen Hemminger <shemminger@osdl.org>2005-11-10 20:09:53 -0500
committerDavid S. Miller <davem@davemloft.net>2005-11-10 20:09:53 -0500
commit9772efb970780aeed488c19d8b4afd46c3b484af (patch)
treede016aaa29c8a95e98c7abaa70c8b590160e2886 /net/ipv4/tcp_cong.c
parent7faffa1c7fb9b8e8917e3225d4e2638270c0a48b (diff)
[TCP]: Appropriate Byte Count support
This is an updated version of the RFC3465 ABC patch originally for Linux 2.6.11-rc4 by Yee-Ting Li. ABC is a way of counting bytes ack'd rather than packets when updating congestion control. The orignal ABC described in the RFC applied to a Reno style algorithm. For advanced congestion control there is little change after leaving slow start. Signed-off-by: Stephen Hemminger <shemminger@osdl.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/ipv4/tcp_cong.c')
-rw-r--r--net/ipv4/tcp_cong.c31
1 files changed, 20 insertions, 11 deletions
diff --git a/net/ipv4/tcp_cong.c b/net/ipv4/tcp_cong.c
index 6d3e883b48f6..c7cc62c8dc12 100644
--- a/net/ipv4/tcp_cong.c
+++ b/net/ipv4/tcp_cong.c
@@ -192,17 +192,26 @@ void tcp_reno_cong_avoid(struct sock *sk, u32 ack, u32 rtt, u32 in_flight,
192 /* In "safe" area, increase. */ 192 /* In "safe" area, increase. */
193 if (tp->snd_cwnd <= tp->snd_ssthresh) 193 if (tp->snd_cwnd <= tp->snd_ssthresh)
194 tcp_slow_start(tp); 194 tcp_slow_start(tp);
195 else { 195
196 /* In dangerous area, increase slowly. 196 /* In dangerous area, increase slowly. */
197 * In theory this is tp->snd_cwnd += 1 / tp->snd_cwnd 197 else if (sysctl_tcp_abc) {
198 */ 198 /* RFC3465: Apppriate Byte Count
199 if (tp->snd_cwnd_cnt >= tp->snd_cwnd) { 199 * increase once for each full cwnd acked
200 if (tp->snd_cwnd < tp->snd_cwnd_clamp) 200 */
201 tp->snd_cwnd++; 201 if (tp->bytes_acked >= tp->snd_cwnd*tp->mss_cache) {
202 tp->snd_cwnd_cnt = 0; 202 tp->bytes_acked -= tp->snd_cwnd*tp->mss_cache;
203 } else 203 if (tp->snd_cwnd < tp->snd_cwnd_clamp)
204 tp->snd_cwnd_cnt++; 204 tp->snd_cwnd++;
205 } 205 }
206 } else {
207 /* In theory this is tp->snd_cwnd += 1 / tp->snd_cwnd */
208 if (tp->snd_cwnd_cnt >= tp->snd_cwnd) {
209 if (tp->snd_cwnd < tp->snd_cwnd_clamp)
210 tp->snd_cwnd++;
211 tp->snd_cwnd_cnt = 0;
212 } else
213 tp->snd_cwnd_cnt++;
214 }
206} 215}
207EXPORT_SYMBOL_GPL(tcp_reno_cong_avoid); 216EXPORT_SYMBOL_GPL(tcp_reno_cong_avoid);
208 217