aboutsummaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2011-02-02 20:05:11 -0500
committerDavid S. Miller <davem@davemloft.net>2011-02-02 23:48:47 -0500
commit442b9635c569fef038d5367a7acd906db4677ae1 (patch)
treec20d06ca161c70c0db61ed298eaf51102b67a38e
parent5ea74318c68fcb38f02fc2fc920abd37d9a9bc33 (diff)
tcp: Increase the initial congestion window to 10.
Signed-off-by: David S. Miller <davem@davemloft.net> Acked-by: Nandita Dukkipati <nanditad@google.com>
-rw-r--r--include/net/tcp.h12
-rw-r--r--net/dccp/ccids/ccid2.c9
-rw-r--r--net/ipv4/tcp_input.c2
3 files changed, 13 insertions, 10 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 917911165e3b..7118668ad534 100644
--- a/include/net/tcp.h
+++ b/include/net/tcp.h
@@ -196,6 +196,9 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo);
196/* TCP thin-stream limits */ 196/* TCP thin-stream limits */
197#define TCP_THIN_LINEAR_RETRIES 6 /* After 6 linear retries, do exp. backoff */ 197#define TCP_THIN_LINEAR_RETRIES 6 /* After 6 linear retries, do exp. backoff */
198 198
199/* TCP initial congestion window */
200#define TCP_INIT_CWND 10
201
199extern struct inet_timewait_death_row tcp_death_row; 202extern struct inet_timewait_death_row tcp_death_row;
200 203
201/* sysctl variables for tcp */ 204/* sysctl variables for tcp */
@@ -799,15 +802,6 @@ static inline __u32 tcp_current_ssthresh(const struct sock *sk)
799/* Use define here intentionally to get WARN_ON location shown at the caller */ 802/* Use define here intentionally to get WARN_ON location shown at the caller */
800#define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out) 803#define tcp_verify_left_out(tp) WARN_ON(tcp_left_out(tp) > tp->packets_out)
801 804
802/*
803 * Convert RFC 3390 larger initial window into an equivalent number of packets.
804 * This is based on the numbers specified in RFC 5681, 3.1.
805 */
806static inline u32 rfc3390_bytes_to_packets(const u32 smss)
807{
808 return smss <= 1095 ? 4 : (smss > 2190 ? 2 : 3);
809}
810
811extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh); 805extern void tcp_enter_cwr(struct sock *sk, const int set_ssthresh);
812extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst); 806extern __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst);
813 807
diff --git a/net/dccp/ccids/ccid2.c b/net/dccp/ccids/ccid2.c
index e96d5e810039..fadecd20d75b 100644
--- a/net/dccp/ccids/ccid2.c
+++ b/net/dccp/ccids/ccid2.c
@@ -583,6 +583,15 @@ done:
583 dccp_ackvec_parsed_cleanup(&hc->tx_av_chunks); 583 dccp_ackvec_parsed_cleanup(&hc->tx_av_chunks);
584} 584}
585 585
586/*
587 * Convert RFC 3390 larger initial window into an equivalent number of packets.
588 * This is based on the numbers specified in RFC 5681, 3.1.
589 */
590static inline u32 rfc3390_bytes_to_packets(const u32 smss)
591{
592 return smss <= 1095 ? 4 : (smss > 2190 ? 2 : 3);
593}
594
586static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk) 595static int ccid2_hc_tx_init(struct ccid *ccid, struct sock *sk)
587{ 596{
588 struct ccid2_hc_tx_sock *hc = ccid_priv(ccid); 597 struct ccid2_hc_tx_sock *hc = ccid_priv(ccid);
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index eb7f82ebf4a3..2f692cefd3b0 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -817,7 +817,7 @@ __u32 tcp_init_cwnd(struct tcp_sock *tp, struct dst_entry *dst)
817 __u32 cwnd = (dst ? dst_metric(dst, RTAX_INITCWND) : 0); 817 __u32 cwnd = (dst ? dst_metric(dst, RTAX_INITCWND) : 0);
818 818
819 if (!cwnd) 819 if (!cwnd)
820 cwnd = rfc3390_bytes_to_packets(tp->mss_cache); 820 cwnd = TCP_INIT_CWND;
821 return min_t(__u32, cwnd, tp->snd_cwnd_clamp); 821 return min_t(__u32, cwnd, tp->snd_cwnd_clamp);
822} 822}
823 823