diff options
author | Florian Westphal <fw@strlen.de> | 2016-09-20 15:45:26 +0200 |
---|---|---|
committer | Steffen Klassert <steffen.klassert@secunet.com> | 2016-09-21 12:37:29 +0200 |
commit | c2f672fc94642bae96821a393f342edcfa9794a6 (patch) | |
tree | 4dd04af628613f0aa692a2f811cf1deb89c4419e | |
parent | 34a3d4b2d1f1b7c81af79f6f93a6cef4c3a0f54a (diff) | |
download | linux-c2f672fc94642bae96821a393f342edcfa9794a6.tar.bz2 |
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: Florian Westphal <fw@strlen.de>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
-rw-r--r-- | net/xfrm/xfrm_state.c | 4 |
1 files changed, 2 insertions, 2 deletions
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c index ba8bf518ba14..a38fdead38ea 100644 --- a/net/xfrm/xfrm_state.c +++ b/net/xfrm/xfrm_state.c @@ -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); |