From e7044b94bc75aead0425a6e0187966b37bac9b6b Mon Sep 17 00:00:00 2001 From: Nandita Dukkipati Date: Mon, 20 Dec 2010 14:15:56 +0000 Subject: [PATCH] --- yaml --- r: 225212 b: refs/heads/master c: 356f039822b8d802138f7121c80d2a9286976dbd h: refs/heads/master v: v3 --- [refs] | 2 +- trunk/include/net/tcp.h | 3 +++ trunk/net/ipv4/tcp_output.c | 11 ++++++++--- 3 files changed, 12 insertions(+), 4 deletions(-) diff --git a/[refs] b/[refs] index eae407c1dd9f..83633eb18614 100644 --- a/[refs] +++ b/[refs] @@ -1,2 +1,2 @@ --- -refs/heads/master: eda83e3b63e88351310c13c99178eb4634f137b2 +refs/heads/master: 356f039822b8d802138f7121c80d2a9286976dbd diff --git a/trunk/include/net/tcp.h b/trunk/include/net/tcp.h index b4480300cadf..38509f047382 100644 --- a/trunk/include/net/tcp.h +++ b/trunk/include/net/tcp.h @@ -60,6 +60,9 @@ extern void tcp_time_wait(struct sock *sk, int state, int timeo); */ #define MAX_TCP_WINDOW 32767U +/* Offer an initial receive window of 10 mss. */ +#define TCP_DEFAULT_INIT_RCVWND 10 + /* Minimal accepted MSS. It is (60+60+8) - (20+20). */ #define TCP_MIN_MSS 88U diff --git a/trunk/net/ipv4/tcp_output.c b/trunk/net/ipv4/tcp_output.c index 2d390669d406..dc7c096ddfef 100644 --- a/trunk/net/ipv4/tcp_output.c +++ b/trunk/net/ipv4/tcp_output.c @@ -228,10 +228,15 @@ void tcp_select_initial_window(int __space, __u32 mss, } } - /* Set initial window to value enough for senders, following RFC5681. */ + /* Set initial window to a value enough for senders starting with + * initial congestion window of TCP_DEFAULT_INIT_RCVWND. Place + * a limit on the initial window when mss is larger than 1460. + */ if (mss > (1 << *rcv_wscale)) { - int init_cwnd = rfc3390_bytes_to_packets(mss); - + int init_cwnd = TCP_DEFAULT_INIT_RCVWND; + if (mss > 1460) + init_cwnd = + max_t(u32, (1460 * TCP_DEFAULT_INIT_RCVWND) / mss, 2); /* when initializing use the value from init_rcv_wnd * rather than the default from above */