diff options
| author | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-10-04 17:23:26 -0400 |
|---|---|---|
| committer | Russell King <rmk+kernel@arm.linux.org.uk> | 2010-10-04 17:23:30 -0400 |
| commit | a9fda02bfc91a281cd812ae15dabe6bfb9574f90 (patch) | |
| tree | d7be703f341870f15f87a59a63976f650078b4d6 /include/net/tcp.h | |
| parent | aa3090005d27f3c7fba915ccea36b97b669fa3ab (diff) | |
| parent | ec706dab290c486837d4a825870ab052bf200279 (diff) | |
Merge branch 'for_rmk' of git://git.linaro.org/kernel/linux-linaro-next into devel-stable
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 eaa9582779d0..3e4b33e36602 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 | } |
