Skip to content

Commit

Permalink
[NET_SCHED] sch_prio: class statistics printing enabled
Browse files Browse the repository at this point in the history
This patch adds a dump_stats callback to enable
printing of basic statistics of prio classes.
(With help of Patrick McHardy).

Signed-off-by: Jarek Poplawski <jarkao2@o2.pl>
Acked-by: Patrick McHardy <kaber@trash.net>
Signed-off-by: David S. Miller <davem@davemloft.net>
  • Loading branch information
Jarek Poplawski authored and David S. Miller committed Feb 8, 2007
1 parent 5986a2e commit 2cf6c36
Showing 1 changed file with 15 additions and 0 deletions.
15 changes: 15 additions & 0 deletions net/sched/sch_prio.c
Original file line number Diff line number Diff line change
Expand Up @@ -372,6 +372,20 @@ static int prio_dump_class(struct Qdisc *sch, unsigned long cl, struct sk_buff *
return 0;
}

static int prio_dump_class_stats(struct Qdisc *sch, unsigned long cl,
struct gnet_dump *d)
{
struct prio_sched_data *q = qdisc_priv(sch);
struct Qdisc *cl_q;

cl_q = q->queues[cl - 1];
if (gnet_stats_copy_basic(d, &cl_q->bstats) < 0 ||
gnet_stats_copy_queue(d, &cl_q->qstats) < 0)
return -1;

return 0;
}

static void prio_walk(struct Qdisc *sch, struct qdisc_walker *arg)
{
struct prio_sched_data *q = qdisc_priv(sch);
Expand Down Expand Up @@ -414,6 +428,7 @@ static struct Qdisc_class_ops prio_class_ops = {
.bind_tcf = prio_bind,
.unbind_tcf = prio_put,
.dump = prio_dump_class,
.dump_stats = prio_dump_class_stats,
};

static struct Qdisc_ops prio_qdisc_ops = {
Expand Down

0 comments on commit 2cf6c36

Please sign in to comment.