Skip to content

xfrm: remove xfrm_state_get_afinfo conditional rcu locking

Florian Westphal netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest6 patches 1 replyIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/6xfrm: remove unused functionnet/ipv4/xfrm4_state.c+0 -80 replies
2/6xfrm: avoid rcu sparse warningnet/xfrm/xfrm_state.c+8 -80 replies
3/6xfrm: remove xfrm_state_put_afinfoinclude/net/xfrm.h net/xfrm/xfrm_output.c net/xfrm/xfrm_state.c+16 -240 replies
4/6xfrm: add and use xfrm_state_afinfo_get_rcuinclude/net/xfrm.h net/xfrm/xfrm_state.c+16 -100 replies
5/6xfrm: state: simplify rcu_read_unlock handling in two spotsnet/xfrm/xfrm_state.c+7 -60 replies
6/6xfrm: remove xfrm_state_get_afinfoinclude/net/xfrm.h net/xfrm/xfrm_output.c net/xfrm/xfrm_state.c+62 -390 replies

Reviews trailers per patch

No Reviewed-by, Acked-by or Tested-by trailers for v1 yet.

Read the v1 thread

Cover letter [PATCH ipsec-next 0/6] xfrm: remove xfrm_state_get_afinfo conditional rcu locking

xfrm_state_get_afinfo still uses a conditional locking scheme dating back to when this still used an rwlock:

If return value is NULL, no lock (rcu readlock) was taken, otherwise, rcu_read_unlock has to be called.

This series moves rcu read lock/unlock responsibility to the callers.

xfrm_state_put_afinfo is removed (it is equivalent to rcu_read_unlock so thats what will be used instead).

xfrm_state_get_afinfo is renamed to xfrm_state_afinfo_get_rcu() and is only a rcu dereference wrapper.

In one case, rcu read/unlock can be avoided as we're always called with rcu read lock held.