aboutsummaryrefslogtreecommitdiffstats
path: root/net/ipv4/tcp_input.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/ipv4/tcp_input.c')
-rw-r--r--net/ipv4/tcp_input.c25
1 files changed, 2 insertions, 23 deletions
diff --git a/net/ipv4/tcp_input.c b/net/ipv4/tcp_input.c
index d703a0b3b6a2..7a59f6a96212 100644
--- a/net/ipv4/tcp_input.c
+++ b/net/ipv4/tcp_input.c
@@ -426,26 +426,7 @@ static void tcp_grow_window(struct sock *sk, const struct sk_buff *skb)
426 } 426 }
427} 427}
428 428
429/* 3. Tuning rcvbuf, when connection enters established state. */ 429/* 3. Try to fixup all. It is made immediately after connection enters
430static void tcp_fixup_rcvbuf(struct sock *sk)
431{
432 u32 mss = tcp_sk(sk)->advmss;
433 int rcvmem;
434
435 rcvmem = 2 * SKB_TRUESIZE(mss + MAX_TCP_HEADER) *
436 tcp_default_init_rwnd(mss);
437
438 /* Dynamic Right Sizing (DRS) has 2 to 3 RTT latency
439 * Allow enough cushion so that sender is not limited by our window
440 */
441 if (sock_net(sk)->ipv4.sysctl_tcp_moderate_rcvbuf)
442 rcvmem <<= 2;
443
444 if (sk->sk_rcvbuf < rcvmem)
445 sk->sk_rcvbuf = min(rcvmem, sock_net(sk)->ipv4.sysctl_tcp_rmem[2]);
446}
447
448/* 4. Try to fixup all. It is made immediately after connection enters
449 * established state. 430 * established state.
450 */ 431 */
451void tcp_init_buffer_space(struct sock *sk) 432void tcp_init_buffer_space(struct sock *sk)
@@ -454,8 +435,6 @@ void tcp_init_buffer_space(struct sock *sk)
454 struct tcp_sock *tp = tcp_sk(sk); 435 struct tcp_sock *tp = tcp_sk(sk);
455 int maxwin; 436 int maxwin;
456 437
457 if (!(sk->sk_userlocks & SOCK_RCVBUF_LOCK))
458 tcp_fixup_rcvbuf(sk);
459 if (!(sk->sk_userlocks & SOCK_SNDBUF_LOCK)) 438 if (!(sk->sk_userlocks & SOCK_SNDBUF_LOCK))
460 tcp_sndbuf_expand(sk); 439 tcp_sndbuf_expand(sk);
461 440
@@ -485,7 +464,7 @@ void tcp_init_buffer_space(struct sock *sk)
485 tp->snd_cwnd_stamp = tcp_jiffies32; 464 tp->snd_cwnd_stamp = tcp_jiffies32;
486} 465}
487 466
488/* 5. Recalculate window clamp after socket hit its memory bounds. */ 467/* 4. Recalculate window clamp after socket hit its memory bounds. */
489static void tcp_clamp_window(struct sock *sk) 468static void tcp_clamp_window(struct sock *sk)
490{ 469{
491 struct tcp_sock *tp = tcp_sk(sk); 470 struct tcp_sock *tp = tcp_sk(sk);