[<prev] [next>] [thread-next>] [day] [month] [year] [list]
Message-Id: <FAAC90D7-8126-44CA-AACF-A5F8237C1A8E@usgs.gov>
Date: Mon, 11 Feb 2013 16:26:00 -0800
From: Larry Baker <baker@...s.gov>
To: netdev@...r.kernel.org
Subject: decnet: /proc/sys/net/decnet sysctl entries disappear
Beginning with kernel 2.6.27, the decnet kernel module /proc/sys/net/decnet sysctl entries disappear. With the generous assistance of Eric Biederman, I have developed these patches to restore the previous behavior and add minor features. (N.b, Eric verified kernel 3.4-rc1 no longer has this behavior.)
I have developed three sets of patches, to account for changes in the kernel networking APIs.
Download attachment "linux-2.6.27-decnet-sysctl.patch" of type "application/octet-stream" (7709 bytes)
Download attachment "linux-2.6.33-decnet-sysctl.patch" of type "application/octet-stream" (7704 bytes)
Download attachment "linux-3.5-decnet-sysctl.patch" of type "application/octet-stream" (8165 bytes)
. linux-2.6.27-decnet-sysctl.patch
decnet kernel module patches for Linux 2.6.27 through 2.6.32 (tree-structured sysctl, struct ctl_path includes .ctl_name)
. linux-2.6.33-decnet-sysctl.patch
decnet kernel module patches for Linux 2.6.33 through 3.4.x (struct ctl_path no longer includes .ctl_name, rtnl_register() adds rtnl_calcit_func calcit)
. linux-3.5-decnet-sysctl.patch
decnet kernel module patches for Linux 3.5 and later (register_net_sysctl()/unregister_net_sysctl_table() in place of register_sysctl_paths()/unregister_sysctl_table())
I am running linux-2.6.27-decnet-sysctl.patch on a CentOS 6.3 x86_64 system (Linux atompc.wr.usgs.gov 2.6.32-279.19.1.el6.x86_64 #1 SMP Wed Dec 19 07:05:20 UTC 2012 x86_64 x86_64 x86_64 GNU/Linux).
I am running linux-2.6.33-decnet-sysctl.patch on an Arch Linux ARM 3.1.10 system (Linux sheeva 3.1.10-15-ARCH #1 PREEMPT Wed Dec 12 15:25:18 UTC 2012 armv5tel GNU/Linux).
I do not have the ability to test linux-3.5-decnet-sysctl.patch. I compared linux-2.6.33-decnet-sysctl.patch to linux-3.5-decnet-sysctl.patch, and inspected the patched files visually.
Description
The decnet kernel module is configured using entries under /proc/sys/net/decnet. There are executor settings in /proc/sys/net/decnet, template device settings in /proc/sys/net/decnet/conf/{ddcmp,ethernet,ipgre,loopback}, and active device settings for DECnet devices in /proc/sys/net/decnet/conf/{lo,eth0,...}. All Ethernet interfaces and the loopback interface are configured as DECnet devices when the decnet kernel module is loaded.
The executor settings and template device settings are static; active device settings are dynamic. The active device settings for a network device are copied from the appropriate template device settings when the network device is configured as a DECnet device. The active device settings are discarded when a DECnet device is unconfigured (e.g., when the DECnet node address is set).
When the DECnet node address is set (e.g., by writing the new address to /proc/sys/net/decnet/node_address) all DECnet devices are unconfigured, the new DECnet node address is saved, and all Ethernet interfaces and the loopback interface are reconfigured as DECnet devices.
When a DECnet device is unconfigured, its active device settings entries are unregistered from the sysctl network namespace (/proc/sys/net). When a DECnet device is reconfigured, its active device settings entries are reregistered.
In kernel 2.6.27 the sysctl data structures were changed from a list to a tree. The registration/unregistration behavior also changed. As a result, when any active device settings entries are unregistered, all the decnet kernel module configuration settings entries in the sysctl network namespace are no longer visible. The only entries that are visible are the active device settings entries that are reregistered when the DECnet devices are reconfigured.
The fix is to register an empty static /proc/sys/net/decnet/conf entry (ala mkdir) before any of the (static or dynamic) entries beneath it are registered. This workaround is not needed in 3.4 and later kernels.
After this patch, the registration order for sysctl entries is:
. Static executor entries in /proc/sys/net/decnet
. Static empty path entry /proc/sys/net/decnet/conf
. Static template device entries in /proc/sys/net/decnet/conf/<type>
. Dynamic active device entries in /proc/sys/net/decnet/conf/<dev-name>
Unregistration order is the reverse.
Other changes are:
. Updated banner
. DECnet device up/down KERN_INFO messages
. debug module parameter
. NETDEV_UP/DOWN KERN_DEBUG messages if (debug & 8)
. dn_route.c uses dn_hiord[ETH_ALEN] in dn_dev.c
Larry Baker
US Geological Survey
650-329-5608
baker@...s.gov
Powered by blists - more mailing lists