Commit ba3bbff5 authored by Thomas Graf's avatar Thomas Graf Committed by David S. Miller

[PKT_SCHED]: CBQ: use dump_stats

Makes CBQ use dump_stats qdisc op to provide xstats.
Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent 176b40a3
......@@ -1633,13 +1633,6 @@ static int cbq_dump(struct Qdisc *sch, struct sk_buff *skb)
if (cbq_dump_attr(skb, &q->link) < 0)
goto rtattr_failure;
rta->rta_len = skb->tail - b;
spin_lock_bh(&sch->dev->queue_lock);
q->link.xstats.avgidle = q->link.avgidle;
if (cbq_copy_xstats(skb, &q->link.xstats)) {
spin_unlock_bh(&sch->dev->queue_lock);
goto rtattr_failure;
}
spin_unlock_bh(&sch->dev->queue_lock);
return skb->len;
rtattr_failure:
......@@ -1647,6 +1640,15 @@ static int cbq_dump(struct Qdisc *sch, struct sk_buff *skb)
return -1;
}
static int
cbq_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
{
struct cbq_sched_data *q = qdisc_priv(sch);
q->link.xstats.avgidle = q->link.avgidle;
return gnet_stats_copy_app(d, &q->link.xstats, sizeof(q->link.xstats));
}
static int
cbq_dump_class(struct Qdisc *sch, unsigned long arg,
struct sk_buff *skb, struct tcmsg *tcm)
......@@ -2133,6 +2135,7 @@ static struct Qdisc_ops cbq_qdisc_ops = {
.destroy = cbq_destroy,
.change = NULL,
.dump = cbq_dump,
.dump_stats = cbq_dump_stats,
.owner = THIS_MODULE,
};
......
Markdown is supported
0%
or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment