patch-2.4.1 linux/net/sched/sch_gred.c

Next file: linux/net/sunrpc/auth.c
Previous file: linux/net/sched/sch_dsmark.c
Back to the patch index
Back to the overall index

diff -u --recursive --new-file v2.4.0/linux/net/sched/sch_gred.c linux/net/sched/sch_gred.c
@@ -110,12 +110,9 @@
 	unsigned long	qave=0;	
 	int i=0;
 
-	if (!t->initd) {
-		DPRINTK("NO GRED Queues setup yet! Enqueued anyway\n");
-		if (q->backlog <= q->limit) {
-			__skb_queue_tail(&sch->q, skb);
-			return NET_XMIT_DROP; /* @@@@ */
-		}
+	if (!t->initd && skb_queue_len(&sch->q) <= sch->dev->tx_queue_len) {
+		D2PRINTK("NO GRED Queues setup yet! Enqueued anyway\n");
+		goto do_enqueue;
 	}
 
 
@@ -179,11 +176,12 @@
 		q->qcount = -1;
 enqueue:
 		if (q->backlog <= q->limit) {
+			q->backlog += skb->len;
+do_enqueue:
 			__skb_queue_tail(&sch->q, skb);
 			sch->stats.backlog += skb->len;
 			sch->stats.bytes += skb->len;
 			sch->stats.packets++;
-			q->backlog += skb->len;
 			return 0;
 		} else {
 			q->pdrop++;

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