netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
* [PATCH net-next] xfrm: Make xfrm_state timer monotonic
@ 2013-08-06  6:57 Fan Du
  2013-08-06  9:22 ` Steffen Klassert
  0 siblings, 1 reply; 10+ messages in thread
From: Fan Du @ 2013-08-06  6:57 UTC (permalink / raw)
  To: steffen.klassert; +Cc: davem, netdev

xfrm_state timer should be independent of system clock change,
so switch to monotonic clock base.

Signed-off-by: Fan Du <fan.du@windriver.com>
---
 net/xfrm/xfrm_state.c |    2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 78f66fa..e57ab07 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -499,7 +499,7 @@ struct xfrm_state *xfrm_state_alloc(struct net *net)
 		INIT_HLIST_NODE(&x->bydst);
 		INIT_HLIST_NODE(&x->bysrc);
 		INIT_HLIST_NODE(&x->byspi);
-		tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler, CLOCK_REALTIME, HRTIMER_MODE_ABS);
+		tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler, CLOCK_MONOTONIC, HRTIMER_MODE_ABS);
 		setup_timer(&x->rtimer, xfrm_replay_timer_handler,
 				(unsigned long)x);
 		x->curlft.add_time = get_seconds();
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread
* [PATCHv2 net-next] xfrm: Make xfrm_state timer monotonic
@ 2013-08-15  7:49 Fan Du
  2013-08-15 21:23 ` David Miller
  0 siblings, 1 reply; 10+ messages in thread
From: Fan Du @ 2013-08-15  7:49 UTC (permalink / raw)
  To: steffen.klassert; +Cc: davem, netdev

xfrm_state timer should be independent of system clock change,
so switch to CLOCK_BOOTTIME base which is not only monotonic but
also counting suspend time.

Thus issue reported in commit: 9e0d57fd6dad37d72a3ca6db00ca8c76f2215454
("xfrm: SAD entries do not expire correctly after suspend-resume")
could ALSO be avoided.

Signed-off-by: Fan Du <fan.du@windriver.com>

v2: Use CLOCK_BOOTTIME to count suspend time, but still monotonic.

---
 net/xfrm/xfrm_state.c |    3 ++-
 1 file changed, 2 insertions(+), 1 deletion(-)

diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index 79bf9a0..0824679 100644
--- a/net/xfrm/xfrm_state.c
+++ b/net/xfrm/xfrm_state.c
@@ -486,7 +486,8 @@ struct xfrm_state *xfrm_state_alloc(struct net *net)
 		INIT_HLIST_NODE(&x->bydst);
 		INIT_HLIST_NODE(&x->bysrc);
 		INIT_HLIST_NODE(&x->byspi);
-		tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler, CLOCK_REALTIME, HRTIMER_MODE_ABS);
+		tasklet_hrtimer_init(&x->mtimer, xfrm_timer_handler,
+					CLOCK_BOOTTIME, HRTIMER_MODE_ABS);
 		setup_timer(&x->rtimer, xfrm_replay_timer_handler,
 				(unsigned long)x);
 		x->curlft.add_time = get_seconds();
-- 
1.7.9.5

^ permalink raw reply related	[flat|nested] 10+ messages in thread

end of thread, other threads:[~2013-08-16  9:30 UTC | newest]

Thread overview: 10+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2013-08-06  6:57 [PATCH net-next] xfrm: Make xfrm_state timer monotonic Fan Du
2013-08-06  9:22 ` Steffen Klassert
2013-08-12  5:40   ` [PATCHv2 " Fan Du
2013-08-13  7:55     ` Steffen Klassert
2013-08-13  8:37       ` Fan Du
2013-08-13 10:59         ` Steffen Klassert
2013-08-14 11:34     ` Steffen Klassert
  -- strict thread matches above, loose matches on Subject: below --
2013-08-15  7:49 Fan Du
2013-08-15 21:23 ` David Miller
2013-08-16  9:30   ` Steffen Klassert

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for NNTP newsgroup(s).