summaryrefslogtreecommitdiff
path: root/include
diff options
context:
space:
mode:
authorThomas Graf <tgraf@suug.ch>2004-11-02 22:00:45 -0800
committerDavid S. Miller <davem@nuts.davemloft.net>2004-11-02 22:00:45 -0800
commit10be959b6d1ba9dd6134ec7236aa39744a8ccc9f (patch)
tree7df01f892fb21b7143244abfd450caec3be3594a /include
parent59c1b20723b9c9482ed42ffe6713dc7ff5c33592 (diff)
[PKT_SCHED]: tcf_action: copy generic stats via TCA_ACT_STATS
Dumps the statistic common to all action modules via the newly introduced TLV type TCA_ACT_STATS in tcf_action_copy_stats but allows the corresponding module to dump its own statistic by implementing the get_stats callback. Signed-off-by: Thomas Graf <tgraf@suug.ch> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/linux/rtnetlink.h1
-rw-r--r--include/net/act_api.h8
-rw-r--r--include/net/pkt_act.h7
3 files changed, 11 insertions, 5 deletions
diff --git a/include/linux/rtnetlink.h b/include/linux/rtnetlink.h
index 9bb86160c2f2..354e5f88e4f8 100644
--- a/include/linux/rtnetlink.h
+++ b/include/linux/rtnetlink.h
@@ -699,6 +699,7 @@ enum
TCA_RATE,
TCA_FCNT,
TCA_STATS2,
+ TCA_ACT_STATS,
__TCA_MAX
};
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 9446b20e9c13..72083353ec20 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -44,10 +44,16 @@ struct tcf_##name *next; \
u32 capab; \
int action; \
struct tcf_t tm; \
- struct tc_stats stats; \
+ struct gnet_stats_basic bstats; \
+ struct gnet_stats_queue qstats; \
+ struct gnet_stats_rate_est rate_est; \
spinlock_t *stats_lock; \
spinlock_t lock
+struct tcf_act_hdr
+{
+ tca_gen(act_hdr);
+};
struct tc_action
{
diff --git a/include/net/pkt_act.h b/include/net/pkt_act.h
index 7c30074c4a6f..bf55ad5694ee 100644
--- a/include/net/pkt_act.h
+++ b/include/net/pkt_act.h
@@ -60,7 +60,7 @@ tcf_hash_destroy(struct tcf_st *p)
*p1p = p->next;
write_unlock_bh(&tcf_t_lock);
#ifdef CONFIG_NET_ESTIMATOR
- qdisc_kill_estimator(&p->stats);
+ gen_kill_estimator(&p->bstats, &p->rate_est);
#endif
kfree(p);
return;
@@ -256,9 +256,8 @@ tcf_hash_create(struct tc_st *parm, struct rtattr *est, struct tc_action *a, int
p->tm.install = jiffies;
p->tm.lastuse = jiffies;
#ifdef CONFIG_NET_ESTIMATOR
- if (est) {
- qdisc_new_estimator(&p->stats, p->stats_lock, est);
- }
+ if (est)
+ gen_new_estimator(&p->bstats, &p->rate_est, p->stats_lock, est);
#endif
h = tcf_hash(p->index);
write_lock_bh(&tcf_t_lock);