netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next 0/3] Namespace-ify some sysctl in net/core
@ 2021-01-18 14:39 menglong8.dong
  2021-01-18 14:39 ` [PATCH net-next 1/3] net: core: init every ctl_table in netns_core_table menglong8.dong
                   ` (2 more replies)
  0 siblings, 3 replies; 7+ messages in thread
From: menglong8.dong @ 2021-01-18 14:39 UTC (permalink / raw)
  To: kuba, christian.brauner
  Cc: davem, yoshfuji, dong.menglong, daniel, gnault, ast,
	nicolas.dichtel, ap420073, edumazet, pabeni, jakub, bjorn.topel,
	keescook, viro, rdna, maheshb, netdev, linux-kernel

From: Menglong Dong <dong.menglong@zte.com.cn>

For now, most sysctl in 'net/core' are globally unified, such as
sysctl_wmem_default, sysctl_rmem_default, sysctl_wmem_default,
sysctl_rmem_default, etc.

It's not convenient in some case. For example, when we use docker
and try to control the default udp socket receive buffer for
each container by sysctl_rmem_default.

For that reason, I namespace-ify some sysctl in 'net/core', which
are sysctl_wmem_default, sysctl_rmem_default, sysctl_wmem_default
and sysctl_rmem_default.

In the first patch, I made some adjustments to the initialization
of netns_core_table.

The second patch make sysctl_wmem_default and sysctl_rmem_default
per-namespace, and the third patch make sysctl_wmem_max and
sysctl_rmem_max per-namespace.

After these patch, sysctl above are pre-namespace, for example:

$ cat /proc/sys/net/core/rmem_default
1024000
$ ip netns exec test cat /proc/sys/net/core/rmem_default
212992
$ ip netns exec test2 cat /proc/sys/net/core/rmem_default
2048000

Thanks for Christian's patient explaining to make these patches a
single series~

Menglong Dong (3):
  net: core: init every ctl_table in netns_core_table
  net: core: Namespace-ify sysctl_wmem_default and sysctl_rmem_default
  net: core: Namespace-ify sysctl_rmem_max and sysctl_wmem_max

 include/net/netns/core.h        |  4 ++
 include/net/sock.h              |  6 ---
 net/core/filter.c               |  4 +-
 net/core/net_namespace.c        |  4 ++
 net/core/sock.c                 | 18 +++-----
 net/core/sysctl_net_core.c      | 76 +++++++++++++++++----------------
 net/ipv4/ip_output.c            |  2 +-
 net/ipv4/tcp_output.c           |  2 +-
 net/netfilter/ipvs/ip_vs_sync.c |  4 +-
 9 files changed, 60 insertions(+), 60 deletions(-)


base-commit: 5ee88057889bbca5f5bb96031b62b3756b33e164
-- 
2.30.0


^ permalink raw reply	[flat|nested] 7+ messages in thread

end of thread, other threads:[~2021-01-20 20:24 UTC | newest]

Thread overview: 7+ messages (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2021-01-18 14:39 [PATCH net-next 0/3] Namespace-ify some sysctl in net/core menglong8.dong
2021-01-18 14:39 ` [PATCH net-next 1/3] net: core: init every ctl_table in netns_core_table menglong8.dong
2021-01-18 14:39 ` [PATCH net-next 2/3] net: core: Namespace-ify sysctl_wmem_default and sysctl_rmem_default menglong8.dong
2021-01-18 14:39 ` [PATCH net-next 3/3] net: core: Namespace-ify sysctl_rmem_max and sysctl_wmem_max menglong8.dong
2021-01-20 10:46   ` Florian Westphal
2021-01-20 13:28     ` Menglong Dong
2021-01-20 13:57       ` Nicolas Dichtel

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).