mirror of
https://github.com/Fishwaldo/linux-bl808.git
synced 2025-06-17 20:25:19 +00:00
tcp: Namespace-ify sysctl_tcp_rmem and sysctl_tcp_wmem
Note that when a new netns is created, it inherits its sysctl_tcp_rmem and sysctl_tcp_wmem from initial netns. This change is needed so that we can refine TCP rcvbuf autotuning, to take RTT into consideration. Signed-off-by: Eric Dumazet <edumazet@google.com> Cc: Wei Wang <weiwan@google.com> Signed-off-by: David S. Miller <davem@davemloft.net>
This commit is contained in:
parent
a3dcaf17ee
commit
356d1833b6
8 changed files with 47 additions and 43 deletions
|
@ -2409,8 +2409,8 @@ struct proto tcp_prot = {
|
|||
.memory_allocated = &tcp_memory_allocated,
|
||||
.memory_pressure = &tcp_memory_pressure,
|
||||
.sysctl_mem = sysctl_tcp_mem,
|
||||
.sysctl_wmem = sysctl_tcp_wmem,
|
||||
.sysctl_rmem = sysctl_tcp_rmem,
|
||||
.sysctl_wmem_offset = offsetof(struct net, ipv4.sysctl_tcp_wmem),
|
||||
.sysctl_rmem_offset = offsetof(struct net, ipv4.sysctl_tcp_rmem),
|
||||
.max_header = MAX_TCP_HEADER,
|
||||
.obj_size = sizeof(struct tcp_sock),
|
||||
.slab_flags = SLAB_TYPESAFE_BY_RCU,
|
||||
|
@ -2509,7 +2509,14 @@ static int __net_init tcp_sk_init(struct net *net)
|
|||
net->ipv4.sysctl_tcp_invalid_ratelimit = HZ/2;
|
||||
net->ipv4.sysctl_tcp_pacing_ss_ratio = 200;
|
||||
net->ipv4.sysctl_tcp_pacing_ca_ratio = 120;
|
||||
|
||||
if (net != &init_net) {
|
||||
memcpy(net->ipv4.sysctl_tcp_rmem,
|
||||
init_net.ipv4.sysctl_tcp_rmem,
|
||||
sizeof(init_net.ipv4.sysctl_tcp_rmem));
|
||||
memcpy(net->ipv4.sysctl_tcp_wmem,
|
||||
init_net.ipv4.sysctl_tcp_wmem,
|
||||
sizeof(init_net.ipv4.sysctl_tcp_wmem));
|
||||
}
|
||||
net->ipv4.sysctl_tcp_fastopen = TFO_CLIENT_ENABLE;
|
||||
spin_lock_init(&net->ipv4.tcp_fastopen_ctx_lock);
|
||||
net->ipv4.sysctl_tcp_fastopen_blackhole_timeout = 60 * 60;
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue