diff options
author | Eric Dumazet <eric.dumazet@gmail.com> | 2011-12-23 00:19:20 -0500 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2011-12-23 16:51:18 -0500 |
commit | f5a59b73321d9c6e6a9f0be4c8b563668f12c625 (patch) | |
tree | 908fe184cc39e76bd37940d5de0c5fecc472c4a1 /net/sched/sch_hfsc.c | |
parent | 681f16232c49de06fb3683a8b128a95dbda9413c (diff) |
sch_hfsc: report backlog information
Add backlog (byte count) information in hfsc classes and qdisc, so that
"tc -s" can report it to user, instead of 0 values :
qdisc hfsc 1: root refcnt 6 default 20
Sent 45141660 bytes 30545 pkt (dropped 0, overlimits 91751 requeues 0)
rate 1492Kbit 126pps backlog 103226b 74p requeues 0
...
class hfsc 1:20 parent 1:1 leaf 1201: rt m1 0bit d 0us m2 400000bit ls m1 0bit d 0us m2 200000bit
Sent 49534912 bytes 33519 pkt (dropped 0, overlimits 0 requeues 0)
backlog 81822b 56p requeues 0
period 23 work 49451576 bytes rtwork 13277552 bytes level 0
...
Signed-off-by: Eric Dumazet <eric.dumazet@gmail.com>
CC: John A. Sullivan III <jsullivan@opensourcedevel.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/sched/sch_hfsc.c')
-rw-r--r-- | net/sched/sch_hfsc.c | 10 |
1 files changed, 10 insertions, 0 deletions
diff --git a/net/sched/sch_hfsc.c b/net/sched/sch_hfsc.c index 6488e6425652..9bdca2e011e9 100644 --- a/net/sched/sch_hfsc.c +++ b/net/sched/sch_hfsc.c | |||
@@ -1368,6 +1368,7 @@ hfsc_dump_class_stats(struct Qdisc *sch, unsigned long arg, | |||
1368 | struct tc_hfsc_stats xstats; | 1368 | struct tc_hfsc_stats xstats; |
1369 | 1369 | ||
1370 | cl->qstats.qlen = cl->qdisc->q.qlen; | 1370 | cl->qstats.qlen = cl->qdisc->q.qlen; |
1371 | cl->qstats.backlog = cl->qdisc->qstats.backlog; | ||
1371 | xstats.level = cl->level; | 1372 | xstats.level = cl->level; |
1372 | xstats.period = cl->cl_vtperiod; | 1373 | xstats.period = cl->cl_vtperiod; |
1373 | xstats.work = cl->cl_total; | 1374 | xstats.work = cl->cl_total; |
@@ -1561,6 +1562,15 @@ hfsc_dump_qdisc(struct Qdisc *sch, struct sk_buff *skb) | |||
1561 | struct hfsc_sched *q = qdisc_priv(sch); | 1562 | struct hfsc_sched *q = qdisc_priv(sch); |
1562 | unsigned char *b = skb_tail_pointer(skb); | 1563 | unsigned char *b = skb_tail_pointer(skb); |
1563 | struct tc_hfsc_qopt qopt; | 1564 | struct tc_hfsc_qopt qopt; |
1565 | struct hfsc_class *cl; | ||
1566 | struct hlist_node *n; | ||
1567 | unsigned int i; | ||
1568 | |||
1569 | sch->qstats.backlog = 0; | ||
1570 | for (i = 0; i < q->clhash.hashsize; i++) { | ||
1571 | hlist_for_each_entry(cl, n, &q->clhash.hash[i], cl_common.hnode) | ||
1572 | sch->qstats.backlog += cl->qdisc->qstats.backlog; | ||
1573 | } | ||
1564 | 1574 | ||
1565 | qopt.defcls = q->defcls; | 1575 | qopt.defcls = q->defcls; |
1566 | NLA_PUT(skb, TCA_OPTIONS, sizeof(qopt), &qopt); | 1576 | NLA_PUT(skb, TCA_OPTIONS, sizeof(qopt), &qopt); |