From mboxrd@z Thu Jan 1 00:00:00 1970 From: John Fastabend Subject: Re: [PATCH net] fq_codel: return non zero qlen in class dumps Date: Tue, 7 Jun 2016 09:03:00 -0700 Message-ID: <5756F034.4080604@gmail.com> References: <1465229559.2968.75.camel@edumazet-glaptop3.roam.corp.google.com> Mime-Version: 1.0 Content-Type: text/plain; charset=utf-8 Content-Transfer-Encoding: 7bit Cc: netdev , John Fastabend To: Eric Dumazet , David Miller Return-path: Received: from mail-pa0-f67.google.com ([209.85.220.67]:35937 "EHLO mail-pa0-f67.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S932497AbcFGQDO (ORCPT ); Tue, 7 Jun 2016 12:03:14 -0400 Received: by mail-pa0-f67.google.com with SMTP id fg1so14488848pad.3 for ; Tue, 07 Jun 2016 09:03:14 -0700 (PDT) In-Reply-To: <1465229559.2968.75.camel@edumazet-glaptop3.roam.corp.google.com> Sender: netdev-owner@vger.kernel.org List-ID: On 16-06-06 09:12 AM, Eric Dumazet wrote: > From: Eric Dumazet > > We properly scan the flow list to count number of packets, > but John passed 0 to gnet_stats_copy_queue() so we report > a zero value to user space instead of the result. > > Fixes: 640158536632 ("net: sched: restrict use of qstats qlen") > Signed-off-by: Eric Dumazet > Cc: John Fastabend > --- > net/sched/sch_fq_codel.c | 2 +- > 1 file changed, 1 insertion(+), 1 deletion(-) > > diff --git a/net/sched/sch_fq_codel.c b/net/sched/sch_fq_codel.c > index 6883a8971562..7a280360aeed 100644 > --- a/net/sched/sch_fq_codel.c > +++ b/net/sched/sch_fq_codel.c > @@ -649,7 +649,7 @@ static int fq_codel_dump_class_stats(struct Qdisc *sch, unsigned long cl, > qs.backlog = q->backlogs[idx]; > qs.drops = flow->dropped; > } > - if (gnet_stats_copy_queue(d, NULL, &qs, 0) < 0) > + if (gnet_stats_copy_queue(d, NULL, &qs, qs.qlen) < 0) > return -1; > if (idx < q->flows_cnt) > return gnet_stats_copy_app(d, &xstats, sizeof(xstats)); > > Apparently I only passed zero in the sch_fq_codel case, strange. At the moment I can't think of any reason other than it being a typo. Thanks for fixing it! Acked-by: John Fastabend