Skip to content

: Improve SA insert/delete performance

David Miller netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 4 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10: [XFRM]: Pull xfrm_state_bydst hash table knowledge out of afinfo.include/net/xfrm.h net/ipv4/xfrm4_state.c net/ipv6/xfrm6_state.c +1 more+115 -1470 replies
2/10: [XFRM]: Pull xfrm_state_byspi hash table knowledge out of afinfo.include/net/xfrm.h net/ipv4/xfrm4_state.c net/ipv6/xfrm6_state.c +1 more+39 -740 replies
3/10: [XFRM]: Move SPI hashing functions local to xfrm_state.cinclude/net/xfrm.h net/xfrm/xfrm_state.c+32 -320 replies
4/10: [XFRM]: Convert xfrm_state hash linkage to hlists.include/net/xfrm.h net/xfrm/xfrm_state.c+41 -340 replies
5/10: [XFRM]: Dynamic xfrm_state hash table sizing.include/linux/bootmem.h mm/page_alloc.c net/xfrm/xfrm_state.c+165 -392 replies
6/10: [XFRM]: Add generation count to xfrm_state and xfrm_dst.include/net/xfrm.h net/ipv4/xfrm4_policy.c net/ipv6/xfrm6_policy.c +2 more+10 -00 replies
7/10: [XFRM]: Put more keys into destination hash function.net/xfrm/xfrm_state.c+23 -210 replies
8/10: [XFRM]: Simplify xfrm_spi_hashnet/xfrm/xfrm_state.c+6 -210 replies
9/10: [XFRM]: Do not flush all bundles on SA insert.include/net/xfrm.h net/xfrm/xfrm_policy.c net/xfrm/xfrm_state.c+20 -160 replies
10/10: [XFRM]: Purge dst references to deleted SAs passively.include/net/xfrm.h net/xfrm/xfrm_policy.c net/xfrm/xfrm_state.c+1 -190 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH 0/10]: Improve SA insert/delete performance

[ Jamal, you saw the first 5 patches already, the rest is new
stuff. ]

These patches against the net-2.6 GIT tree try to address some serious IPSEC SA insert/delete performance problems noticed by Jamal.

1) Use dynamic hash table sizing for the xfrm_state lookup tables.

2) Do not walk all policies and flush bundles on xfrm_state changes, instead:
a) On delete, just allow pending references to deleted xfrm_state objects to be handled by policy GC and xfrm_dst_check() which runs on every use of a cached xfrm dst route
b) On insert, find xfrm_state objects that might alias with the one we are about to insert. For all such aliases, update their generation cound which will force xfrm_bundle_ok() (and thus xfrm_dst_check) to consider the route stale, forcing a relookup.

Patches forthcoming.