Skip to content

Commit

Permalink
net_sched: sch_sfq: add backlog info in sfq_dump_class_stats()
Browse files Browse the repository at this point in the history
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>
  • Loading branch information
Eric Dumazet authored and David S. Miller committed Dec 20, 2010
1 parent f955e14 commit c426626
Showing 1 changed file with 6 additions and 1 deletion.
7 changes: 6 additions & 1 deletion net/sched/sch_sfq.c
Original file line number Diff line number Diff line change
Expand Up @@ -548,8 +548,13 @@ static int sfq_dump_class_stats(struct Qdisc *sch, unsigned long cl,
{
struct sfq_sched_data *q = qdisc_priv(sch);
sfq_index idx = q->ht[cl-1];
struct gnet_stats_queue qs = { .qlen = q->qs[idx].qlen };
struct sk_buff_head *list = &q->qs[idx];
struct gnet_stats_queue qs = { .qlen = list->qlen };
struct tc_sfq_xstats xstats = { .allot = q->allot[idx] };
struct sk_buff *skb;

skb_queue_walk(list, skb)
qs.backlog += qdisc_pkt_len(skb);

if (gnet_stats_copy_queue(d, &qs) < 0)
return -1;
Expand Down

0 comments on commit c426626

Please sign in to comment.