* Re: [patch net-2.6.25 1/2][NETNS] net: Modify the neighbour table code so it handles multiple network namespaces [not found] ` <20071221131601.818555294@ICON-9-164-138-215.megacenter.de.ibm.com> @ 2007-12-24 23:56 ` David Miller 0 siblings, 0 replies; 3+ messages in thread From: David Miller @ 2007-12-24 23:56 UTC (permalink / raw) To: ebiederm; +Cc: netdev, den, benjamin.thery From: Eric.W.Biederman" <ebiederm@xmission.com>"@fr.ibm.com Date: Fri, 21 Dec 2007 14:02:24 +0100 > I'm actually surprised at how much was involved. At first glance it appears > that the neighbour table data structures are already split by network device > so all that should be needed is to modify the user interface commands > to filter the set of neighbours by the network namespace of their devices. > > However a couple things turned up while I was reading through the code. > The proxy neighbour table allows entries with no network device, and > the neighbour parms are per network device (except for the defaults) > so they now need a per network namespace default. > > So I updated the two structures (which surprised me) with their very > own network namespace parameter. Updated the relevant lookup and > destroy routines with a network namespace parameter and modified > the code that interacts with users to filter out neighbour > table entries for devices of other namespaces. > > I'm a little concerned that we can modify and display the global > table configuration and from all network namespaces. But > this appears good enough for now. > > I keep thinking modifying the neighbour table to have per network > namespace instances of each table type would should be cleaner. The > hash table is already dynamically sized so there are it is not a limiter. > The default parameter would be straight forward to take care of. However > when I look at the how the network table is built and used I still find > some assumptions that there is only a single neighbour table for each > type of table in the kernel. The netlink operations, neigh_seq_start, > the non-core network users that call neigh_lookup. So while it might > be doable it would require more refactoring than my current approach > of just doing a little extra filtering in the code. > > Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> > Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Applied, thanks. ^ permalink raw reply [flat|nested] 3+ messages in thread
[parent not found: <20071221131606.284066116@ICON-9-164-138-215.megacenter.de.ibm.com>]
* Re: [patch net-2.6.25 2/2][NETNS] net: Add a helper function neigh_param_default_alloc [not found] ` <20071221131606.284066116@ICON-9-164-138-215.megacenter.de.ibm.com> @ 2007-12-24 23:56 ` David Miller 0 siblings, 0 replies; 3+ messages in thread From: David Miller @ 2007-12-24 23:56 UTC (permalink / raw) To: ebiederm; +Cc: netdev, den, benjamin.thery From: Eric.W.Biederman" <ebiederm@xmission.com>"@fr.ibm.com Date: Fri, 21 Dec 2007 14:02:25 +0100 > In the presence of multiple network namespaces the logic needed > to allocate the a default parameter table is just barely non-trivial. > So add a function to automate it to make everyone's life easier. > > Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> > Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> Please submit this patch with the patch set that starts to use the new interface. There is no need to add it now, thanks. ^ permalink raw reply [flat|nested] 3+ messages in thread
* [patch net-2.6.25 0/2][NETNS] prepare the neigh subsys to handle network namespaces v2 @ 2007-12-21 13:59 Daniel Lezcano 2007-12-21 13:59 ` [patch net-2.6.25 2/2][NETNS] net: Add a helper function neigh_param_default_alloc Daniel Lezcano 0 siblings, 1 reply; 3+ messages in thread From: Daniel Lezcano @ 2007-12-21 13:59 UTC (permalink / raw) To: davem; +Cc: netdev, den, benjamin.thery These two patches are coming from Eric Biederman patchset to make the neighbouring aware of the namespaces. The description in the patch headers is big enough to add more comments here :) Changelog: v2 : fixed bad coding style v1 : initial post -- ^ permalink raw reply [flat|nested] 3+ messages in thread
* [patch net-2.6.25 2/2][NETNS] net: Add a helper function neigh_param_default_alloc 2007-12-21 13:59 [patch net-2.6.25 0/2][NETNS] prepare the neigh subsys to handle network namespaces v2 Daniel Lezcano @ 2007-12-21 13:59 ` Daniel Lezcano 0 siblings, 0 replies; 3+ messages in thread From: Daniel Lezcano @ 2007-12-21 13:59 UTC (permalink / raw) To: davem; +Cc: netdev, den, benjamin.thery, Eric W. Biederman [-- Attachment #1: 0002-net-Add-a-helper-function-neigh_param_default_alloc.patch --] [-- Type: text/plain, Size: 2127 bytes --] In the presence of multiple network namespaces the logic needed to allocate the a default parameter table is just barely non-trivial. So add a function to automate it to make everyone's life easier. Signed-off-by: Eric W. Biederman <ebiederm@xmission.com> Signed-off-by: Daniel Lezcano <dlezcano@fr.ibm.com> --- include/net/neighbour.h | 1 + net/core/neighbour.c | 15 +++++++++++++++ 2 files changed, 16 insertions(+) Index: net-2.6.25/include/net/neighbour.h =================================================================== --- net-2.6.25.orig/include/net/neighbour.h +++ net-2.6.25/include/net/neighbour.h @@ -208,6 +208,7 @@ extern struct neighbour *neigh_event_ns struct net_device *dev); extern struct neigh_parms *neigh_parms_alloc(struct net_device *dev, struct neigh_table *tbl); +extern struct neigh_parms *neigh_parms_alloc_default(struct neigh_table *tbl, struct net *net); extern void neigh_parms_release(struct neigh_table *tbl, struct neigh_parms *parms); extern void neigh_parms_destroy(struct neigh_parms *parms); extern unsigned long neigh_rand_reach_time(unsigned long base); Index: net-2.6.25/net/core/neighbour.c =================================================================== --- net-2.6.25.orig/net/core/neighbour.c +++ net-2.6.25/net/core/neighbour.c @@ -1325,6 +1325,20 @@ struct neigh_parms *neigh_parms_alloc(st return p; } +struct neigh_parms *neigh_parms_alloc_default(struct neigh_table *tbl, + struct net *net) +{ + struct neigh_parms *parms; + if (net != &init_net) { + parms = neigh_parms_alloc(NULL, tbl); + release_net(parms->net); + parms->net = hold_net(net); + } + else + parms = neigh_parms_clone(&tbl->parms); + return parms; +} + static void neigh_rcu_free_parms(struct rcu_head *head) { struct neigh_parms *parms = @@ -2787,6 +2801,7 @@ EXPORT_SYMBOL(neigh_ifdown); EXPORT_SYMBOL(neigh_lookup); EXPORT_SYMBOL(neigh_lookup_nodev); EXPORT_SYMBOL(neigh_parms_alloc); +EXPORT_SYMBOL(neigh_parms_alloc_default); EXPORT_SYMBOL(neigh_parms_release); EXPORT_SYMBOL(neigh_rand_reach_time); EXPORT_SYMBOL(neigh_resolve_output); -- ^ permalink raw reply [flat|nested] 3+ messages in thread
end of thread, other threads:[~2007-12-24 23:57 UTC | newest]
Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
[not found] <20071221130223.348101205@ICON-9-164-138-215.megacenter.de.ibm.com>
[not found] ` <20071221131601.818555294@ICON-9-164-138-215.megacenter.de.ibm.com>
2007-12-24 23:56 ` [patch net-2.6.25 1/2][NETNS] net: Modify the neighbour table code so it handles multiple network namespaces David Miller
[not found] ` <20071221131606.284066116@ICON-9-164-138-215.megacenter.de.ibm.com>
2007-12-24 23:56 ` [patch net-2.6.25 2/2][NETNS] net: Add a helper function neigh_param_default_alloc David Miller
2007-12-21 13:59 [patch net-2.6.25 0/2][NETNS] prepare the neigh subsys to handle network namespaces v2 Daniel Lezcano
2007-12-21 13:59 ` [patch net-2.6.25 2/2][NETNS] net: Add a helper function neigh_param_default_alloc Daniel Lezcano
This is a public inbox, see mirroring instructions for how to clone and mirror all data and code used for this inbox