aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.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_input.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_input.c')
-rw-r--r--net/ipv4/tcp_input.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index e43065654930..4cb5e6f408dc 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -89,6 +89,7 @@ int sysctl_tcp_frto;
89int sysctl_tcp_nometrics_save; 89int sysctl_tcp_nometrics_save;
90 90
91int sysctl_tcp_moderate_rcvbuf = 1; 91int sysctl_tcp_moderate_rcvbuf = 1;
92int sysctl_tcp_abc = 1;
92 93
93#define FLAG_DATA 0x01 /* Incoming frame contained data. */ 94#define FLAG_DATA 0x01 /* Incoming frame contained data. */
94#define FLAG_WIN_UPDATE 0x02 /* Incoming ACK was a window update. */ 95#define FLAG_WIN_UPDATE 0x02 /* Incoming ACK was a window update. */
@@ -1247,6 +1248,7 @@ void tcp_enter_loss(struct sock *sk, int how)
1247 tp->snd_cwnd_cnt = 0; 1248 tp->snd_cwnd_cnt = 0;
1248 tp->snd_cwnd_stamp = tcp_time_stamp; 1249 tp->snd_cwnd_stamp = tcp_time_stamp;
1249 1250
1251 tp->bytes_acked = 0;
1250 tcp_clear_retrans(tp); 1252 tcp_clear_retrans(tp);
1251 1253
1252 /* Push undo marker, if it was plain RTO and nothing 1254 /* Push undo marker, if it was plain RTO and nothing
@@ -1904,6 +1906,7 @@ tcp_fastretrans_alert(struct sock *sk, u32 prior_snd_una,
1904 TCP_ECN_queue_cwr(tp); 1906 TCP_ECN_queue_cwr(tp);
1905 } 1907 }
1906 1908
1909 tp->bytes_acked = 0;
1907 tp->snd_cwnd_cnt = 0; 1910 tp->snd_cwnd_cnt = 0;
1908 tcp_set_ca_state(sk, TCP_CA_Recovery); 1911 tcp_set_ca_state(sk, TCP_CA_Recovery);
1909 } 1912 }
@@ -2310,6 +2313,9 @@ static int tcp_ack(struct sock *sk, struct sk_buff *skb, int flag)
2310 if (before(ack, prior_snd_una)) 2313 if (before(ack, prior_snd_una))
2311 goto old_ack; 2314 goto old_ack;
2312 2315
2316 if (sysctl_tcp_abc && icsk->icsk_ca_state < TCP_CA_CWR)
2317 tp->bytes_acked += ack - prior_snd_una;
2318
2313 if (!(flag&FLAG_SLOWPATH) && after(ack, prior_snd_una)) { 2319 if (!(flag&FLAG_SLOWPATH) && after(ack, prior_snd_una)) {
2314 /* Window is constant, pure forward advance. 2320 /* Window is constant, pure forward advance.
2315 * No more checks are required. 2321 * No more checks are required.
@@ -4370,6 +4376,7 @@ discard:
4370 4376
4371EXPORT_SYMBOL(sysctl_tcp_ecn); 4377EXPORT_SYMBOL(sysctl_tcp_ecn);
4372EXPORT_SYMBOL(sysctl_tcp_reordering); 4378EXPORT_SYMBOL(sysctl_tcp_reordering);
4379EXPORT_SYMBOL(sysctl_tcp_abc);
4373EXPORT_SYMBOL(tcp_parse_options); 4380EXPORT_SYMBOL(tcp_parse_options);
4374EXPORT_SYMBOL(tcp_rcv_established); 4381EXPORT_SYMBOL(tcp_rcv_established);
4375EXPORT_SYMBOL(tcp_rcv_state_process); 4382EXPORT_SYMBOL(tcp_rcv_state_process);