aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched/sch_prio.c
diff options
context:
space:
mode:
Diffstat (limited to 'net/sched/sch_prio.c')
-rw-r--r--net/sched/sch_prio.c14
1 files changed, 10 insertions, 4 deletions
diff --git a/net/sched/sch_prio.c b/net/sched/sch_prio.c
index a5fa03c0c19b..2567b4c96c1e 100644
--- a/net/sched/sch_prio.c
+++ b/net/sched/sch_prio.c
@@ -222,21 +222,27 @@ static int prio_tune(struct Qdisc *sch, struct rtattr *opt)
222 222
223 for (i=q->bands; i<TCQ_PRIO_BANDS; i++) { 223 for (i=q->bands; i<TCQ_PRIO_BANDS; i++) {
224 struct Qdisc *child = xchg(&q->queues[i], &noop_qdisc); 224 struct Qdisc *child = xchg(&q->queues[i], &noop_qdisc);
225 if (child != &noop_qdisc) 225 if (child != &noop_qdisc) {
226 qdisc_tree_decrease_qlen(child, child->q.qlen);
226 qdisc_destroy(child); 227 qdisc_destroy(child);
228 }
227 } 229 }
228 sch_tree_unlock(sch); 230 sch_tree_unlock(sch);
229 231
230 for (i=0; i<q->bands; i++) { 232 for (i=0; i<q->bands; i++) {
231 if (q->queues[i] == &noop_qdisc) { 233 if (q->queues[i] == &noop_qdisc) {
232 struct Qdisc *child; 234 struct Qdisc *child;
233 child = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops); 235 child = qdisc_create_dflt(sch->dev, &pfifo_qdisc_ops,
236 TC_H_MAKE(sch->handle, i + 1));
234 if (child) { 237 if (child) {
235 sch_tree_lock(sch); 238 sch_tree_lock(sch);
236 child = xchg(&q->queues[i], child); 239 child = xchg(&q->queues[i], child);
237 240
238 if (child != &noop_qdisc) 241 if (child != &noop_qdisc) {
242 qdisc_tree_decrease_qlen(child,
243 child->q.qlen);
239 qdisc_destroy(child); 244 qdisc_destroy(child);
245 }
240 sch_tree_unlock(sch); 246 sch_tree_unlock(sch);
241 } 247 }
242 } 248 }
@@ -294,7 +300,7 @@ static int prio_graft(struct Qdisc *sch, unsigned long arg, struct Qdisc *new,
294 sch_tree_lock(sch); 300 sch_tree_lock(sch);
295 *old = q->queues[band]; 301 *old = q->queues[band];
296 q->queues[band] = new; 302 q->queues[band] = new;
297 sch->q.qlen -= (*old)->q.qlen; 303 qdisc_tree_decrease_qlen(*old, (*old)->q.qlen);
298 qdisc_reset(*old); 304 qdisc_reset(*old);
299 sch_tree_unlock(sch); 305 sch_tree_unlock(sch);
300 306