From 53eb440f4ada034ea43b295891feec3df0fa7a29 Mon Sep 17 00:00:00 2001 From: Jamal Hadi Salim Date: Mon, 6 Jun 2016 06:32:54 -0400 Subject: net sched actions: introduce timestamp for firsttime use Useful to know when the action was first used for accounting (and debugging) Signed-off-by: Jamal Hadi Salim Signed-off-by: David S. Miller --- include/net/act_api.h | 2 ++ include/uapi/linux/pkt_cls.h | 1 + 2 files changed, 3 insertions(+) (limited to 'include') diff --git a/include/net/act_api.h b/include/net/act_api.h index 9a9a8edc138f..8389c007076f 100644 --- a/include/net/act_api.h +++ b/include/net/act_api.h @@ -76,6 +76,8 @@ static inline void tcf_lastuse_update(struct tcf_t *tm) if (tm->lastuse != now) tm->lastuse = now; + if (unlikely(!tm->firstuse)) + tm->firstuse = now; } struct tc_action { diff --git a/include/uapi/linux/pkt_cls.h b/include/uapi/linux/pkt_cls.h index f4297c8a42fe..9ba1410bd21d 100644 --- a/include/uapi/linux/pkt_cls.h +++ b/include/uapi/linux/pkt_cls.h @@ -124,6 +124,7 @@ struct tcf_t { __u64 install; __u64 lastuse; __u64 expires; + __u64 firstuse; }; struct tc_cnt { -- cgit v1.2.3-59-g8ed1b