Skip to contentSkip to conversation

Skip down interfaces

PATCH In review Dan Smith 2 participants 3 messages Mar 31, 2010 2 messages not in the archive Networking

lore
Share & tools
lore

Dan Smith

author
#0 lore raw

PATCH 1/1 Skip down interfaces

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.

---
 net/checkpoint_dev.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
net/checkpoint_dev.c +7 -1
index bc0415d..1e053f9 100644
@@ -268,7 +268,13 @@ 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->flags & IFF_UP)
+			ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV);
+		else
+			/* TODO: There should be a flag to enable checkpoint
+			 * of downed interfaces
+			 */
+			ret = 0;
 		if (ret < 0)
 			break;
 	}
Signature · 1 line
1.6.2.5

A message that is not in the archive (sent off-list or not yet received): 1270047686-28404-1-git-send-email-danms-r/[email protected]

Acked-by Tested-by
#2 lore raw
Quoted 7 lines · Dan Smith

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.

Now this really is only a problem for devices which use register_pernet_device() right? Could/should we add a flag to such devices, and only skip those when they're down?

Or, can we detect whether the device has a checkpoint operation, checkpoint it if so regardless, and, if not, if it is down, skip it?

Mind you if noone minds this patch (for now) then it works for me.

thanks,
-serge

Quoted 26 lines
---
 net/checkpoint_dev.c |    8 +++++++-
 1 files changed, 7 insertions(+), 1 deletions(-)
net/checkpoint_dev.c +7 -1
index bc0415d..1e053f9 100644
@@ -268,7 +268,13 @@ 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->flags & IFF_UP)
+			ret = checkpoint_obj(ctx, dev, CKPT_OBJ_NETDEV);
+		else
+			/* TODO: There should be a flag to enable checkpoint
+			 * of downed interfaces
+			 */
+			ret = 0;
 		if (ret < 0)
 			break;
 	}
Signature · 1 line
1.6.2.5

A message that is not in the archive (sent off-list or not yet received): 20100331161353.GA15339-r/[email protected]

author
#4 lore raw

SH> Or, can we detect whether the device has a checkpoint operation, SH> checkpoint it if so regardless, and, if not, if it is down, skip SH> it?

Oh, you know what... I originally had it so that it only skips interfaces that are down *and* unsupported. However, I swizzled it after that and didn't preserve that logic.

Let me re-swizzle and I'll post again.

Signature · 3 lines
Dan Smith
IBM Linux Technology Center
email: danms-r/[email protected]