aboutsummaryrefslogtreecommitdiffstats
path: root/net/sched
diff options
context:
space:
mode:
authorEric Dumazet <eric.dumazet@gmail.com>2010-12-15 03:18:36 -0500
committerDavid S. Miller <davem@davemloft.net>2010-12-20 16:13:56 -0500
commitc4266263249f22479eb1abb1a1709c38240b1597 (patch)
treeb9c57e63595f9eca69de0dfc245ba0000359bf90 /net/sched
parentf955e1415f381c7fa6ebe8630cd1fe5a694e8f4a (diff)
net_sched: sch_sfq: add backlog info in sfq_dump_class_stats()
We currently return for each active SFQ slot the number of packets in queue. We can also give number of bytes accounted for these packets. tc -s class show dev ifb0 Before patch : class sfq 11:3d9 parent 11: (dropped 0, overlimits 0 requeues 0) backlog 0b 3p requeues 0 allot 1266 After patch : class sfq 11:3e4 parent 11: (dropped 0, overlimits 0 requeues 0) backlog 4380b 3p requeues 0 allot 1212 Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched')
-rw-r--r--net/sched/sch_sfq.c7
1 files changed, 6 insertions, 1 deletions
diff --git a/net/sched/sch_sfq.c b/net/sched/sch_sfq.c
index 3cf478d012dd..cb331dea7fe0 100644
--- a/net/sched/sch_sfq.c
+++ b/net/sched/sch_sfq.c
@@ -548,8 +548,13 @@ static int sfq_dump_class_stats(struct Qdisc *sch, unsigned long cl,
548{ 548{
549 struct sfq_sched_data *q = qdisc_priv(sch); 549 struct sfq_sched_data *q = qdisc_priv(sch);
550 sfq_index idx = q->ht[cl-1]; 550 sfq_index idx = q->ht[cl-1];
551 struct gnet_stats_queue qs = { .qlen = q->qs[idx].qlen }; 551 struct sk_buff_head *list = &q->qs[idx];
552 struct gnet_stats_queue qs = { .qlen = list->qlen };
552 struct tc_sfq_xstats xstats = { .allot = q->allot[idx] }; 553 struct tc_sfq_xstats xstats = { .allot = q->allot[idx] };
554 struct sk_buff *skb;
555
556 skb_queue_walk(list, skb)
557 qs.backlog += qdisc_pkt_len(skb);
553 558
554 if (gnet_stats_copy_queue(d, &qs) < 0) 559 if (gnet_stats_copy_queue(d, &qs) < 0)
555 return -1; 560 return -1;