From: Jarek Poplawski Date: Thu, 24 Jul 2008 04:34:27 +0000 (-0700) Subject: pkt_sched: sch_sfq: dump a real number of flows X-Git-Tag: v2.6.27-rc1~523^2 X-Git-Url: http://pilppa.com/gitweb/?a=commitdiff_plain;h=f867e6af94239a04ec23aeec2fcda5aa58e41db7;p=linux-2.6-omap-h63xx.git 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 Signed-off-by: Jarek Poplawski Signed-off-by: David S. Miller --- diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c index 8589da66656..73f53844ce9 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);