patch-2.2.4 linux/net/sched/sch_fifo.c

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

diff -u --recursive --new-file v2.2.3/linux/net/sched/sch_fifo.c linux/net/sched/sch_fifo.c
@@ -97,10 +97,7 @@
 static void
 fifo_reset(struct Qdisc* sch)
 {
-	struct sk_buff *skb;
-
-	while ((skb=__skb_dequeue(&sch->q)) != NULL)
-		kfree_skb(skb);
+	skb_queue_purge(&sch->q);
 	sch->stats.backlog = 0;
 }
 
@@ -137,15 +134,15 @@
 	return __skb_dequeue(&sch->q);
 }
 
-
 static int fifo_init(struct Qdisc *sch, struct rtattr *opt)
 {
 	struct fifo_sched_data *q = (void*)sch->data;
 
 	if (opt == NULL) {
-		q->limit = sch->dev->tx_queue_len;
 		if (sch->ops == &bfifo_qdisc_ops)
-			q->limit *= sch->dev->mtu;
+			q->limit = sch->dev->tx_queue_len*sch->dev->mtu;
+		else	
+			q->limit = sch->dev->tx_queue_len;
 	} else {
 		struct tc_fifo_qopt *ctl = RTA_DATA(opt);
 		if (opt->rta_len < RTA_LENGTH(sizeof(*ctl)))
@@ -188,6 +185,8 @@
 	fifo_init,
 	fifo_reset,
 	NULL,
+	fifo_init,
+
 #ifdef CONFIG_RTNETLINK
 	fifo_dump,
 #endif
@@ -208,6 +207,7 @@
 	fifo_init,
 	fifo_reset,
 	NULL,
+	fifo_init,
 #ifdef CONFIG_RTNETLINK
 	fifo_dump,
 #endif

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