* [PATCH ipsec-next] xfrm: state lookup can be lockless
@ 2016-09-20 13:45 Florian Westphal
2016-09-22 7:52 ` Steffen Klassert
0 siblings, 1 reply; 2+ messages in thread
From: Florian Westphal @ 2016-09-20 13:45 UTC (permalink / raw)
To: netdev; +Cc: Florian Westphal
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>
---
net/xfrm/xfrm_state.c | 4 ++--
1 file changed, 2 insertions(+), 2 deletions(-)
diff --git a/net/xfrm/xfrm_state.c b/net/xfrm/xfrm_state.c
index ba8bf51..a38fdea 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);
--
2.7.3
^ permalink raw reply related [flat|nested] 2+ messages in thread
end of thread, other threads:[~2016-09-22 7:53 UTC | newest]
Thread overview: 2+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2016-09-20 13:45 [PATCH ipsec-next] xfrm: state lookup can be lockless Florian Westphal
2016-09-22 7:52 ` Steffen Klassert
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox