From mboxrd@z Thu Jan 1 00:00:00 1970 From: Jakub Kicinski Subject: [RFC -next 1/2] net: sched: add qstats.qlen to qlen Date: Thu, 4 Jan 2018 12:18:50 -0800 Message-ID: <20180104201851.6455-2-jakub.kicinski@netronome.com> References: <20180104201851.6455-1-jakub.kicinski@netronome.com> Cc: netdev@vger.kernel.org, oss-drivers@netronome.com, edumazet@google.com, Jakub Kicinski To: john.fastabend@gmail.com, jiri@resnulli.us, xiyou.wangcong@gmail.com, Nogah Frankel , Yuval Mintz Return-path: Received: from mail-pg0-f66.google.com ([74.125.83.66]:39863 "EHLO mail-pg0-f66.google.com" rhost-flags-OK-OK-OK-OK) by vger.kernel.org with ESMTP id S1752978AbeADUTF (ORCPT ); Thu, 4 Jan 2018 15:19:05 -0500 Received: by mail-pg0-f66.google.com with SMTP id 81so1122545pgf.6 for ; Thu, 04 Jan 2018 12:19:05 -0800 (PST) In-Reply-To: <20180104201851.6455-1-jakub.kicinski@netronome.com> Sender: netdev-owner@vger.kernel.org List-ID: AFAICT struct gnet_stats_queue.qlen is not used in Qdiscs. It may, however, be useful for offloads to report HW queue length there. Add that value to the result of qdisc_qlen_sum(). Signed-off-by: Jakub Kicinski --- include/net/sch_generic.h | 4 ++-- 1 file changed, 2 insertions(+), 2 deletions(-) diff --git a/include/net/sch_generic.h b/include/net/sch_generic.h index ac029d5d88e4..5d8735c0af11 100644 --- a/include/net/sch_generic.h +++ b/include/net/sch_generic.h @@ -310,14 +310,14 @@ static inline int qdisc_qlen(const struct Qdisc *q) static inline int qdisc_qlen_sum(const struct Qdisc *q) { - __u32 qlen = 0; + __u32 qlen = q->qstats.qlen; int i; if (q->flags & TCQ_F_NOLOCK) { for_each_possible_cpu(i) qlen += per_cpu_ptr(q->cpu_qstats, i)->qlen; } else { - qlen = q->q.qlen; + qlen += q->q.qlen; } return qlen; -- 2.15.1