patch-2.3.4 linux/net/sched/sch_generic.c

Next file: linux/net/socket.c
Previous file: linux/net/sched/sch_api.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.3.3/linux/net/sched/sch_generic.c linux/net/sched/sch_generic.c
@@ -96,8 +96,10 @@
 		struct Qdisc *q = (struct Qdisc*)h;
 		struct device *dev = q->dev;
 
+		spin_lock_bh(&dev->xmit_lock);
 		while (!dev->tbusy && (res = qdisc_restart(dev)) < 0)
 			/* NOTHING */;
+		spin_unlock_bh(&dev->xmit_lock);
 
 		/* An explanation is necessary here.
 		   qdisc_restart called dev->hard_start_xmit,
@@ -131,8 +133,11 @@
 	for (h = qdisc_head.forw; h != &qdisc_head; h = h->forw) {
 		struct Qdisc *q = (struct Qdisc*)h;
 		struct device *dev = q->dev;
+
+		spin_lock_bh(&dev->xmit_lock);
 		if (dev->tbusy && jiffies - q->tx_last > q->tx_timeo)
 			qdisc_restart(dev);
+		spin_unlock_bh(&dev->xmit_lock);
 	}
 	dev_watchdog.expires = jiffies + 5*HZ;
 	add_timer(&dev_watchdog);

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen (who was at: slshen@lbl.gov)