Commit 28aecb9d authored by Eric Dumazet's avatar Eric Dumazet Committed by David S. Miller

xfrm: avoid spinlock in get_acqseq()

Use atomic_inc_return() in get_acqseq() to avoid taking a spinlock
Signed-off-by: default avatarEric Dumazet <>
Signed-off-by: default avatarDavid S. Miller <>
parent d1c9ae6d
......@@ -3019,12 +3019,11 @@ static int pfkey_send_policy_notify(struct xfrm_policy *xp, int dir, struct km_e
static u32 get_acqseq(void)
u32 res;
static u32 acqseq;
static DEFINE_SPINLOCK(acqseq_lock);
static atomic_t acqseq;
res = (++acqseq ? : ++acqseq);
do {
res = atomic_inc_return(&acqseq);
} while (!res);
return res;
Markdown is supported
0% or
You are about to add 0 people to the discussion. Proceed with caution.
Finish editing this message first!
Please register or to comment