Skip to content

Commit

Permalink
---
Browse files Browse the repository at this point in the history
yaml
---
r: 210810
b: refs/heads/master
c: 01f83d6
h: refs/heads/master
v: v3
  • Loading branch information
Alexey Kuznetsov authored and David S. Miller committed Sep 15, 2010
1 parent 5ab7302 commit 89535f3
Show file tree
Hide file tree
Showing 2 changed files with 17 additions and 3 deletions.
2 changes: 1 addition & 1 deletion [refs]
Original file line number Diff line number Diff line change
@@ -1,2 +1,2 @@
---
refs/heads/master: 6dcbc12290abb452a5e42713faa6461b248e2f55
refs/heads/master: 01f83d69844d307be2aa6fea88b0e8fe5cbdb2f4
18 changes: 16 additions & 2 deletions trunk/include/net/tcp.h
Original file line number Diff line number Diff line change
Expand Up @@ -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;
}
Expand Down

0 comments on commit 89535f3

Please sign in to comment.