Skip to content

Commit b15e626

Browse files
Roman Mashakdavem330
authored andcommitted
net sched: fix reporting the first-time use timestamp
When a new action is installed, firstuse field of 'tcf_t' is explicitly set to 0. Value of zero means "new action, not yet used"; as a packet hits the action, 'firstuse' is stamped with the current jiffies value. tcf_tm_dump() should return 0 for firstuse if action has not yet been hit. Fixes: 48d8ee1 ("net sched actions: aggregate dumping of actions timeinfo") Cc: Jamal Hadi Salim <[email protected]> Signed-off-by: Roman Mashak <[email protected]> Acked-by: Jamal Hadi Salim <[email protected]> Signed-off-by: David S. Miller <[email protected]>
1 parent e3f2d55 commit b15e626

File tree

1 file changed

+2
-1
lines changed

1 file changed

+2
-1
lines changed

include/net/act_api.h

Lines changed: 2 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -75,7 +75,8 @@ static inline void tcf_tm_dump(struct tcf_t *dtm, const struct tcf_t *stm)
7575
{
7676
dtm->install = jiffies_to_clock_t(jiffies - stm->install);
7777
dtm->lastuse = jiffies_to_clock_t(jiffies - stm->lastuse);
78-
dtm->firstuse = jiffies_to_clock_t(jiffies - stm->firstuse);
78+
dtm->firstuse = stm->firstuse ?
79+
jiffies_to_clock_t(jiffies - stm->firstuse) : 0;
7980
dtm->expires = jiffies_to_clock_t(stm->expires);
8081
}
8182

0 commit comments

Comments
 (0)