Mailing List Archive

Fix split of duties between close_netdev() and
# HG changeset patch
# User kaf24@firebug.cl.cam.ac.uk
# Node ID 572abc9efcf5dfcebc4ce3333dbe1ea245e1dd34
# Parent f26ae65f3f9594138f0c81b52a2471be3ce93370
Fix split of duties between close_netdev() and
netif_disconnect_backend() in netif driver.

Signed-off-by: Keir Fraser <keir@xensource.com>

diff -r f26ae65f3f95 -r 572abc9efcf5 linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c
--- a/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Wed Jan 4 11:37:27 2006
+++ b/linux-2.6-xen-sparse/drivers/xen/netfront/netfront.c Wed Jan 4 13:45:52 2006
@@ -1218,30 +1218,33 @@

static void close_netdev(struct netfront_info *info)
{
+ spin_lock_irq(&info->netdev->xmit_lock);
+ netif_stop_queue(info->netdev);
+ spin_unlock_irq(&info->netdev->xmit_lock);
+
+#ifdef CONFIG_PROC_FS
+ xennet_proc_delif(info->netdev);
+#endif
+
+ del_timer_sync(&info->rx_refill_timer);
+
+ unregister_netdev(info->netdev);
+}
+
+
+static void netif_disconnect_backend(struct netfront_info *info)
+{
/* Stop old i/f to prevent errors whilst we rebuild the state. */
spin_lock_irq(&info->tx_lock);
spin_lock(&info->rx_lock);
- netif_stop_queue(info->netdev);
- /* info->backend_state = BEST_DISCONNECTED; */
+ info->backend_state = BEST_DISCONNECTED;
spin_unlock(&info->rx_lock);
spin_unlock_irq(&info->tx_lock);
-
-#ifdef CONFIG_PROC_FS
- xennet_proc_delif(info->netdev);
-#endif

if (info->irq)
unbind_from_irqhandler(info->irq, info->netdev);
info->evtchn = info->irq = 0;

- del_timer_sync(&info->rx_refill_timer);
-
- unregister_netdev(info->netdev);
-}
-
-
-static void netif_disconnect_backend(struct netfront_info *info)
-{
end_access(info->tx_ring_ref, info->tx.sring);
end_access(info->rx_ring_ref, info->rx.sring);
info->tx_ring_ref = GRANT_INVALID_REF;

_______________________________________________
Xen-changelog mailing list
Xen-changelog@lists.xensource.com
http://lists.xensource.com/xen-changelog