From: Eric W. Biederman <hidden> Date: 2010-09-23 08:51:30
Take advantage of the new abstraction and allow network devices
to be placed in any network namespace that we have a fd to talk
about.
Signed-off-by: Eric W. Biederman <ebiederm-aS9lmoZGLiVWk0Htik3J/w@public.gmane.org>
---
include/linux/if_link.h | 1 +
include/net/net_namespace.h | 1 +
net/core/net_namespace.c | 26 ++++++++++++++++++++++++++
net/core/rtnetlink.c | 4 +++-
4 files changed, 31 insertions(+), 1 deletions(-)
@@ -114,6 +114,7 @@ static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns)externstructlist_headnet_namespace_list;externstructnet*get_net_ns_by_pid(pid_tpid);+externstructnet*get_net_ns_by_fd(intpid);#ifdef CONFIG_NET_NSexternvoid__put_net(structnet*net);
From: Eric Dumazet <hidden> Date: 2010-09-23 09:41:25
Le jeudi 23 septembre 2010 à 01:51 -0700, Eric W. Biederman a écrit :
quoted hunk
Take advantage of the new abstraction and allow network devices
to be placed in any network namespace that we have a fd to talk
about.
Signed-off-by: Eric W. Biederman <redacted>
---
include/linux/if_link.h | 1 +
include/net/net_namespace.h | 1 +
net/core/net_namespace.c | 26 ++++++++++++++++++++++++++
net/core/rtnetlink.c | 4 +++-
4 files changed, 31 insertions(+), 1 deletions(-)
@@ -114,6 +114,7 @@ static inline struct net *copy_net_ns(unsigned long flags, struct net *net_ns)externstructlist_headnet_namespace_list;externstructnet*get_net_ns_by_pid(pid_tpid);+externstructnet*get_net_ns_by_fd(intpid);#ifdef CONFIG_NET_NSexternvoid__put_net(structnet*net);
To unsubscribe from this list: send the line "unsubscribe netfilter-devel" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at http://vger.kernel.org/majordomo-info.html
From: David Lamparter <hidden> Date: 2010-09-23 14:58:56
On Thu, Sep 23, 2010 at 07:22:06AM -0400, jamal wrote:
On Thu, 2010-09-23 at 01:51 -0700, Eric W. Biederman wrote:
quoted
Take advantage of the new abstraction and allow network devices
to be placed in any network namespace that we have a fd to talk
about.
So ... why just netdevice? could you allow migration of other
net "items" eg a route table since they are all tagged by
netns?
migrating route table entries makes no sense because
a) they refer to devices and configuration that does not exist in the
target namespace; they only make sense within their netns context
b) they are purely virtual and you get the same result from deleting and
recreating them.
Network devices are special because they may have something attached to
them, be it hardware or some daemon.
-David
On Thu, 2010-09-23 at 16:58 +0200, David Lamparter wrote:
migrating route table entries makes no sense because
a) they refer to devices and configuration that does not exist in the
target namespace; they only make sense within their netns context
b) they are purely virtual and you get the same result from deleting and
recreating them.
Network devices are special because they may have something attached to
them, be it hardware or some daemon.
Routes functionally reside on top of netdevices, point to nexthop
neighbors across these netdevices etc. Underlying assumption is you take
care of that dependency when migrating.
We are talking about FIB entries here not the route cache; moving a few
pointers within the kernel is a hell lot faster than recreating a subset
of BGP entries from user space.
Eric, I didnt follow the exposed-races arguement: Why would it involve
more than just some basic locking only while you change the struct net
pointer to the new namespace for these sub-subsystems?
cheers,
jamal
From: David Lamparter <hidden> Date: 2010-09-24 12:57:21
On Fri, Sep 24, 2010 at 07:51:24AM -0400, jamal wrote:
quoted
migrating route table entries makes no sense because
a) they refer to devices and configuration that does not exist in the
target namespace; they only make sense within their netns context
b) they are purely virtual and you get the same result from deleting and
recreating them.
Network devices are special because they may have something attached to
them, be it hardware or some daemon.
Routes functionally reside on top of netdevices, point to nexthop
neighbors across these netdevices etc. Underlying assumption is you take
care of that dependency when migrating.
We are talking about FIB entries here not the route cache; moving a few
pointers within the kernel is a hell lot faster than recreating a subset
of BGP entries from user space.
No. While you sure could associate routes with devices, they don't
*functionally* reside on top of network devices. They reside on top of
the entire IP configuration, and in case of BGP they even reside on top
of your set of peerings and their data.
Even if you could "move" routes together with a network device, the
result would be utter nonsense. The routes depend on your BGP view, and
if your set of interfaces (and peers) changes, your routes will change.
Your bgpd will, either way, need to set up new peerings and redo best
path evaluations.
(On an unrelated note, how often are you planning to move stuff between
namespaces? I don't expect to be moving stuff except on configuration
events...)
-David
On Fri, 2010-09-24 at 14:57 +0200, David Lamparter wrote:
No. While you sure could associate routes with devices, they don't
*functionally* reside on top of network devices. They reside on top of
the entire IP configuration,
I think i am not clearly making my point. There are data dependencies;
If you were to move routes, youd need everything that routes depend on.
IOW, if i was to draw a functional graph, routes would appear on top
of netdevs (I dont care what other functional blocks you put in between
or sideways to them).
and in case of BGP they even reside on top
of your set of peerings and their data.
Even if you could "move" routes together with a network device, the
result would be utter nonsense.
You could argue that moving a netdevice where some of its fundamental
properties such as an ifindex change is utter nonsense. But you can
work around it.
The routes depend on your BGP view, and
if your set of interfaces (and peers) changes, your routes will change.
Your bgpd will, either way, need to set up new peerings and redo best
path evaluations.
Worst case scenario, yes. I am beginning to get a feeling we are trying
to achieve different goals maybe? Why are you even migrating netdevs?
(On an unrelated note, how often are you planning to move stuff between
namespaces? I don't expect to be moving stuff except on configuration
events...)
Triggering on config events is useful and it is likely the only
possibility if you assumed the other namespace is remote. But if could
send a single command to migrate several things in the kernel (in my
case to recover state to a different ns), then that is much simpler and
uses the least resources (memory, cpu, bandwidth). I admit it is very
hard to do in most cases where the underlying dependencies are evolving
and synchronizing via user space is the best approach. The example
of route table i pointed to is simple.
Besides that: dynamic state created in the kernel that doesnt have to be
recreated by the next arriving 100K packets helps to improve recovery.
cheers,
jamal
From: David Lamparter <hidden> Date: 2010-09-24 14:09:43
On Fri, Sep 24, 2010 at 09:32:53AM -0400, jamal wrote:
On Fri, 2010-09-24 at 14:57 +0200, David Lamparter wrote:
quoted
No. While you sure could associate routes with devices, they don't
*functionally* reside on top of network devices. They reside on top of
the entire IP configuration,
I think i am not clearly making my point. There are data dependencies;
If you were to move routes, youd need everything that routes depend on.
IOW, if i was to draw a functional graph, routes would appear on top
of netdevs (I dont care what other functional blocks you put in between
or sideways to them).
I understood your point. What I'm saying is that that functional graph
you're describing is too simplistic do be a workable model. Your graph
allows for what you're trying to do, yes. But your graph is not modeling
the reality.
quoted
The routes depend on your BGP view, and
if your set of interfaces (and peers) changes, your routes will change.
Your bgpd will, either way, need to set up new peerings and redo best
path evaluations.
Worst case scenario, yes. I am beginning to get a feeling we are trying
to achieve different goals maybe? Why are you even migrating netdevs?
Err... I'm migrating netdevs to assign them to namespaces to allow them
to use them? Setup, basically. Either way a device move only happens as
result of some administrative action; be it creating a new namespace or
changing the physical/logical network setup.
quoted
(On an unrelated note, how often are you planning to move stuff between
namespaces? I don't expect to be moving stuff except on configuration
events...)
Triggering on config events is useful and it is likely the only
possibility if you assumed the other namespace is remote.
wtf is a "remote" namespace?
But if could
send a single command to migrate several things in the kernel (in my
case to recover state to a different ns), then that is much simpler and
uses the least resources (memory, cpu, bandwidth). I admit it is very
hard to do in most cases where the underlying dependencies are evolving
and synchronizing via user space is the best approach. The example
of route table i pointed to is simple.
Besides that: dynamic state created in the kernel that doesnt have to be
recreated by the next arriving 100K packets helps to improve recovery.
Can you please describe your application that requires moving possibly
several network devices together with "their" routes to a different
namespace?
-David
On Fri, 2010-09-24 at 16:09 +0200, David Lamparter wrote:
I understood your point. What I'm saying is that that functional graph
you're describing is too simplistic do be a workable model. Your graph
allows for what you're trying to do, yes. But your graph is not modeling
the reality.
How about we put this specific point to rest by agreeing to
disagree? ;->
Err... I'm migrating netdevs to assign them to namespaces to allow them
to use them? Setup, basically. Either way a device move only happens as
result of some administrative action; be it creating a new namespace or
changing the physical/logical network setup.
Ok, different need. You have a much more basic requirement than i do.
wtf is a "remote" namespace?
A namespace that is remotely located on another machine/hardware ;->
Can you please describe your application that requires moving possibly
several network devices together with "their" routes to a different
namespace?
scaling and availability are the driving requirements.
cheers,
jamal