summaryrefslogtreecommitdiffstats
diff options
context:
space:
mode:
authorJarek Poplawski <jarkao2@gmail.com>2008-07-23 21:34:27 -0700
committerDavid S. Miller <davem@davemloft.net>2008-07-23 21:34:27 -0700
commitf867e6af94239a04ec23aeec2fcda5aa58e41db7 (patch)
treeaba94e6be14429ab8a6556c8d10c11a04914568c
parent6f75a9b6426e686649ac440c37ec7c249501f9a5 (diff)
downloadop-kernel-dev-f867e6af94239a04ec23aeec2fcda5aa58e41db7.zip
op-kernel-dev-f867e6af94239a04ec23aeec2fcda5aa58e41db7.tar.gz
pkt_sched: sch_sfq: dump a real number of flows
Dump the "flows" number according to the number of active flows instead of repeating the "limit". Reported-by: Denys Fedoryshchenko <denys@visp.net.lb> Signed-off-by: Jarek Poplawski <jarkao2@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
-rw-r--r--net/sched/sch_sfq.c9
1 files changed, 8 insertions, 1 deletions
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 8589da6..73f5384 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -536,7 +536,14 @@ static int sfq_dump(struct Qdisc *sch, struct sk_buff *skb)
opt.limit = q->limit;
opt.divisor = SFQ_HASH_DIVISOR;
- opt.flows = q->limit;
+ opt.flows = 0;
+ if (q->tail != SFQ_DEPTH) {
+ unsigned int i;
+
+ for (i = 0; i < SFQ_HASH_DIVISOR; i++)
+ if (q->ht[i] != SFQ_DEPTH)
+ opt.flows++;
+ }
NLA_PUT(skb, TCA_OPTIONS, sizeof(opt), &opt);
OpenPOWER on IntegriCloud