summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorDavid S. Miller <davem@davemloft.net>2016-06-07 15:53:44 -0700
committerDavid S. Miller <davem@davemloft.net>2016-06-07 15:53:44 -0700
commitbe119913689724b6fe84caa779c2508547c4e8d5 (patch)
tree175c3ca36e719394ab7f882e2030d0c55b4487c8 /include
parente69985c67c33f1d981a87986237366e83a8f0e13 (diff)
parent48d8ee1694dd1ab25614b58f968123a4598f887e (diff)
downloadcachepc-linux-be119913689724b6fe84caa779c2508547c4e8d5.tar.gz
cachepc-linux-be119913689724b6fe84caa779c2508547c4e8d5.zip
Merge branch 'sch-action-tstamp'
Jamal Hadi Salim says: ==================== net sched action timestamp improvements Various aggregations of duplicated code, fixes and introduction of firstused timestamp v2: add const for source time info per suggestion from Cong ==================== Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r--include/net/act_api.h10
-rw-r--r--include/uapi/linux/pkt_cls.h1
2 files changed, 11 insertions, 0 deletions
diff --git a/include/net/act_api.h b/include/net/act_api.h
index 9a9a8edc138f..a891978310e9 100644
--- a/include/net/act_api.h
+++ b/include/net/act_api.h
@@ -76,6 +76,16 @@ static inline void tcf_lastuse_update(struct tcf_t *tm)
if (tm->lastuse != now)
tm->lastuse = now;
+ if (unlikely(!tm->firstuse))
+ tm->firstuse = now;
+}
+
+static inline void tcf_tm_dump(struct tcf_t *dtm, const struct tcf_t *stm)
+{
+ dtm->install = jiffies_to_clock_t(jiffies - stm->install);
+ dtm->lastuse = jiffies_to_clock_t(jiffies - stm->lastuse);
+ dtm->firstuse = jiffies_to_clock_t(jiffies - stm->firstuse);
+ dtm->expires = jiffies_to_clock_t(stm->expires);
}
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 {