From: WANG Cong Date: Thu, 25 Feb 2016 22:55:03 +0000 (-0800) Subject: sch_dsmark: update backlog as well X-Git-Tag: v3.2.87~43 X-Git-Url: https://git.openpandora.org/cgi-bin/gitweb.cgi?p=pandora-kernel.git;a=commitdiff_plain;h=be3b6736c14a70cd5f51f36b5c6726cd75bebb95 sch_dsmark: update backlog as well [ Upstream commit bdf17661f63a79c3cb4209b970b1cc39e34f7543 ] Similarly, we need to update backlog too when we update qlen. Cc: Jamal Hadi Salim Signed-off-by: Cong Wang Signed-off-by: David S. Miller [bwh: Backported to 3.2: open-code qdisc_qstats_backlog_{inc,dec}()] Signed-off-by: Ben Hutchings --- diff --git a/net/sched/sch_dsmark.c b/net/sched/sch_dsmark.c index 2c790204d042..d75bfcf972f0 100644 --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c @@ -260,6 +260,7 @@ static int dsmark_enqueue(struct sk_buff *skb, struct Qdisc *sch) return err; } + sch->qstats.backlog += qdisc_pkt_len(skb); sch->q.qlen++; return NET_XMIT_SUCCESS; @@ -283,6 +284,7 @@ static struct sk_buff *dsmark_dequeue(struct Qdisc *sch) return NULL; qdisc_bstats_update(sch, skb); + sch->qstats.backlog -= qdisc_pkt_len(skb); sch->q.qlen--; index = skb->tc_index & (p->indices - 1); @@ -398,6 +400,7 @@ static void dsmark_reset(struct Qdisc *sch) pr_debug("dsmark_reset(sch %p,[qdisc %p])\n", sch, p); qdisc_reset(p->q); + sch->qstats.backlog = 0; sch->q.qlen = 0; }