diff options
| author | David S. Miller <davem@davemloft.net> | 2008-03-18 03:37:55 -0400 |
|---|---|---|
| committer | David S. Miller <davem@davemloft.net> | 2008-03-18 03:37:55 -0400 |
| commit | 577f99c1d08cf9cbdafd4e858dd13ff04d855090 (patch) | |
| tree | 0f726bbda9b18d311d4c95198bbd96cb7ac01db0 /net/ipv4/tcp_output.c | |
| parent | 26c0f03f6b77c513cb7bc37b73a06819bdbb791b (diff) | |
| parent | 2f633928cbba8a5858bb39b11e7219a41b0fbef5 (diff) | |
Merge branch 'master' of git://git.kernel.org/pub/scm/linux/kernel/git/davem/net-2.6
Conflicts:
drivers/net/wireless/rt2x00/rt2x00dev.c
net/8021q/vlan_dev.c
Diffstat (limited to 'net/ipv4/tcp_output.c')
| -rw-r--r-- | net/ipv4/tcp_output.c | 12 |
1 files changed, 10 insertions, 2 deletions
diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index cbfef8b1f5e8..67f84f5035c4 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c | |||
| @@ -1035,6 +1035,13 @@ static void tcp_cwnd_validate(struct sock *sk) | |||
| 1035 | * introducing MSS oddities to segment boundaries. In rare cases where | 1035 | * introducing MSS oddities to segment boundaries. In rare cases where |
| 1036 | * mss_now != mss_cache, we will request caller to create a small skb | 1036 | * mss_now != mss_cache, we will request caller to create a small skb |
| 1037 | * per input skb which could be mostly avoided here (if desired). | 1037 | * per input skb which could be mostly avoided here (if desired). |
| 1038 | * | ||
| 1039 | * We explicitly want to create a request for splitting write queue tail | ||
| 1040 | * to a small skb for Nagle purposes while avoiding unnecessary modulos, | ||
| 1041 | * thus all the complexity (cwnd_len is always MSS multiple which we | ||
| 1042 | * return whenever allowed by the other factors). Basically we need the | ||
| 1043 | * modulo only when the receiver window alone is the limiting factor or | ||
| 1044 | * when we would be allowed to send the split-due-to-Nagle skb fully. | ||
| 1038 | */ | 1045 | */ |
| 1039 | static unsigned int tcp_mss_split_point(struct sock *sk, struct sk_buff *skb, | 1046 | static unsigned int tcp_mss_split_point(struct sock *sk, struct sk_buff *skb, |
| 1040 | unsigned int mss_now, unsigned int cwnd) | 1047 | unsigned int mss_now, unsigned int cwnd) |
| @@ -1048,10 +1055,11 @@ static unsigned int tcp_mss_split_point(struct sock *sk, struct sk_buff *skb, | |||
| 1048 | if (likely(cwnd_len <= window && skb != tcp_write_queue_tail(sk))) | 1055 | if (likely(cwnd_len <= window && skb != tcp_write_queue_tail(sk))) |
| 1049 | return cwnd_len; | 1056 | return cwnd_len; |
| 1050 | 1057 | ||
| 1051 | if (skb == tcp_write_queue_tail(sk) && cwnd_len <= skb->len) | 1058 | needed = min(skb->len, window); |
| 1059 | |||
| 1060 | if (skb == tcp_write_queue_tail(sk) && cwnd_len <= needed) | ||
| 1052 | return cwnd_len; | 1061 | return cwnd_len; |
| 1053 | 1062 | ||
| 1054 | needed = min(skb->len, window); | ||
| 1055 | return needed - needed % mss_now; | 1063 | return needed - needed % mss_now; |
| 1056 | } | 1064 | } |
| 1057 | 1065 | ||
