Patchwork [net-next] xfrm: Make xfrm_state timer monotonic

login
register
mail settings
Submitter fan.du
Date Aug. 6, 2013, 6:57 a.m.
Message ID <1375772225-19265-1-git-send-email-fan.du@windriver.com>
Download mbox | patch
Permalink /patch/264882/
State Rejected
Delegated to: David Miller
Headers show

Comments

fan.du - Aug. 6, 2013, 6:57 a.m.
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(-)
Steffen Klassert - Aug. 6, 2013, 9:22 a.m.
On Tue, Aug 06, 2013 at 02:57:05PM +0800, Fan Du wrote:
> xfrm_state timer should be independent of system clock change,
> so switch to monotonic clock base.
> 

I think a monotonic timer will reintroduce a bug on suspend/resume
that was fixed by commit 9e0d57fd6
(xfrm: SAD entries do not expire correctly after suspend-resume)

Please make sure that this does not happen.
--
To unsubscribe from this list: send the line "unsubscribe netdev" in
the body of a message to majordomo@vger.kernel.org
More majordomo info at  http://vger.kernel.org/majordomo-info.html

Patch

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();