Message ID | 5878E166.8080800@oracle.com |
---|---|
State | Superseded, archived |
Delegated to: | David Miller |
Headers | show |
On 13.01.2017 17:17, Alexey Kodanev wrote: > Hi, > > Got the issue when running LTP/netstress test on localhost with mss > greater than the send window advertised by client (right after 3WHS). > Here is the testscenario that can reproduce this: Please ignore this message with 'flowed' format. Will resend. Thanks, Alexey
diff --git a/net/ipv4/tcp.c b/net/ipv4/tcp.c index 4a04496..3d3bd97 100644 --- a/net/ipv4/tcp.c +++ b/net/ipv4/tcp.c @@ -860,7 +860,12 @@ static unsigned int tcp_xmit_size_goal(struct sock *sk, u32 mss_now, size_goal = tp->gso_segs * mss_now; } - return max(size_goal, mss_now); + size_goal = max(size_goal, mss_now); + + if (tp->snd_wnd > TCP_MSS_DEFAULT) + return min(tp->snd_wnd, size_goal); + + return size_goal; } static int tcp_send_mss(struct sock *sk, int *size_goal, int flags) diff --git a/net/ipv4/tcp_output.c b/net/ipv4/tcp_output.c index 1d5331a..0ac133f 100644 --- a/net/ipv4/tcp_output.c +++ b/net/ipv4/tcp_output.c @@ -2445,7 +2445,7 @@ void tcp_push_one(struct sock *sk, unsigned int mss_now) { struct sk_buff *skb = tcp_send_head(sk); - BUG_ON(!skb || skb->len < mss_now); + BUG_ON(!skb); tcp_write_xmit(sk, mss_now, TCP_NAGLE_PUSH, 1, sk->sk_allocation);