Markus Rehbach wrote:
Hi all,
I tested the netem queuing discipline and everything worked except the
reordering of packets. The kernel freezes. This happened with kernel version
2.6.8.1 (with Ingo Molnars voluntary preempt patch -P9) and 2.6.9-rc4-mm1,
thats why I assume that the netem module is the reason for the freezes.
Could anyone test whether the command below will result in a kernel freeze:
'tc qdisc add dev eth0 root netem delay 10ms gap 5'
(or in 2.6.8 syntax 'tc qdisc add dev eth0 root netem latency 10ms gap 5')
If there is anything I can do, please let me know.
Should be fixed by this patch. Non-delayed packet enqueues don't
increase q.qlen, but it is decreased at dequeue, so q.qlen becomes
negative (actually, qlen is unsigned, but qdisc_restart returns
(int)q.qlen) and the device is constantly beeing dequeued from
qdisc_run.
Regards
Patrick
# This is a BitKeeper generated diff -Nru style patch.
#
# ChangeSet
# 2004/10/18 23:42:47+02:00 kaber@coreworks.de
# [PKT_SCHED]: Fix netem qlen accounting
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
# net/sched/sch_netem.c
# 2004/10/18 23:42:13+02:00 kaber@coreworks.de +6 -2
# [PKT_SCHED]: Fix netem qlen accounting
#
# Signed-off-by: Patrick McHardy <kaber@trash.net>
#
diff -Nru a/net/sched/sch_netem.c b/net/sched/sch_netem.c
--- a/net/sched/sch_netem.c 2004-10-18 23:43:36 +02:00
+++ b/net/sched/sch_netem.c 2004-10-18 23:43:36 +02:00
@@ -195,7 +195,11 @@
++q->counter;
ret = q->qdisc->enqueue(skb, q->qdisc);
- if (ret)
+ if (likely(ret == NET_XMIT_SUCCESS)) {
+ sch->q.qlen++;
+ sch->stats.bytes += skb->len;
+ sch->stats.packets++;
+ } else
sch->stats.drops++;
return ret;
}
@@ -487,7 +491,7 @@
sch_tree_lock(sch);
*old = xchg(&q->qdisc, new);
qdisc_reset(*old);
- sch->q.qlen = 0;
+ sch->q.qlen = q->delayed.qlen;
sch_tree_unlock(sch);
return 0;