diff options
author | David S. Miller <davem@davemloft.net> | 2010-09-27 04:03:03 -0400 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2010-09-27 04:03:03 -0400 |
commit | e40051d134f7ee95c8c1f7a3471e84eafc9ab326 (patch) | |
tree | 88eb44e49a75721ae926665a2c42f08badac9d07 /include/net/tcp.h | |
parent | 42099d7a3941d4aaf853caac92b3ae76149fc6e7 (diff) | |
parent | 2cc6d2bf3d6195fabcf0febc192c01f99519a8f3 (diff) |
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); | |||
475 | /* Bound MSS / TSO packet size with the half of the window */ | 475 | /* Bound MSS / TSO packet size with the half of the window */ |
476 | static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) | 476 | static inline int tcp_bound_to_half_wnd(struct tcp_sock *tp, int pktsize) |
477 | { | 477 | { |
478 | if (tp->max_window && pktsize > (tp->max_window >> 1)) | 478 | int cutoff; |
479 | return max(tp->max_window >> 1, 68U - tp->tcp_header_len); | 479 | |
480 | /* When peer uses tiny windows, there is no use in packetizing | ||
481 | * to sub-MSS pieces for the sake of SWS or making sure there | ||
482 | * are enough packets in the pipe for fast recovery. | ||
483 | * | ||
484 | * On the other hand, for extremely large MSS devices, handling | ||
485 | * smaller than MSS windows in this way does make sense. | ||
486 | */ | ||
487 | if (tp->max_window >= 512) | ||
488 | cutoff = (tp->max_window >> 1); | ||
489 | else | ||
490 | cutoff = tp->max_window; | ||
491 | |||
492 | if (cutoff && pktsize > cutoff) | ||
493 | return max_t(int, cutoff, 68U - tp->tcp_header_len); | ||
480 | else | 494 | else |
481 | return pktsize; | 495 | return pktsize; |
482 | } | 496 | } |