Skip to content

Commit 041a14d

Browse files
yuchungchengdavem330
authored andcommitted
tcp: start receiver buffer autotuning sooner
Previously receiver buffer auto-tuning starts after receiving one advertised window amount of data. After the initial receiver buffer was raised by patch a337531 ("tcp: up initial rmem to 128KB and SYN rwin to around 64KB"), the reciver buffer may take too long to start raising. To address this issue, this patch lowers the initial bytes expected to receive roughly the expected sender's initial window. Fixes: a337531 ("tcp: up initial rmem to 128KB and SYN rwin to around 64KB") Signed-off-by: Yuchung Cheng <[email protected]> Signed-off-by: Wei Wang <[email protected]> Signed-off-by: Neal Cardwell <[email protected]> Signed-off-by: Eric Dumazet <[email protected]> Reviewed-by: Soheil Hassas Yeganeh <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent d96112b commit 041a14d

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

net/ipv4/tcp_input.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -438,7 +438,7 @@ void tcp_init_buffer_space(struct sock *sk)
438438
if (!(sk->sk_userlocks & SOCK_SNDBUF_LOCK))
439439
tcp_sndbuf_expand(sk);
440440

441-
tp->rcvq_space.space = tp->rcv_wnd;
441+
tp->rcvq_space.space = min_t(u32, tp->rcv_wnd, TCP_INIT_CWND * tp->advmss);
442442
tcp_mstamp_refresh(tp);
443443
tp->rcvq_space.time = tp->tcp_mstamp;
444444
tp->rcvq_space.seq = tp->copied_seq;

0 commit comments

Comments
 (0)