aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_netem.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_netem.c')
-rw-r--r--net/sched/sch_netem.c10
1 files changed, 4 insertions, 6 deletions
diff --git a/net/sched/sch_netem.c b/net/sched/sch_netem.c
index 0441876aa1e7..79542af9dab1 100644
--- a/net/sched/sch_netem.c
+++ b/net/sched/sch_netem.c
@@ -287,13 +287,10 @@ static struct sk_buff *netem_dequeue(struct Qdisc *sch)
287 psched_tdiff_t delay = PSCHED_TDIFF(cb->time_to_send, now); 287 psched_tdiff_t delay = PSCHED_TDIFF(cb->time_to_send, now);
288 288
289 if (q->qdisc->ops->requeue(skb, q->qdisc) != NET_XMIT_SUCCESS) { 289 if (q->qdisc->ops->requeue(skb, q->qdisc) != NET_XMIT_SUCCESS) {
290 qdisc_tree_decrease_qlen(q->qdisc, 1);
290 sch->qstats.drops++; 291 sch->qstats.drops++;
291
292 /* After this qlen is confused */
293 printk(KERN_ERR "netem: queue discpline %s could not requeue\n", 292 printk(KERN_ERR "netem: queue discpline %s could not requeue\n",
294 q->qdisc->ops->id); 293 q->qdisc->ops->id);
295
296 sch->q.qlen--;
297 } 294 }
298 295
299 mod_timer(&q->timer, jiffies + PSCHED_US2JIFFIE(delay)); 296 mod_timer(&q->timer, jiffies + PSCHED_US2JIFFIE(delay));
@@ -574,7 +571,8 @@ static int netem_init(struct Qdisc *sch, struct rtattr *opt)
574 q->timer.function = netem_watchdog; 571 q->timer.function = netem_watchdog;
575 q->timer.data = (unsigned long) sch; 572 q->timer.data = (unsigned long) sch;
576 573
577 q->qdisc = qdisc_create_dflt(sch->dev, &tfifo_qdisc_ops); 574 q->qdisc = qdisc_create_dflt(sch->dev, &tfifo_qdisc_ops,
575 TC_H_MAKE(sch->handle, 1));
578 if (!q->qdisc) { 576 if (!q->qdisc) {
579 pr_debug("netem: qdisc create failed\n"); 577 pr_debug("netem: qdisc create failed\n");
580 return -ENOMEM; 578 return -ENOMEM;
@@ -661,8 +659,8 @@ static int netem_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
661 659
662 sch_tree_lock(sch); 660 sch_tree_lock(sch);
663 *old = xchg(&q->qdisc, new); 661 *old = xchg(&q->qdisc, new);
662 qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
664 qdisc_reset(*old); 663 qdisc_reset(*old);
665 sch->q.qlen = 0;
666 sch_tree_unlock(sch); 664 sch_tree_unlock(sch);
667 665
668 return 0; 666 return 0;