* [PATCH] Skip down interfaces (v2)
@ 2010-03-31 16:23 Dan Smith
[not found] ` <1270052634-8170-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
0 siblings, 1 reply; 7+ messages in thread
From: Dan Smith @ 2010-03-31 16:23 UTC (permalink / raw)
To: containers-qjLDD68F18O7TbgM5vRIOg
This makes the netns checkpoint code skip interfaces that are not up.
Later, we want to make it possible to checkpoint down interfaces with
a flag, but for now this helps prevent people from getting stuck on
stock kernels with various unsupported and persistent virtual interfaces,
such as tunnel devices.
Changes in v2:
- Fix logic to only skip down interfaces if they're not supported
Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Acked-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
---
net/checkpoint_dev.c | 11 ++++++++++-
1 files changed, 10 insertions(+), 1 deletions(-)
diff --git a/net/checkpoint_dev.c b/net/checkpoint_dev.c
index bc0415d..e8d574c 100644
--- a/net/checkpoint_dev.c
+++ b/net/checkpoint_dev.c
@@ -268,7 +268,16 @@ int checkpoint_netns(struct ckpt_ctx *ctx, void *ptr)
goto out;
for_each_netdev(net, dev) {
- ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV);
+ if (dev->netdev_ops->ndo_checkpoint)
+ ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV);
+ else if (dev->flags & IFF_UP)
+ ret = -ENOSYS;
+ else
+ /* TODO: There should be a flag to attempt a
+ * checkpoint of downed interfaces, regardless
+ * of whether they support checkpoint or not.
+ */
+ ret = 0;
if (ret < 0)
break;
}
--
1.6.2.5
^ permalink raw reply related [flat|nested] 7+ messages in thread
* Re: [PATCH] Skip down interfaces (v2)
[not found] ` <1270052634-8170-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
@ 2010-03-31 16:50 ` Serge E. Hallyn
2010-04-01 4:43 ` Oren Laadan
` (2 subsequent siblings)
3 siblings, 0 replies; 7+ messages in thread
From: Serge E. Hallyn @ 2010-03-31 16:50 UTC (permalink / raw)
To: Dan Smith; +Cc: containers-qjLDD68F18O7TbgM5vRIOg
Quoting Dan Smith (danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org):
> This makes the netns checkpoint code skip interfaces that are not up.
> Later, we want to make it possible to checkpoint down interfaces with
> a flag, but for now this helps prevent people from getting stuck on
> stock kernels with various unsupported and persistent virtual interfaces,
> such as tunnel devices.
>
> Changes in v2:
> - Fix logic to only skip down interfaces if they're not supported
>
> Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> Acked-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
Looks good, thanks.
Tested-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
-serge
> ---
> net/checkpoint_dev.c | 11 ++++++++++-
> 1 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/net/checkpoint_dev.c b/net/checkpoint_dev.c
> index bc0415d..e8d574c 100644
> --- a/net/checkpoint_dev.c
> +++ b/net/checkpoint_dev.c
> @@ -268,7 +268,16 @@ int checkpoint_netns(struct ckpt_ctx *ctx, void *ptr)
> goto out;
>
> for_each_netdev(net, dev) {
> - ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV);
> + if (dev->netdev_ops->ndo_checkpoint)
> + ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV);
> + else if (dev->flags & IFF_UP)
> + ret = -ENOSYS;
> + else
> + /* TODO: There should be a flag to attempt a
> + * checkpoint of downed interfaces, regardless
> + * of whether they support checkpoint or not.
> + */
> + ret = 0;
> if (ret < 0)
> break;
> }
> --
> 1.6.2.5
>
> _______________________________________________
> Containers mailing list
> Containers-cunTk1MwBs9QetFLy7KEm3xJsTq8ys+cHZ5vskTnxNA@public.gmane.org
> https://lists.linux-foundation.org/mailman/listinfo/containers
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Skip down interfaces (v2)
[not found] ` <1270052634-8170-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-31 16:50 ` Serge E. Hallyn
@ 2010-04-01 4:43 ` Oren Laadan
2010-04-01 4:45 ` Oren Laadan
2010-04-01 15:22 ` Brian Haley
3 siblings, 0 replies; 7+ messages in thread
From: Oren Laadan @ 2010-04-01 4:43 UTC (permalink / raw)
To: Dan Smith; +Cc: containers-qjLDD68F18O7TbgM5vRIOg
Acked and pulled for v21-rc2, thanks.
Dan Smith wrote:
> This makes the netns checkpoint code skip interfaces that are not up.
> Later, we want to make it possible to checkpoint down interfaces with
> a flag, but for now this helps prevent people from getting stuck on
> stock kernels with various unsupported and persistent virtual interfaces,
> such as tunnel devices.
>
> Changes in v2:
> - Fix logic to only skip down interfaces if they're not supported
>
> Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> Acked-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> ---
> net/checkpoint_dev.c | 11 ++++++++++-
> 1 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/net/checkpoint_dev.c b/net/checkpoint_dev.c
> index bc0415d..e8d574c 100644
> --- a/net/checkpoint_dev.c
> +++ b/net/checkpoint_dev.c
> @@ -268,7 +268,16 @@ int checkpoint_netns(struct ckpt_ctx *ctx, void *ptr)
> goto out;
>
> for_each_netdev(net, dev) {
> - ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV);
> + if (dev->netdev_ops->ndo_checkpoint)
> + ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV);
> + else if (dev->flags & IFF_UP)
> + ret = -ENOSYS;
> + else
> + /* TODO: There should be a flag to attempt a
> + * checkpoint of downed interfaces, regardless
> + * of whether they support checkpoint or not.
> + */
> + ret = 0;
> if (ret < 0)
> break;
> }
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Skip down interfaces (v2)
[not found] ` <1270052634-8170-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-31 16:50 ` Serge E. Hallyn
2010-04-01 4:43 ` Oren Laadan
@ 2010-04-01 4:45 ` Oren Laadan
2010-04-01 15:22 ` Brian Haley
3 siblings, 0 replies; 7+ messages in thread
From: Oren Laadan @ 2010-04-01 4:45 UTC (permalink / raw)
To: Dan Smith; +Cc: containers-qjLDD68F18O7TbgM5vRIOg
Acked and pulled for v21-rc2, thanks.
Dan Smith wrote:
> This makes the netns checkpoint code skip interfaces that are not up.
> Later, we want to make it possible to checkpoint down interfaces with
> a flag, but for now this helps prevent people from getting stuck on
> stock kernels with various unsupported and persistent virtual interfaces,
> such as tunnel devices.
>
> Changes in v2:
> - Fix logic to only skip down interfaces if they're not supported
>
> Signed-off-by: Dan Smith <danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> Acked-by: Serge Hallyn <serue-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
> ---
> net/checkpoint_dev.c | 11 ++++++++++-
> 1 files changed, 10 insertions(+), 1 deletions(-)
>
> diff --git a/net/checkpoint_dev.c b/net/checkpoint_dev.c
> index bc0415d..e8d574c 100644
> --- a/net/checkpoint_dev.c
> +++ b/net/checkpoint_dev.c
> @@ -268,7 +268,16 @@ int checkpoint_netns(struct ckpt_ctx *ctx, void *ptr)
> goto out;
>
> for_each_netdev(net, dev) {
> - ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV);
> + if (dev->netdev_ops->ndo_checkpoint)
> + ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV);
> + else if (dev->flags & IFF_UP)
> + ret = -ENOSYS;
> + else
> + /* TODO: There should be a flag to attempt a
> + * checkpoint of downed interfaces, regardless
> + * of whether they support checkpoint or not.
> + */
> + ret = 0;
> if (ret < 0)
> break;
> }
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Skip down interfaces (v2)
[not found] ` <1270052634-8170-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
` (2 preceding siblings ...)
2010-04-01 4:45 ` Oren Laadan
@ 2010-04-01 15:22 ` Brian Haley
[not found] ` <4BB4BA26.1050707-VXdhtT5mjnY@public.gmane.org>
3 siblings, 1 reply; 7+ messages in thread
From: Brian Haley @ 2010-04-01 15:22 UTC (permalink / raw)
To: Dan Smith; +Cc: containers-qjLDD68F18O7TbgM5vRIOg
Dan Smith wrote:
> This makes the netns checkpoint code skip interfaces that are not up.
> Later, we want to make it possible to checkpoint down interfaces with
> a flag, but for now this helps prevent people from getting stuck on
> stock kernels with various unsupported and persistent virtual interfaces,
> such as tunnel devices.
But devices that are not IFF_UP can still have addresses associated
with them, wouldn't this cause those addresses to not be
checkpointed?
-Brian
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Skip down interfaces (v2)
[not found] ` <4BB4BA26.1050707-VXdhtT5mjnY@public.gmane.org>
@ 2010-04-01 15:37 ` Serge E. Hallyn
2010-04-01 15:49 ` Dan Smith
1 sibling, 0 replies; 7+ messages in thread
From: Serge E. Hallyn @ 2010-04-01 15:37 UTC (permalink / raw)
To: Brian Haley; +Cc: containers-qjLDD68F18O7TbgM5vRIOg, Dan Smith
Quoting Brian Haley (brian.haley-VXdhtT5mjnY@public.gmane.org):
> Dan Smith wrote:
> > This makes the netns checkpoint code skip interfaces that are not up.
> > Later, we want to make it possible to checkpoint down interfaces with
> > a flag, but for now this helps prevent people from getting stuck on
> > stock kernels with various unsupported and persistent virtual interfaces,
> > such as tunnel devices.
>
> But devices that are not IFF_UP can still have addresses associated
> with them, wouldn't this cause those addresses to not be
> checkpointed?
Only if it's a device that wouldn't have supported checkpoint anyway.
So if veth0 is down, it'll be checkpointed. If tunl0 is up, checkpoint
will be refused. But if tunl0 is down, then it'll just be ignored.
The container didn't want that jerk around anyway, it just couldn't
get rid of it.
-serge
^ permalink raw reply [flat|nested] 7+ messages in thread
* Re: [PATCH] Skip down interfaces (v2)
[not found] ` <4BB4BA26.1050707-VXdhtT5mjnY@public.gmane.org>
2010-04-01 15:37 ` Serge E. Hallyn
@ 2010-04-01 15:49 ` Dan Smith
1 sibling, 0 replies; 7+ messages in thread
From: Dan Smith @ 2010-04-01 15:49 UTC (permalink / raw)
To: Brian Haley; +Cc: containers-qjLDD68F18O7TbgM5vRIOg
BH> But devices that are not IFF_UP can still have addresses
BH> associated with them, wouldn't this cause those addresses to not
BH> be checkpointed?
Yes. This was discussed on IRC a bit as being a reasonable
compromise. Right now, there are several pernet devices that could
show up in a new network namespace that will prevent a checkpoint from
completing. Since you can't easily, and at runtime, get rid of these
devices without recompiling the kernel, you're kinda stuck. So, we
discussed this as something that will let you out of that situation
for interfaces that are down.
We could, I suppose, inspect the interfaces a bit to see if they have
any addresses configured before we agree to skip them. However, that
could falsely trigger a failure because of autoconf addresses, I would
think.
The plan is to have a "strict mode" flag that will attempt to
checkpoint and fail on down but unsupported interfaces to make sure we
don't save an inaccurate representation of the netns that the
application is in.
--
Dan Smith
IBM Linux Technology Center
email: danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org
^ permalink raw reply [flat|nested] 7+ messages in thread
end of thread, other threads:[~2010-04-01 15:49 UTC | newest]
Thread overview: 7+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2010-03-31 16:23 [PATCH] Skip down interfaces (v2) Dan Smith
[not found] ` <1270052634-8170-1-git-send-email-danms-r/Jw6+rmf7HQT0dZR+AlfA@public.gmane.org>
2010-03-31 16:50 ` Serge E. Hallyn
2010-04-01 4:43 ` Oren Laadan
2010-04-01 4:45 ` Oren Laadan
2010-04-01 15:22 ` Brian Haley
[not found] ` <4BB4BA26.1050707-VXdhtT5mjnY@public.gmane.org>
2010-04-01 15:37 ` Serge E. Hallyn
2010-04-01 15:49 ` Dan Smith
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.