]> git.hungrycats.org Git - linux/commitdiff
[PKT_SCHED]: Add dump_stats qdisc op
authorThomas Graf <tgraf@suug.ch>
Thu, 21 Oct 2004 15:23:26 +0000 (08:23 -0700)
committerDavid S. Miller <davem@nuts.davemloft.net>
Thu, 21 Oct 2004 15:23:26 +0000 (08:23 -0700)
Adds a new qdisc operation dump_stats which qdiscs can use
to dump statistics. The op is invoked between gnet_stats_start_copy
and gnet_stats_finish_copy and therefore stats_lock is already
held. This is required to ensure proper locking throughout the
whole statistic dumping procedure.

Signed-off-by: Thomas Graf <tgraf@suug.ch>
Signed-off-by: David S. Miller <davem@davemloft.net>
include/net/pkt_sched.h
net/sched/sch_api.c

index 8391882cc787ab4b67102ad9d231ac602d74efa6..6bd1748ba3de343e6442b186f9c8af9db58f0446 100644 (file)
@@ -64,6 +64,7 @@ struct Qdisc_ops
        int                     (*change)(struct Qdisc *, struct rtattr *arg);
 
        int                     (*dump)(struct Qdisc *, struct sk_buff *);
+       int                     (*dump_stats)(struct Qdisc *, struct gnet_dump *);
 
        struct module           *owner;
 };
index ebe812202dc23d98f1fcc1d8227dc31afef9789c..e60ed1234881a8fa256449ec9ae99e99a68947ff 100644 (file)
@@ -767,6 +767,9 @@ static int tc_fill_qdisc(struct sk_buff *skb, struct Qdisc *q, u32 clid,
                        TCA_XSTATS, q->stats_lock, &d) < 0)
                goto rtattr_failure;
 
+       if (q->ops->dump_stats && q->ops->dump_stats(q, &d) < 0)
+               goto rtattr_failure;
+
        if (gnet_stats_copy_basic(&d, &q->bstats) < 0 ||
 #ifdef CONFIG_NET_ESTIMATOR
            gnet_stats_copy_rate_est(&d, &q->rate_est) < 0 ||