From: Nandita Dukkipati <nanditad@google.com>
To: "David S. Miller" <davem@davemloft.net>
Cc: netdev@vger.kernel.org, Tom Herbert <therbert@google.com>,
Laurent Chavey <chavey@google.com>,
Yuchung Cheng <ycheng@google.com>,
Nandita Dukkipati <nanditad@google.com>
Subject: [PATCH 1/1] TCP: increase default initial receive window.
Date: Fri, 17 Dec 2010 19:20:51 -0800 [thread overview]
Message-ID: <1292642451-892-1-git-send-email-nanditad@google.com> (raw)
This patch changes the default initial receive window to 10 mss
(defined constant). The default window is limited to the maximum
of 10*1460 and 2*mss (when mss > 1460).
Signed-off-by: Nandita Dukkipati <nanditad@google.com>
---
include/net/tcp.h | 3 +++
net/ipv4/tcp_output.c | 11 ++++++++---
2 files changed, 11 insertions(+), 3 deletions(-)
diff --git a/include/net/tcp.h b/include/net/tcp.h
index 2ab6c9c..6c25ba8 100644
--- a/include/net/tcp.h
+++ b/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/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c
index 2d39066..dc7c096 100644
--- a/net/ipv4/tcp_output.c
+++ b/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
*/
--
1.7.3.1
next reply other threads:[~2010-12-18 3:21 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2010-12-18 3:20 Nandita Dukkipati [this message]
2010-12-18 3:59 ` [PATCH 1/1] TCP: increase default initial receive window Stephen Hemminger
2010-12-18 5:14 ` David Miller
2010-12-18 5:13 ` David Miller
2010-12-18 9:08 ` Nandita Dukkipati
2010-12-20 17:03 ` Stephen Hemminger
2010-12-20 18:26 ` Rick Jones
2010-12-20 18:48 ` David Miller
2010-12-21 0:15 ` [PATCH v2 " Nandita Dukkipati
2010-12-21 0:23 ` Nandita Dukkipati
2010-12-21 5:00 ` Eric Dumazet
2010-12-21 5:33 ` David Miller
2010-12-21 18:27 ` [PATCH " John Heffner
2010-12-21 18:49 ` Eric Dumazet
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=1292642451-892-1-git-send-email-nanditad@google.com \
--to=nanditad@google.com \
--cc=chavey@google.com \
--cc=davem@davemloft.net \
--cc=netdev@vger.kernel.org \
--cc=therbert@google.com \
--cc=ycheng@google.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).