From: Jakub Kicinski <jakub.kicinski@netronome.com>
To: john.fastabend@gmail.com, jiri@resnulli.us,
xiyou.wangcong@gmail.com, Nogah Frankel <nogahf@mellanox.com>,
Yuval Mintz <yuvalm@mellanox.com>
Cc: netdev@vger.kernel.org, oss-drivers@netronome.com,
edumazet@google.com,
Jakub Kicinski <jakub.kicinski@netronome.com>
Subject: [RFC -next 1/2] net: sched: add qstats.qlen to qlen
Date: Thu, 4 Jan 2018 12:18:50 -0800 [thread overview]
Message-ID: <20180104201851.6455-2-jakub.kicinski@netronome.com> (raw)
In-Reply-To: <20180104201851.6455-1-jakub.kicinski@netronome.com>
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 <jakub.kicinski@netronome.com>
---
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
next prev parent reply other threads:[~2018-01-04 20:19 UTC|newest]
Thread overview: 5+ messages / expand[flat|nested] mbox.gz Atom feed top
2018-01-04 20:18 [RFC -next 0/2] sched: red offload and TC stats Jakub Kicinski
2018-01-04 20:18 ` Jakub Kicinski [this message]
2018-01-04 20:18 ` [RFC -next 2/2] net: sched: red: don't reset the backlog on every stat dump Jakub Kicinski
2018-01-08 9:18 ` Nogah Frankel
2018-01-08 18:23 ` Jakub Kicinski
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20180104201851.6455-2-jakub.kicinski@netronome.com \
--to=jakub.kicinski@netronome.com \
--cc=edumazet@google.com \
--cc=jiri@resnulli.us \
--cc=john.fastabend@gmail.com \
--cc=netdev@vger.kernel.org \
--cc=nogahf@mellanox.com \
--cc=oss-drivers@netronome.com \
--cc=xiyou.wangcong@gmail.com \
--cc=yuvalm@mellanox.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).