datapath: Disable TX on internal ports before removing.
authorBen Pfaff <blp@nicira.com>
Thu, 21 May 2009 18:18:34 +0000 (11:18 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 21 May 2009 18:18:34 +0000 (11:18 -0700)
This is a partial fix for a more pervasive problem, that destroying a
dp_dev races with its transmit work function (dp_dev_do_xmit) running.
A "better" and "correct" fix has been written, but unfortunately it seems
to be buggy and crash the system so far.

datapath/datapath.c

index fb28b39f2211ec5ad47ca8a77ed04ce6f43b1a21..8e9a5602054b179863ac96b53793aeb63de13f9d 100644 (file)
@@ -428,6 +428,13 @@ int dp_del_port(struct net_bridge_port *p, struct list_head *dp_devs)
 
        p->dp->n_ports--;
 
+       if (is_dp_dev(p->dev)) {
+               /* Make sure that no packets arrive from now on, since
+                * dp_dev_xmit() will try to find itself through
+                * p->dp->ports[], and we're about to set that to null. */
+               netif_tx_disable(p->dev);
+       }
+
        /* First drop references to device. */
        dev_set_promiscuity(p->dev, -1);
        list_del_rcu(&p->node);