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

[PKT_SCHED]: RED: use dump_stats

Makes RED use dump_stats qdisc op.
Signed-off-by: default avatarThomas Graf <tgraf@suug.ch>
Signed-off-by: default avatarDavid S. Miller <davem@davemloft.net>
parent ba3bbff5
......@@ -396,16 +396,6 @@ static int red_init(struct Qdisc* sch, struct rtattr *opt)
return red_change(sch, opt);
}
int red_copy_xstats(struct sk_buff *skb, struct tc_red_xstats *st)
{
RTA_PUT(skb, TCA_XSTATS, sizeof(*st), st);
return 0;
rtattr_failure:
return 1;
}
static int red_dump(struct Qdisc *sch, struct sk_buff *skb)
{
struct red_sched_data *q = qdisc_priv(sch);
......@@ -425,9 +415,6 @@ static int red_dump(struct Qdisc *sch, struct sk_buff *skb)
RTA_PUT(skb, TCA_RED_PARMS, sizeof(opt), &opt);
rta->rta_len = skb->tail - b;
if (red_copy_xstats(skb, &q->st))
goto rtattr_failure;
return skb->len;
rtattr_failure:
......@@ -435,6 +422,13 @@ static int red_dump(struct Qdisc *sch, struct sk_buff *skb)
return -1;
}
static int red_dump_stats(struct Qdisc *sch, struct gnet_dump *d)
{
struct red_sched_data *q = qdisc_priv(sch);
return gnet_stats_copy_app(d, &q->st, sizeof(q->st));
}
static struct Qdisc_ops red_qdisc_ops = {
.next = NULL,
.cl_ops = NULL,
......@@ -448,6 +442,7 @@ static struct Qdisc_ops red_qdisc_ops = {
.reset = red_reset,
.change = red_change,
.dump = red_dump,
.dump_stats = red_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