Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

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: Eric Dumazet <eric.dumazet@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>

authored by

Eric Dumazet and committed by
David S. Miller
06a59ecb fddf86fc

+3 -5
+3 -5
net/ipv4/tcp_input.c
··· 267 267 { 268 268 int sndmem = SKB_TRUESIZE(tcp_sk(sk)->rx_opt.mss_clamp + MAX_TCP_HEADER); 269 269 270 - if (sk->sk_sndbuf < 3 * sndmem) { 271 - sk->sk_sndbuf = 3 * sndmem; 272 - if (sk->sk_sndbuf > sysctl_tcp_wmem[2]) 273 - sk->sk_sndbuf = sysctl_tcp_wmem[2]; 274 - } 270 + sndmem *= TCP_INIT_CWND; 271 + if (sk->sk_sndbuf < sndmem) 272 + sk->sk_sndbuf = min(sndmem, sysctl_tcp_wmem[2]); 275 273 } 276 274 277 275 /* 2. Tuning advertised window (window_clamp, rcv_ssthresh)