Commit 06a59ecb authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

tcp: use TCP_INIT_CWND in tcp_fixup_sndbuf()

Initial cwnd being 10 (TCP_INIT_CWND) instead of 3, change
tcp_fixup_sndbuf() to get more than 16384 bytes (sysctl_tcp_wmem[1]) in
initial sk_sndbuf
Signed-off-by: default avatarEric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent fddf86fc
...@@ -267,11 +267,9 @@ static void tcp_fixup_sndbuf(struct sock *sk) ...@@ -267,11 +267,9 @@ static void tcp_fixup_sndbuf(struct sock *sk)
{ {
int sndmem = SKB_TRUESIZE(tcp_sk(sk)->rx_opt.mss_clamp + MAX_TCP_HEADER); int sndmem = SKB_TRUESIZE(tcp_sk(sk)->rx_opt.mss_clamp + MAX_TCP_HEADER);
if (sk->sk_sndbuf < 3 * sndmem) { sndmem *= TCP_INIT_CWND;
sk->sk_sndbuf = 3 * sndmem; if (sk->sk_sndbuf < sndmem)
if (sk->sk_sndbuf > sysctl_tcp_wmem[2]) sk->sk_sndbuf = min(sndmem, sysctl_tcp_wmem[2]);
sk->sk_sndbuf = sysctl_tcp_wmem[2];
}
} }
/* 2. Tuning advertised window (window_clamp, rcv_ssthresh) /* 2. Tuning advertised window (window_clamp, rcv_ssthresh)
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment