提交 c2f672fc 编写于 作者: F Florian Westphal 提交者: Steffen Klassert

xfrm: state lookup can be lockless

This is called from the packet input path, we get lock contention
if many cpus handle ipsec in parallel.

After recent rcu conversion it is safe to call __xfrm_state_lookup
without the spinlock.
Signed-off-by: NFlorian Westphal <fw@strlen.de>
Signed-off-by: NSteffen Klassert <steffen.klassert@secunet.com>
上级 34a3d4b2
......@@ -1431,9 +1431,9 @@ xfrm_state_lookup(struct net *net, u32 mark, const xfrm_address_t *daddr, __be32
{
struct xfrm_state *x;
spin_lock_bh(&net->xfrm.xfrm_state_lock);
rcu_read_lock();
x = __xfrm_state_lookup(net, mark, daddr, spi, proto, family);
spin_unlock_bh(&net->xfrm.xfrm_state_lock);
rcu_read_unlock();
return x;
}
EXPORT_SYMBOL(xfrm_state_lookup);
......
Markdown is supported
0% .
You are about to add 0 people to the discussion. Proceed with caution.
先完成此消息的编辑!
想要评论请 注册