Skip to contentSkip to conversation

Fix uncleaned vif backend devices when frontend does not finish initialization properly

PATCH New Murillo Bernardes 1 participant 1 message Dec 27, 2005

lore
Share & tools
lore
#0 lore raw

PATCH 1/1 Fix uncleaned vif backend devices when frontend does not finish initialization properly

Today if frontend device does not finish initialization the backend vif still in dom0 forever. The problems are:

- netif_disconnect only clean up devices with connected status. When a device has a problem it will not have that status and will not be cleaned up.
- free_netif_callback must be able to unregister devices not completely initialized. Today's code test if it has an irq assigned, if not it just return. Before a complete initialization netif does not have an irq number.

Both situations occur today when trying to create more than 3 vif in a single domU.

This patch fix uncleaned vif backend devices when frontend does not finish initialization properly.

Comments welcome.

Signature · 2 lines
Murillo Fernandes Bernardes
IBM Linux Technology Center

# HG changeset patch
# User [email protected]
# Node ID c066abe3893a03e4b3697ac6c661271a5e9afae7 # Parent 829517be689f95d3d935ab1af17d0c31ee4950fc

Today if frontend device does not finish initialization the backend vif still in dom0 forever. The problems are:

- netif_disconnect only clean up devices with connected status. When a device has a problem it will not have that status and will not be cleaned up.
- free_netif_callback must be able to unregister devices not completely initialized. Today's code test if it has an irq assigned, if not it just return. Before a complete initialization netif does not have an irq number.

Both situations occur today when trying to create more than 3 vif in a single domU.

This patch fix uncleaned vif backend devices when frontend does not finish initialization properly.

linux-2.6-xen-sparse/drivers/xen/netback/interface.c +9 -6
diff -r 829517be689f -r c066abe3893a linux-2.6-xen-sparse/drivers/xen/netback/interface.c
@@ -248,12 +248,11 @@
 	netif_t *netif = (netif_t *)arg;
 
 	/* Already disconnected? */
-	if (!netif->irq)
-		return;
-
-	unbind_from_irqhandler(netif->irq, netif);
-	netif->irq = 0;
-
+	if (netif->irq) {
+		unbind_from_irqhandler(netif->irq, netif);
+		netif->irq = 0;
+	}
+	
 	unregister_netdev(netif->dev);
 
 	if (netif->tx.sring) {
@@ -303,6 +302,10 @@
 		netif_put(netif);
 		return 0; /* Caller should not send response message. */
 	}
+	else {
+		free_netif(netif);
+		return 0;
+	}
 
 	return 1;
 }

_______________________________________________
Xen-devel mailing list
[email protected]
http://lists.xensource.com/xen-devel