From c530182b203fedb926f6ca1c4fa7235c7e37c380 Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Thu, 21 May 2009 11:18:34 -0700 Subject: [PATCH] datapath: Disable TX on internal ports before removing. 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 | 7 +++++++ 1 file changed, 7 insertions(+) diff --git a/datapath/datapath.c b/datapath/datapath.c index fb28b39f..8e9a5602 100644 --- a/datapath/datapath.c +++ b/datapath/datapath.c @@ -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); -- 2.30.2