]> git.baikalelectronics.ru Git - kernel.git/commit
net: vxlan: convert to act as a pernet subsystem
authorDaniel Borkmann <dborkman@redhat.com>
Wed, 22 Jan 2014 20:07:53 +0000 (21:07 +0100)
committerDavid S. Miller <davem@davemloft.net>
Thu, 23 Jan 2014 01:43:38 +0000 (17:43 -0800)
commitfda3d9f55322c2391b0c578761b6d68bcdd8b482
tree19bac10967d92af74541d541ac43038967ed6d39
parent24c4977d0879408dd34abf181712de8f1ef19d77
net: vxlan: convert to act as a pernet subsystem

As per suggestion from Eric W. Biederman, vxlan should be using
{un,}register_pernet_subsys() instead of {un,}register_pernet_device()
to ensure the vxlan_net structure is initialized before and cleaned
up after all network devices in a given network namespace i.e. when
dealing with network notifiers. This is similarly handeled already in
commit 83a66f65b189 ("net: Teach vlans to cleanup as a pernet subsystem")
and, thus, improves upon 9142fc5c6c0f ("net: vxlan: do not use vxlan_net
before checking event type"). Just as in 83a66f65b189, we do not need
to explicitly handle deletion of vxlan devices as network namespace
exit calls dellink on all remaining virtual devices, and
rtnl_link_unregister() calls dellink on all outstanding devices in that
network namespace, so we can entirely drop the pernet exit operation
as well. Moreover, on vxlan module exit, rcu_barrier() is called by
netns since commit 1c43004195b6 ("netns: Add an explicit rcu_barrier
to unregister_pernet_{device|subsys}"), so this may be omitted. Tested
with various scenarios and works well on my side.

Suggested-by: Eric W. Biederman <ebiederm@xmission.com>
Cc: Jesse Brandeburg <jesse.brandeburg@intel.com>
Cc: Eric W. Biederman <ebiederm@xmission.com>
Signed-off-by: Daniel Borkmann <dborkman@redhat.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
drivers/net/vxlan.c