Skip to content

Commit d7f4f33

Browse files
congwangdavem330
authored andcommitted
sch_red: 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 6a73b57 commit d7f4f33

File tree

1 file changed

+4
-0
lines changed

1 file changed

+4
-0
lines changed

net/sched/sch_red.c

Lines changed: 4 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -97,6 +97,7 @@ static int red_enqueue(struct sk_buff *skb, struct Qdisc *sch)
9797

9898
ret = qdisc_enqueue(skb, child);
9999
if (likely(ret == NET_XMIT_SUCCESS)) {
100+
qdisc_qstats_backlog_inc(sch, skb);
100101
sch->q.qlen++;
101102
} else if (net_xmit_drop_count(ret)) {
102103
q->stats.pdrop++;
@@ -118,6 +119,7 @@ static struct sk_buff *red_dequeue(struct Qdisc *sch)
118119
skb = child->dequeue(child);
119120
if (skb) {
120121
qdisc_bstats_update(sch, skb);
122+
qdisc_qstats_backlog_dec(sch, skb);
121123
sch->q.qlen--;
122124
} else {
123125
if (!red_is_idling(&q->vars))
@@ -143,6 +145,7 @@ static unsigned int red_drop(struct Qdisc *sch)
143145
if (child->ops->drop && (len = child->ops->drop(child)) > 0) {
144146
q->stats.other++;
145147
qdisc_qstats_drop(sch);
148+
sch->qstats.backlog -= len;
146149
sch->q.qlen--;
147150
return len;
148151
}
@@ -158,6 +161,7 @@ static void red_reset(struct Qdisc *sch)
158161
struct red_sched_data *q = qdisc_priv(sch);
159162

160163
qdisc_reset(q->qdisc);
164+
sch->qstats.backlog = 0;
161165
sch->q.qlen = 0;
162166
red_restart(&q->vars);
163167
}

0 commit comments

Comments
 (0)