Skip to content

Commit

Permalink
sch_dsmark: update backlog as well
Browse files Browse the repository at this point in the history
Similarly, we need to update backlog too when we update qlen.

Cc: Jamal Hadi Salim <jhs@mojatatu.com>
Signed-off-by: Cong Wang <xiyou.wangcong@gmail.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
WANG Cong authored and David S. Miller committed Feb 29, 2016
1 parent 431e3a8 commit bdf1766
Showing 1 changed file with 3 additions and 0 deletions.
3 changes: 3 additions & 0 deletions net/sched/sch_dsmark.c
Original file line number Diff line number Diff line change
Expand Up @@ -258,6 +258,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch)
return err;
}

qdisc_qstats_backlog_inc(sch, skb);
sch->q.qlen++;

return NET_XMIT_SUCCESS;
Expand All @@ -280,6 +281,7 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch)
return NULL;

qdisc_bstats_update(sch, skb);
qdisc_qstats_backlog_dec(sch, skb);
sch->q.qlen--;

index = skb->tc_index & (p->indices - 1);
Expand Down Expand Up @@ -395,6 +397,7 @@ static void dsmark_reset(struct Qdisc *sch)

pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p);
qdisc_reset(p->q);
sch->qstats.backlog = 0;
sch->q.qlen = 0;
}

Expand Down

0 comments on commit bdf1766

Please sign in to comment.