diff options
author | Stephen Hemminger <shemminger@osdl.org> | 2005-11-10 20:09:53 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2005-11-10 20:09:53 -0500 |
commit | 9772efb970780aeed488c19d8b4afd46c3b484af (patch) | |
tree | de016aaa29c8a95e98c7abaa70c8b590160e2886 /include | |
parent | 7faffa1c7fb9b8e8917e3225d4e2638270c0a48b (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 'include')
-rw-r--r-- | include/linux/sysctl.h | 1 | ||||
-rw-r--r-- | include/linux/tcp.h | 1 | ||||
-rw-r--r-- | include/net/tcp.h | 19 |
3 files changed, 21 insertions, 0 deletions
diff --git a/include/linux/sysctl.h b/include/linux/sysctl.h index 22cf5e1ac987..ab2791b3189d 100644 --- a/include/linux/sysctl.h +++ b/include/linux/sysctl.h | |||
@@ -390,6 +390,7 @@ enum | |||
390 | NET_TCP_BIC_BETA=108, | 390 | NET_TCP_BIC_BETA=108, |
391 | NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109, | 391 | NET_IPV4_ICMP_ERRORS_USE_INBOUND_IFADDR=109, |
392 | NET_TCP_CONG_CONTROL=110, | 392 | NET_TCP_CONG_CONTROL=110, |
393 | NET_TCP_ABC=111, | ||
393 | }; | 394 | }; |
394 | 395 | ||
395 | enum { | 396 | enum { |
diff --git a/include/linux/tcp.h b/include/linux/tcp.h index ac4ca44c75ca..737b32e52956 100644 --- a/include/linux/tcp.h +++ b/include/linux/tcp.h | |||
@@ -326,6 +326,7 @@ struct tcp_sock { | |||
326 | __u32 snd_up; /* Urgent pointer */ | 326 | __u32 snd_up; /* Urgent pointer */ |
327 | 327 | ||
328 | __u32 total_retrans; /* Total retransmits for entire connection */ | 328 | __u32 total_retrans; /* Total retransmits for entire connection */ |
329 | __u32 bytes_acked; /* Appropriate Byte Counting - RFC3465 */ | ||
329 | 330 | ||
330 | unsigned int keepalive_time; /* time before keep alive takes place */ | 331 | unsigned int keepalive_time; /* time before keep alive takes place */ |
331 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ | 332 | unsigned int keepalive_intvl; /* time interval between keep alive probes */ |
diff --git a/include/net/tcp.h b/include/net/tcp.h index 54c399886275..44ba4a21cbdc 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h | |||
@@ -218,6 +218,7 @@ extern int sysctl_tcp_low_latency; | |||
218 | extern int sysctl_tcp_nometrics_save; | 218 | extern int sysctl_tcp_nometrics_save; |
219 | extern int sysctl_tcp_moderate_rcvbuf; | 219 | extern int sysctl_tcp_moderate_rcvbuf; |
220 | extern int sysctl_tcp_tso_win_divisor; | 220 | extern int sysctl_tcp_tso_win_divisor; |
221 | extern int sysctl_tcp_abc; | ||
221 | 222 | ||
222 | extern atomic_t tcp_memory_allocated; | 223 | extern atomic_t tcp_memory_allocated; |
223 | extern atomic_t tcp_sockets_allocated; | 224 | extern atomic_t tcp_sockets_allocated; |
@@ -770,6 +771,23 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk) | |||
770 | */ | 771 | */ |
771 | static inline void tcp_slow_start(struct tcp_sock *tp) | 772 | static inline void tcp_slow_start(struct tcp_sock *tp) |
772 | { | 773 | { |
774 | if (sysctl_tcp_abc) { | ||
775 | /* RFC3465: Slow Start | ||
776 | * TCP sender SHOULD increase cwnd by the number of | ||
777 | * previously unacknowledged bytes ACKed by each incoming | ||
778 | * acknowledgment, provided the increase is not more than L | ||
779 | */ | ||
780 | if (tp->bytes_acked < tp->mss_cache) | ||
781 | return; | ||
782 | |||
783 | /* We MAY increase by 2 if discovered delayed ack */ | ||
784 | if (sysctl_tcp_abc > 1 && tp->bytes_acked > 2*tp->mss_cache) { | ||
785 | if (tp->snd_cwnd < tp->snd_cwnd_clamp) | ||
786 | tp->snd_cwnd++; | ||
787 | } | ||
788 | } | ||
789 | tp->bytes_acked = 0; | ||
790 | |||
773 | if (tp->snd_cwnd < tp->snd_cwnd_clamp) | 791 | if (tp->snd_cwnd < tp->snd_cwnd_clamp) |
774 | tp->snd_cwnd++; | 792 | tp->snd_cwnd++; |
775 | } | 793 | } |
@@ -804,6 +822,7 @@ static inline void tcp_enter_cwr(struct sock *sk) | |||
804 | struct tcp_sock *tp = tcp_sk(sk); | 822 | struct tcp_sock *tp = tcp_sk(sk); |
805 | 823 | ||
806 | tp->prior_ssthresh = 0; | 824 | tp->prior_ssthresh = 0; |
825 | tp->bytes_acked = 0; | ||
807 | if (inet_csk(sk)->icsk_ca_state < TCP_CA_CWR) { | 826 | if (inet_csk(sk)->icsk_ca_state < TCP_CA_CWR) { |
808 | __tcp_enter_cwr(sk); | 827 | __tcp_enter_cwr(sk); |
809 | tcp_set_ca_state(sk, TCP_CA_CWR); | 828 | tcp_set_ca_state(sk, TCP_CA_CWR); |