Skip to contentSkip to conversation

xen-netback: transition to CLOSED when removing a VIF

PATCH Applied David Vrabel 4 participants 11 messages Oct 7, 2013 – Oct 9, 2013

Subsystems (3)
lore
Share & tools
lore
#0 lore raw

PATCH 1/1 xen-netback: transition to CLOSED when removing a VIF

From: David Vrabel <[email protected]>

If a guest is destroyed without transitioning its frontend to CLOSED, the domain becomes a zombie as netback was not grant unmapping the shared rings.

When removing a VIF, transition the backend to CLOSED so the VIF is disconnected if necessary (which will unmap the shared rings etc).

This fixes a regression introduced by 279f438e36c0a70b23b86d2090aeec50155034a9 (xen-netback: Don't destroy the netdev until the vif is shut down).

Cc Ian Campbell <[email protected]>
Cc Wei Liu <[email protected]>
Cc Paul Durrant <[email protected]>
---
 drivers/net/xen-netback/xenbus.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/xen-netback/xenbus.c +4 -0
index b45bce2..1b08d87 100644
@@ -39,11 +39,15 @@ static int connect_rings(struct backend_info *);
 static void connect(struct backend_info *);
 static void backend_create_xenvif(struct backend_info *be);
 static void unregister_hotplug_status_watch(struct backend_info *be);
+static void set_backend_state(struct backend_info *be,
+			      enum xenbus_state state);
 
 static int netback_remove(struct xenbus_device *dev)
 {
 	struct backend_info *be = dev_get_drvdata(&dev->dev);
 
+	set_backend_state(be, XenbusStateClosed);
+
 	unregister_hotplug_status_watch(be);
 	if (be->vif) {
 		kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
Signature · 1 line
1.7.2.5
#1 lore raw
Quoted 6 lines · David Vrabel

From: David Vrabel <[email protected]>

If a guest is destroyed without transitioning its frontend to CLOSED, the domain becomes a zombie as netback was not grant unmapping the shared rings.

Quoted 7 lines

When removing a VIF, transition the backend to CLOSED so the VIF is disconnected if necessary (which will unmap the shared rings etc).

This fixes a regression introduced by 279f438e36c0a70b23b86d2090aeec50155034a9 (xen-netback: Don't destroy the netdev until the vif is shut down).

Is this regression solely caused by 279f438e36c or caused by both ea732dff5c and 279f438e36c? I ask because you make use of the new state machine introduced in ea732dff5c. Or are you simply using the new state machine to fix the regression instead of going back to old code?

Wei.

Quoted 30 lines
Cc Ian Campbell <[email protected]>
Cc Wei Liu <[email protected]>
Cc Paul Durrant <[email protected]>
---
 drivers/net/xen-netback/xenbus.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/xen-netback/xenbus.c +4 -0
index b45bce2..1b08d87 100644
@@ -39,11 +39,15 @@ static int connect_rings(struct backend_info *);
 static void connect(struct backend_info *);
 static void backend_create_xenvif(struct backend_info *be);
 static void unregister_hotplug_status_watch(struct backend_info *be);
+static void set_backend_state(struct backend_info *be,
+			      enum xenbus_state state);
 
 static int netback_remove(struct xenbus_device *dev)
 {
 	struct backend_info *be = dev_get_drvdata(&dev->dev);
 
+	set_backend_state(be, XenbusStateClosed);
+
 	unregister_hotplug_status_watch(be);
 	if (be->vif) {
 		kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
Signature · 1 line
1.7.2.5
#2 lore raw
In reply to David Vrabel
Quoted 6 lines · David Vrabel

From: David Vrabel <[email protected]>

If a guest is destroyed without transitioning its frontend to CLOSED, the domain becomes a zombie as netback was not grant unmapping the shared rings.

Quoted 7 lines

When removing a VIF, transition the backend to CLOSED so the VIF is disconnected if necessary (which will unmap the shared rings etc).

This fixes a regression introduced by 279f438e36c0a70b23b86d2090aeec50155034a9 (xen-netback: Don't destroy the netdev until the vif is shut down).

Is this regression solely caused by 279f438e36c or caused by both ea732dff5c and 279f438e36c? I ask because you make use of the new state machine introduced in ea732dff5c. Or are you simply using the new state machine to fix the regression instead of going back to old code?

Wei.

Quoted 30 lines
Cc Ian Campbell <[email protected]>
Cc Wei Liu <[email protected]>
Cc Paul Durrant <[email protected]>
---
 drivers/net/xen-netback/xenbus.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/xen-netback/xenbus.c +4 -0
index b45bce2..1b08d87 100644
@@ -39,11 +39,15 @@ static int connect_rings(struct backend_info *);
 static void connect(struct backend_info *);
 static void backend_create_xenvif(struct backend_info *be);
 static void unregister_hotplug_status_watch(struct backend_info *be);
+static void set_backend_state(struct backend_info *be,
+			      enum xenbus_state state);
 
 static int netback_remove(struct xenbus_device *dev)
 {
 	struct backend_info *be = dev_get_drvdata(&dev->dev);
 
+	set_backend_state(be, XenbusStateClosed);
+
 	unregister_hotplug_status_watch(be);
 	if (be->vif) {
 		kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
Signature · 1 line
1.7.2.5
#3 lore raw
Quoted 15 lines · Wei Liu
Quoted 6 lines · David Vrabel

From: David Vrabel <[email protected]>

If a guest is destroyed without transitioning its frontend to CLOSED, the domain becomes a zombie as netback was not grant unmapping the shared rings.

Quoted 7 lines

When removing a VIF, transition the backend to CLOSED so the VIF is disconnected if necessary (which will unmap the shared rings etc).

This fixes a regression introduced by 279f438e36c0a70b23b86d2090aeec50155034a9 (xen-netback: Don't destroy the netdev until the vif is shut down).

Quoted 4 lines

Is this regression solely caused by 279f438e36c or caused by both ea732dff5c and 279f438e36c? I ask because you make use of the new state machine introduced in ea732dff5c. Or are you simply using the new state machine to fix the regression instead of going back to old code?

I bisected it to 279f438. I'm just using the handy new state machine to fix it.

David

#4 lore raw
In reply to Wei Liu
Quoted 15 lines · Wei Liu
Quoted 6 lines · David Vrabel

From: David Vrabel <[email protected]>

If a guest is destroyed without transitioning its frontend to CLOSED, the domain becomes a zombie as netback was not grant unmapping the shared rings.

Quoted 7 lines

When removing a VIF, transition the backend to CLOSED so the VIF is disconnected if necessary (which will unmap the shared rings etc).

This fixes a regression introduced by 279f438e36c0a70b23b86d2090aeec50155034a9 (xen-netback: Don't destroy the netdev until the vif is shut down).

Quoted 4 lines

Is this regression solely caused by 279f438e36c or caused by both ea732dff5c and 279f438e36c? I ask because you make use of the new state machine introduced in ea732dff5c. Or are you simply using the new state machine to fix the regression instead of going back to old code?

I bisected it to 279f438. I'm just using the handy new state machine to fix it.

David

Acked-by
#5 lore raw
Quoted 16 lines · David Vrabel
Quoted 15 lines · Wei Liu
Quoted 13 lines · David Vrabel

From: David Vrabel <[email protected]>

If a guest is destroyed without transitioning its frontend to CLOSED, the domain becomes a zombie as netback was not grant unmapping the shared rings.

When removing a VIF, transition the backend to CLOSED so the VIF is disconnected if necessary (which will unmap the shared rings etc).

This fixes a regression introduced by 279f438e36c0a70b23b86d2090aeec50155034a9 (xen-netback: Don't destroy the netdev until the vif is shut down).

Quoted 8 lines
Quoted 4 lines

Is this regression solely caused by 279f438e36c or caused by both ea732dff5c and 279f438e36c? I ask because you make use of the new state machine introduced in ea732dff5c. Or are you simply using the new state machine to fix the regression instead of going back to old code?

I bisected it to 279f438. I'm just using the handy new state machine to fix it.

Thanks for the explanation.

Wei.

Quoted 1 line

David

Acked-by
#6 lore raw
In reply to David Vrabel
Quoted 16 lines · David Vrabel
Quoted 15 lines · Wei Liu
Quoted 13 lines · David Vrabel

From: David Vrabel <[email protected]>

If a guest is destroyed without transitioning its frontend to CLOSED, the domain becomes a zombie as netback was not grant unmapping the shared rings.

When removing a VIF, transition the backend to CLOSED so the VIF is disconnected if necessary (which will unmap the shared rings etc).

This fixes a regression introduced by 279f438e36c0a70b23b86d2090aeec50155034a9 (xen-netback: Don't destroy the netdev until the vif is shut down).

Quoted 8 lines
Quoted 4 lines

Is this regression solely caused by 279f438e36c or caused by both ea732dff5c and 279f438e36c? I ask because you make use of the new state machine introduced in ea732dff5c. Or are you simply using the new state machine to fix the regression instead of going back to old code?

I bisected it to 279f438. I'm just using the handy new state machine to fix it.

Thanks for the explanation.

Wei.

Quoted 1 line

David

Reviewed-by on v1 1/1
#7 lore raw
In reply to David Vrabel
Quoted 52 lines

-----Original Message-----
From: David Vrabel [mailto:[email protected]]
Sent: 07 October 2013 13:55
To: [email protected]
Cc: David Vrabel; Konrad Rzeszutek Wilk; Boris Ostrovsky; [email protected]; Ian Campbell; Wei Liu; Paul Durrant
Subject: [PATCHv1 net] xen-netback: transition to CLOSED when removing a VIF

From: David Vrabel <[email protected]>

If a guest is destroyed without transitioning its frontend to CLOSED, the domain becomes a zombie as netback was not grant unmapping the shared rings.

When removing a VIF, transition the backend to CLOSED so the VIF is disconnected if necessary (which will unmap the shared rings etc).

This fixes a regression introduced by 279f438e36c0a70b23b86d2090aeec50155034a9 (xen-netback: Don't destroy the netdev until the vif is shut down).

Cc Ian Campbell <[email protected]>
Cc Wei Liu <[email protected]>
Cc Paul Durrant <[email protected]>
---
 drivers/net/xen-netback/xenbus.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/xen- renamed from drivers/net/xen-netback/xenbus.c +0 -0

netback/xenbus.c
index b45bce2..1b08d87 100644

drivers/net/xen-netback/xenbus.c +4 -1
@@ -39,11 +39,15 @@ static int connect_rings(struct backend_info *);
 static void connect(struct backend_info *);
 static void backend_create_xenvif(struct backend_info *be);
 static void unregister_hotplug_status_watch(struct backend_info *be);
+static void set_backend_state(struct backend_info *be,
+			      enum xenbus_state state);
 
 static int netback_remove(struct xenbus_device *dev)
 {
 	struct backend_info *be = dev_get_drvdata(&dev->dev);
 
+	set_backend_state(be, XenbusStateClosed);
+
 	unregister_hotplug_status_watch(be);
 	if (be->vif) {
 		kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
--
Quoted 1 line

1.7.2.5

Looks good to me.

Paul

Reviewed-by on v1 1/1
#8 lore raw
In reply to David Vrabel
Quoted 52 lines

-----Original Message-----
From: David Vrabel [mailto:[email protected]]
Sent: 07 October 2013 13:55
To: [email protected]
Cc: David Vrabel; Konrad Rzeszutek Wilk; Boris Ostrovsky; [email protected]; Ian Campbell; Wei Liu; Paul Durrant
Subject: [PATCHv1 net] xen-netback: transition to CLOSED when removing a VIF

From: David Vrabel <[email protected]>

If a guest is destroyed without transitioning its frontend to CLOSED, the domain becomes a zombie as netback was not grant unmapping the shared rings.

When removing a VIF, transition the backend to CLOSED so the VIF is disconnected if necessary (which will unmap the shared rings etc).

This fixes a regression introduced by 279f438e36c0a70b23b86d2090aeec50155034a9 (xen-netback: Don't destroy the netdev until the vif is shut down).

Cc Ian Campbell <[email protected]>
Cc Wei Liu <[email protected]>
Cc Paul Durrant <[email protected]>
---
 drivers/net/xen-netback/xenbus.c |    4 ++++
 1 files changed, 4 insertions(+), 0 deletions(-)
drivers/net/xen- renamed from drivers/net/xen-netback/xenbus.c +0 -0

netback/xenbus.c
index b45bce2..1b08d87 100644

drivers/net/xen-netback/xenbus.c +4 -1
@@ -39,11 +39,15 @@ static int connect_rings(struct backend_info *);
 static void connect(struct backend_info *);
 static void backend_create_xenvif(struct backend_info *be);
 static void unregister_hotplug_status_watch(struct backend_info *be);
+static void set_backend_state(struct backend_info *be,
+			      enum xenbus_state state);
 
 static int netback_remove(struct xenbus_device *dev)
 {
 	struct backend_info *be = dev_get_drvdata(&dev->dev);
 
+	set_backend_state(be, XenbusStateClosed);
+
 	unregister_hotplug_status_watch(be);
 	if (be->vif) {
 		kobject_uevent(&dev->dev.kobj, KOBJ_OFFLINE);
--
Quoted 1 line

1.7.2.5

Looks good to me.

Paul

maintainer Applied
#9 lore raw
In reply to David Vrabel

From: David Vrabel <[email protected]>
Date: Mon, 7 Oct 2013 13:55:19 +0100

Quoted 6 lines

From: David Vrabel <[email protected]>

If a guest is destroyed without transitioning its frontend to CLOSED, the domain becomes a zombie as netback was not grant unmapping the shared rings.

Quoted 8 lines

When removing a VIF, transition the backend to CLOSED so the VIF is disconnected if necessary (which will unmap the shared rings etc).

This fixes a regression introduced by 279f438e36c0a70b23b86d2090aeec50155034a9 (xen-netback: Don't destroy the netdev until the vif is shut down).

Applied, thanks.

maintainer Applied
#10 lore raw
In reply to David Vrabel

From: David Vrabel <[email protected]>
Date: Mon, 7 Oct 2013 13:55:19 +0100

Quoted 6 lines

From: David Vrabel <[email protected]>

If a guest is destroyed without transitioning its frontend to CLOSED, the domain becomes a zombie as netback was not grant unmapping the shared rings.

Quoted 8 lines

When removing a VIF, transition the backend to CLOSED so the VIF is disconnected if necessary (which will unmap the shared rings etc).

This fixes a regression introduced by 279f438e36c0a70b23b86d2090aeec50155034a9 (xen-netback: Don't destroy the netdev until the vif is shut down).

Applied, thanks.