From: David Ward <david.ward@ll.mit.edu>
To: <netdev@vger.kernel.org>
Cc: Bruce Osler <brosler@cisco.com>, Cyril Chemparathy <cyril@ti.com>,
Jamal Hadi Salim <jhs@mojatatu.com>,
David Ward <david.ward@ll.mit.edu>
Subject: [PATCH 3/4] net_sched: gred: fix qave reporting via netlink
Date: Thu, 13 Sep 2012 11:22:34 -0400 [thread overview]
Message-ID: <1347549755-19438-3-git-send-email-david.ward@ll.mit.edu> (raw)
In-Reply-To: <1347549755-19438-1-git-send-email-david.ward@ll.mit.edu>
q->vars.qavg is a Wlog scaled value, but q->backlog is not. In order
to pass q->vars.qavg as the backlog value, we need to un-scale it.
Additionally, the qave value returned via netlink should not be Wlog
scaled, so we need to un-scale the result of red_calc_qavg().
This caused artificially high values for "Average Queue" to be shown
by 'tc -s -d qdisc', but did not affect the actual operation of GRED.
Signed-off-by: David Ward <david.ward@ll.mit.edu>
---
net/sched/sch_gred.c | 5 ++++-
1 files changed, 4 insertions(+), 1 deletions(-)
diff --git a/net/sched/sch_gred.c b/net/sched/sch_gred.c
index e19d4eb..b2570b5 100644
--- a/net/sched/sch_gred.c
+++ b/net/sched/sch_gred.c
@@ -534,6 +534,7 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)
for (i = 0; i < MAX_DPs; i++) {
struct gred_sched_data *q = table->tab[i];
struct tc_gred_qopt opt;
+ unsigned long qavg;
memset(&opt, 0, sizeof(opt));
@@ -565,7 +566,9 @@ static int gred_dump(struct Qdisc *sch, struct sk_buff *skb)
if (gred_wred_mode(table))
gred_load_wred_set(table, q);
- opt.qave = red_calc_qavg(&q->parms, &q->vars, q->vars.qavg);
+ qavg = red_calc_qavg(&q->parms, &q->vars,
+ q->vars.qavg >> q->parms.Wlog);
+ opt.qave = qavg >> q->parms.Wlog;
append_opt:
if (nla_append(skb, sizeof(opt), &opt) < 0)
--
1.7.4.1
next prev parent reply other threads:[~2012-09-13 15:48 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2012-09-13 15:22 [PATCH 1/4] net_sched: gred: correct comment about qavg calculation in RIO mode David Ward
2012-09-13 15:22 ` [PATCH 2/4] net_sched: gred: eliminate redundant DP prio comparisons David Ward
2012-09-13 18:00 ` Jamal Hadi Salim
2012-09-13 20:10 ` David Miller
2012-09-13 15:22 ` David Ward [this message]
2012-09-13 18:01 ` [PATCH 3/4] net_sched: gred: fix qave reporting via netlink Jamal Hadi Salim
2012-09-13 20:10 ` David Miller
2012-09-13 15:22 ` [PATCH 4/4] net_sched: gred: actually perform idling in WRED mode David Ward
2012-09-13 18:08 ` Jamal Hadi Salim
2012-09-13 19:38 ` Ward, David - 0663 - MITLL
2012-09-13 20:10 ` David Miller
2012-09-13 20:37 ` Jamal Hadi Salim
2012-09-13 17:59 ` [PATCH 1/4] net_sched: gred: correct comment about qavg calculation in RIO mode Jamal Hadi Salim
2012-09-13 20:10 ` David Miller
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=1347549755-19438-3-git-send-email-david.ward@ll.mit.edu \
--to=david.ward@ll.mit.edu \
--cc=brosler@cisco.com \
--cc=cyril@ti.com \
--cc=jhs@mojatatu.com \
--cc=netdev@vger.kernel.org \
/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).