Skip to content

Commit 6a73b57

Browse files
congwangdavem330
authored andcommitted
sch_drr: update backlog as well
Fixes: 2ccccf5 ("net_sched: update hierarchical backlog too") Cc: Jamal Hadi Salim <[email protected]> Signed-off-by: Cong Wang <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent 6529d75 commit 6a73b57

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/sched/sch_drr.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -375,6 +375,7 @@ static int drr_enqueue(struct sk_buff *skb, struct Qdisc *sch)
375375
cl->deficit = cl->quantum;
376376
}
377377

378+
qdisc_qstats_backlog_inc(sch, skb);
378379
sch->q.qlen++;
379380
return err;
380381
}
@@ -407,6 +408,7 @@ static struct sk_buff *drr_dequeue(struct Qdisc *sch)
407408

408409
bstats_update(&cl->bstats, skb);
409410
qdisc_bstats_update(sch, skb);
411+
qdisc_qstats_backlog_dec(sch, skb);
410412
sch->q.qlen--;
411413
return skb;
412414
}
@@ -428,6 +430,7 @@ static unsigned int drr_drop(struct Qdisc *sch)
428430
if (cl->qdisc->ops->drop) {
429431
len = cl->qdisc->ops->drop(cl->qdisc);
430432
if (len > 0) {
433+
sch->qstats.backlog -= len;
431434
sch->q.qlen--;
432435
if (cl->qdisc->q.qlen == 0)
433436
list_del(&cl->alist);
@@ -463,6 +466,7 @@ static void drr_reset_qdisc(struct Qdisc *sch)
463466
qdisc_reset(cl->qdisc);
464467
}
465468
}
469+
sch->qstats.backlog = 0;
466470
sch->q.qlen = 0;
467471
}
468472

0 commit comments

Comments
 (0)