diff options
author | David S. Miller <davem@davemloft.net> | 2010-09-27 10:03:03 +0200 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-27 10:03:03 +0200 |
commit | e40051d134f7ee95c8c1f7a3471e84eafc9ab326 (patch) | |
tree | 88eb44e49a75721ae926665a2c42f08badac9d07 /include/net/tcp.h | |
parent | net: r6040: store BIOS default MAC in perm_add (diff) | |
parent | ipv6: add a missing unregister_pernet_subsys call (diff) | |
download | linux-e40051d134f7ee95c8c1f7a3471e84eafc9ab326.tar.xz linux-e40051d134f7ee95c8c1f7a3471e84eafc9ab326.zip |
Merge branch 'master' of master.kernel.org:/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/qlcnic/qlcnic_init.c
net/ipv4/ip_output.c
Diffstat (limited to 'include/net/tcp.h')
-rw-r--r-- | include/net/tcp.h | 18 |
1 files changed, 16 insertions, 2 deletions
diff --git a/include/net/tcp.h b/include/net/tcp.h index bfc1da43295c..914a60c7ad62 100644 --- a/include/net/tcp.h +++ b/include/net/tcp.h @@ -475,8 +475,22 @@ extern unsigned int tcp_current_mss(struct sock *sk); /* Bound MSS / TSO packet size with the half of the window */ static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) { - if (tp->max_window && pktsize > (tp->max_window >> 1)) - return max(tp->max_window >> 1, 68U - tp->tcp_header_len); + int cutoff; + + /* When peer uses tiny windows, there is no use in packetizing + * to sub-MSS pieces for the sake of SWS or making sure there + * are enough packets in the pipe for fast recovery. + * + * On the other hand, for extremely large MSS devices, handling + * smaller than MSS windows in this way does make sense. + */ + if (tp->max_window >= 512) + cutoff = (tp->max_window >> 1); + else + cutoff = tp->max_window; + + if (cutoff && pktsize > cutoff) + return max_t(int, cutoff, 68U - tp->tcp_header_len); else return pktsize; } |