Return-Path: Received: (majordomo@vger.kernel.org) by vger.kernel.org via listexpand id S937506AbdCJNdQ (ORCPT ); Fri, 10 Mar 2017 08:33:16 -0500 Received: from shadbolt.e.decadent.org.uk ([88.96.1.126]:43679 "EHLO shadbolt.e.decadent.org.uk" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S934357AbdCJLw3 (ORCPT ); Fri, 10 Mar 2017 06:52:29 -0500 Content-Type: text/plain; charset="UTF-8" Content-Disposition: inline Content-Transfer-Encoding: 8bit MIME-Version: 1.0 From: Ben Hutchings To: linux-kernel@vger.kernel.org, stable@vger.kernel.org CC: akpm@linux-foundation.org, "WANG Cong" , "David S. Miller" , "Jamal Hadi Salim" Date: Fri, 10 Mar 2017 11:46:23 +0000 Message-ID: X-Mailer: LinuxStableQueue (scripts by bwh) Subject: [PATCH 3.16 314/370] sch_dsmark: update backlog as well In-Reply-To: X-SA-Exim-Connect-IP: 82.70.136.246 X-SA-Exim-Mail-From: ben@decadent.org.uk X-SA-Exim-Scanned: No (on shadbolt.decadent.org.uk); SAEximRunCond expanded to false Sender: linux-kernel-owner@vger.kernel.org List-ID: X-Mailing-List: linux-kernel@vger.kernel.org Content-Length: 1246 Lines: 45 3.16.42-rc1 review patch. If anyone has any objections, please let me know. ------------------ From: WANG Cong [ 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.16: open-code qdisc_qstats_backlog_{inc,dec}()] Signed-off-by: Ben Hutchings --- net/sched/sch_dsmark.c | 3 +++ 1 file changed, 3 insertions(+) --- a/net/sched/sch_dsmark.c +++ b/net/sched/sch_dsmark.c @@ -255,6 +255,7 @@ static int dsmark_enqueue(struct sk_buff return err; } + sch->qstats.backlog += qdisc_pkt_len(skb); sch->q.qlen++; return NET_XMIT_SUCCESS; @@ -277,6 +278,7 @@ static struct sk_buff *dsmark_dequeue(st return NULL; qdisc_bstats_update(sch, skb); + sch->qstats.backlog -= qdisc_pkt_len(skb); sch->q.qlen--; index = skb->tc_index & (p->indices - 1); @@ -392,6 +394,7 @@ static void dsmark_reset(struct Qdisc *s pr_debug("%s(sch %p,[qdisc %p])\n", __func__, sch, p); qdisc_reset(p->q); + sch->qstats.backlog = 0; sch->q.qlen = 0; }