16 Apr, 2008
40 commits
-
The alloc_netdev_mq() tries to produce 32-bytes alignment for both
the net_device itself and its private data. The second alignment is
achieved by adding the NETDEV_ALIGN_CONST to the whole size of
the memory to be allocated.However, for those devices that do not need the private area, this
addition just makes the net_device weight 1024 + 32 = 1068 bytes,
i.e. consume twice as much memory.Since loopback device is such (sizeof_priv == 0 for it), and each
net namespace creates one, this can save a noticeable amount of
memory for kernel with net namespaces turned on.After this set the lo device is actually allocated from a size-1024
kmem cache on i386 box even with NETPOLL and WIRELESS_EXT turned on.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
dev_set_net is called for
- just allocated devices
- devices moving from one namespace to another
release_net has proper check inside to distinguish these cases.Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
Protocol control sockets and netlink kernel sockets should not prevent the
namespace stop request. They are initialized and disposed in a special way by
sk_change_net/sk_release_kernel.Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
Make release_net/hold_net noop for performance-hungry people. This is a debug
staff and should be used in the debug mode only.Add check for net != NULL in hold/release calls. This will be required
later on.[ Added minor simplifications suggested by Brian Haley. -DaveM ]
Signed-off-by: Denis V. Lunev
Signed-off-by: David S. Miller -
And no need in some IPPROTO_XXX enabling, since ipv6 code
doesn't have any filtering.So, just set proper net and mark device with NETNS_LOCAL.
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
All the ip_route_output_key(), dev_get_by_...() and ipv6_chk_addr()
calls are now stubbed with init_net.Fortunately, all the places already have where to get the proper
net from.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Move hashes in the struct ip6_tnl_net, replace tnls_xxx[] with
ip6n->tnlx_xxx[] and handle init and exit appropriately.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
All the code, that reference it already has the ip6_tnl_net pointer,
so s/ip6_fb_tnl_dev/ip6n->fb_tnl_dev/ and move creation/releasing
code into net init/exit ops.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Calls to ip6_tnl_lookup were stubbed with init_net - give them
a proper one.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Hashes and fallback device used in them will be per-net.
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
This makes sit-generated traffic enter the namespace.
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Set proper net and mark a new device as NETNS_LOCAL before registering.
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
I.e. replace init_net stubs in ip_route_output_key() calls.
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Just move all the hashes on the sit_net structure and
patch the rest of the code appropriately.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Allocate and register one in sit_init_net, use sitn->fb_tunnel_dev
over the code and unregister one in sit_exit_net.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Replace introduced in the previous patch init_net stubs
with the proper net pointer.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
... to make them prepared for future hashes and fallback device
move on the struct sit_net.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
This one was also disabled by default for sanity.
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
I.e. set the proper net and mark as NETNS_LOCAL.
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
As for the IPIP tunnel, there are some ip_route_output_key()
calls in there that require a proper net so give one to them.And a proper net for the __get_dev_by_index hanging around.
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Very similar to what was done for the IPIP code.
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Everything is prepared for this change now. Create on in
init callback, use it over the code and destroy on net exit.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
This is the part#2 of the patch #2 - get the proper net for
these functions. This change in a separate patch in order not
to get lost in a large previous patch.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
The fallback device and hashes are to become per-net, but many
code doesn't have anything to get the struct net pointer from.So pass the proper net there with an extra argument.
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
This one was disabled by default for sanity.
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Set the proper net before calling register_netdev and disable
the tunnel device netns changing.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
There are some ip_route_output_key() calls in there that require
a proper net so give one to them.Besides - give a proper net to a single __get_dev_by_index call
in ipip_tunnel_bind_dev().Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Either net or ipip_net already exists in all the required
places, so just use one.Besides, tune net_init and net_exit calls to respectively
initialize the hashes and destroy devices.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
This is the part#2 of the previous patch - get the proper
net for these functions.I make it in a separate patch, so that this change does not
get lost in a large previous patch.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
The hashes of tunnels will be per-net too, so prepare all the
functions that uses them for this change by adding an argument.Use init_net temporarily in places, where the net does not exist
explicitly yet.Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Create on in ipip_init_net(), use it all over the code (the
proper place to get the net from already exists) and destroy
in ipip_net_exit().Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller -
Signed-off-by: Pavel Emelyanov
Signed-off-by: David S. Miller