Skip to content

Commit c36207b

Browse files
tracywwnjdavem330
authored andcommitted
tcp: remove mss check in tcp_select_initial_window()
In tcp_select_initial_window(), we only set rcv_wnd to tcp_default_init_rwnd() if current mss > (1 << wscale). Otherwise, rcv_wnd is kept at the full receive space of the socket which is a value way larger than tcp_default_init_rwnd(). With larger initial rcv_wnd value, receive buffer autotuning logic takes longer to kick in and increase the receive buffer. In a TCP throughput test where receiver has rmem[2] set to 125MB (wscale is 11), we see the connection gets recvbuf limited at the beginning of the connection and gets less throughput overall. Signed-off-by: Wei Wang <weiwan@google.com> Acked-by: Eric Dumazet <edumazet@google.com> Acked-by: Soheil Hassas Yeganeh <soheil@google.com> Acked-by: Yuchung Cheng <ycheng@google.com> Acked-by: Neal Cardwell <ncardwell@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
1 parent 448c907 commit c36207b

File tree

1 file changed

+3
-5
lines changed

1 file changed

+3
-5
lines changed

net/ipv4/tcp_output.c

Lines changed: 3 additions & 5 deletions
Original file line numberDiff line numberDiff line change
@@ -229,11 +229,9 @@ void tcp_select_initial_window(const struct sock *sk, int __space, __u32 mss,
229229
}
230230
}
231231

232-
if (mss > (1 << *rcv_wscale)) {
233-
if (!init_rcv_wnd) /* Use default unless specified otherwise */
234-
init_rcv_wnd = tcp_default_init_rwnd(mss);
235-
*rcv_wnd = min(*rcv_wnd, init_rcv_wnd * mss);
236-
}
232+
if (!init_rcv_wnd) /* Use default unless specified otherwise */
233+
init_rcv_wnd = tcp_default_init_rwnd(mss);
234+
*rcv_wnd = min(*rcv_wnd, init_rcv_wnd * mss);
237235

238236
/* Set the clamp no higher than max representable value */
239237
(*window_clamp) = min_t(__u32, U16_MAX << (*rcv_wscale), *window_clamp);

0 commit comments

Comments
 (0)