Skip to content

net: sysctl: share ipv4/ipv6 sysctl tables

Lucian Adrian Grijincu lkml netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest5 patches 7 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/5sysctl: faster reimplementation of sysctl_check_tablekernel/sysctl_check.c+60 -614 replies
2/5sysctl: remove useless ctl_table->parent fieldinclude/linux/sysctl.h kernel/sysctl.c kernel/sysctl_check.c+2 -141 reply
3/5sysctl: write ctl_table->extra2 to entries created from ctl_pathinclude/linux/sysctl.h include/net/net_namespace.h kernel/sysctl.c +2 more+22 -110 replies
4/5ipv4: share sysctl net/ipv4/conf/DEVNAME/ tablesfs/proc/proc_sysctl.c include/linux/inetdevice.h net/ipv4/devinet.c+161 -701 reply
5/5ipv6: share sysctl net/ipv6/conf/DEVNAME/ tablesinclude/linux/ipv6.h net/ipv6/addrconf.c+143 -640 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH 0/5] net: sysctl: share ipv4/ipv6 sysctl tables

Each network device gets the same 25/24 sysctl entries for ipv4/ipv6 in /proc/sys/net/ipv4/conf/DEVNAME and /proc/sys/net/ipv6/conf/DEVNAME

Unfortunately, space is wasted holding very much similar data. Fortunately, with some tricks these entries can be shared between all network devices.

The single entry in 'struct ctl_table' that was modified at runtime for leaf ctl_table nodes and prevented sharing was 'parent'. This field was first introduces for selinux and then was used to implement sysctl_check_table. Selinux recently removed the need for this field:
* http://thread.gmane.org/gmane.linux.kernel.lsm/12623
* LKML-Reference: [email protected]

Remove the need for 'parent' in sysctl_check_table and remove the 'parent' field:

[PATCH 1/5] sysctl: faster reimplementation of sysctl_check_table [PATCH 2/5] sysctl: remove useless ctl_table->parent field

Pave the way for sharing of ipv4/6 tables: allow data to be stored in the nodes above the leafs that will be shared:

[PATCH 3/5] sysctl: write ctl_table->extra2 to entries created from ctl_path

Finally share the leaf sysctl tables for ipv4/ipv6:

[PATCH 4/5] ipv4: share sysctl net/ipv4/conf/DEVNAME/ tables [PATCH 5/5] ipv6: share sysctl net/ipv6/conf/DEVNAME/ tables

 fs/proc/proc_sysctl.c       |   16 +++-
 include/linux/inetdevice.h  |   12 +++-
 include/linux/ipv6.h        |   15 +++-
 include/linux/sysctl.h      |    3 +-
 include/net/net_namespace.h |    2 +
 kernel/sysctl.c             |   18 +---
 kernel/sysctl_check.c       |  125 +++++++++++++--------------
 net/ipv4/devinet.c          |  203 ++++++++++++++++++++++++++++--------------
 net/ipv6/addrconf.c         |  192 +++++++++++++++++++++++++++-------------
 net/sysctl_net.c            |   20 +++--
 10 files changed, 387 insertions(+), 219 deletions(-)
Signature · 1 line
1.7.4.rc1.7.g2cf08.dirty