patch-2.1.106 linux/net/sched/sch_teql.c

Next file: linux/net/unix/af_unix.c
Previous file: linux/net/sched/sch_cbq.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.1.105/linux/net/sched/sch_teql.c linux/net/sched/sch_teql.c
@@ -252,7 +252,7 @@
 		return 0;
 	}
 	neigh_release(n);
-	return (skb_res != NULL);
+	return (skb_res == NULL) ? -EAGAIN : 1;
 }
 
 static __inline__ int
@@ -280,7 +280,7 @@
 
 restart:
 	nores = 0;
-	busy = 1;
+	busy = 0;
 
 	if ((q = start) == NULL)
 		goto drop;
@@ -288,34 +288,39 @@
 	do {
 		struct device *slave = q->dev;
 		
-		if (!slave->tbusy && slave->qdisc_sleeping == q) {
-			busy = 0;
-			
-			if (q->h.forw == NULL) {
-				q->h.forw = qdisc_head.forw;
-				qdisc_head.forw = &q->h;
-			}
+		if (slave->qdisc_sleeping != q)
+			continue;
+		if (slave->tbusy) {
+			busy = 1;
+			continue;
+		}
 
-			switch (teql_resolve(skb, skb_res, slave)) {
-			case 0:
-				if (slave->hard_start_xmit(skb, slave) == 0) {
-					master->slaves = NEXT_SLAVE(q);
-					dev->tbusy = 0;
-					master->stats.tx_packets++;
-					master->stats.tx_bytes += len;
-					return 0;
-				}
-				break;
-			case 1:
+		if (q->h.forw == NULL) {
+			q->h.forw = qdisc_head.forw;
+			qdisc_head.forw = &q->h;
+		}
+
+		switch (teql_resolve(skb, skb_res, slave)) {
+		case 0:
+			if (slave->hard_start_xmit(skb, slave) == 0) {
 				master->slaves = NEXT_SLAVE(q);
 				dev->tbusy = 0;
-				return 0;
-			default:
-				nores = 1;
-				break;
+				master->stats.tx_packets++;
+				master->stats.tx_bytes += len;
+					return 0;
 			}
-			__skb_pull(skb, skb->nh.raw - skb->data);
+			if (dev->tbusy)
+				busy = 1;
+			break;
+		case 1:
+			master->slaves = NEXT_SLAVE(q);
+			dev->tbusy = 0;
+			return 0;
+		default:
+			nores = 1;
+			break;
 		}
+		__skb_pull(skb, skb->nh.raw - skb->data);
 	} while ((q = NEXT_SLAVE(q)) != start);
 
 	if (nores && skb_res == NULL) {

FUNET's LINUX-ADM group, linux-adm@nic.funet.fi
TCL-scripts by Sam Shen, slshen@lbl.gov