[Date Prev][Date Next][Thread Prev][Thread Next][Date Index][Thread Index]

Re: Small bug in the ingress qdisc?



I wrote:
> Untested patch for both problems for 2.4.0-test3-pre5 attached.

Same patch for 2.2.14-2.2.16, to be applied on top of the kernel patch
from ds-8. This one should also fix the dsmark_requeue problem NMM van
der Vlugt reported, ehm, more than four months ago ... sorry for the
awful RTT :-(

Also this patch is completely untested.

- Werner

---------------------------------- cut here -----------------------------------

--- ref/net/sched/sch_dsmark.c	Sat Jul  8 00:10:32 2000
+++ work/net/sched/sch_dsmark.c	Sat Jul  8 00:20:58 2000
@@ -267,10 +267,10 @@ static int dsmark_requeue(struct sk_buff
 
 	D2PRINTK("dsmark_requeue(skb %p,sch %p,[qdisc %p])\n",skb,sch,p);
 	if ((ret = p->q->ops->requeue(skb, p->q)) == 0) {
-		sch->q.qlen++;
-		return 1;
+		sch->stats.drops++;
+		return 0;
 	}
-	sch->stats.drops++;
+	sch->q.qlen++;
 	return ret;  
 
 }
--- ref/net/sched/sch_generic.c	Sat Jul  8 00:10:32 2000
+++ work/net/sched/sch_generic.c	Sat Jul  8 00:17:58 2000
@@ -456,11 +456,9 @@ void dev_shutdown(struct device *dev)
 	dev->qdisc = &noop_qdisc;
 	dev->qdisc_sleeping = &noop_qdisc;
 	qdisc_destroy(qdisc);
-#ifdef CONFIG_NET_SCH_INGRESS
-	if (dev->qdisc_ingress) {
-	qdisc = dev->qdisc_ingress;
-	qdisc_destroy(qdisc);
-	}
+#if defined(CONFIG_NET_SCH_INGRESS) || defined(CONFIG_NET_SCH_INGRESS_MODULE)
+	if (dev->qdisc_ingress)
+		qdisc_destroy(dev->qdisc_ingress);
 #endif
 	BUG_TRAP(dev->qdisc_list == NULL);
 	dev->qdisc_list = NULL;
--- ref/net/sched/sch_ingress.c	Sat Jul  8 00:10:32 2000
+++ work/net/sched/sch_ingress.c	Sat Jul  8 00:12:35 2000
@@ -140,9 +140,7 @@ static int ingress_enqueue(struct sk_buf
 #endif
 		}
 
-#ifdef CONFIG_NET_CLS_TCINDEX
-         skb->tc_index = TC_H_MIN(res.classid);
-#endif
+	skb->tc_index = TC_H_MIN(res.classid);
 
 	return result;
 }

-- 
  _________________________________________________________________________
 / Werner Almesberger, ICA, EPFL, CH       werner.almesberger@ica.epfl.ch /
/_IN_N_032__Tel_+41_21_693_6621__Fax_+41_21_693_6610_____________________/