Skip to content

xfrm: remove flow cache

Florian Westphal netdev 1 version In review

Get series with b4
b4 am [email protected]

Versions newest first

  1. v1 Latest10 patches 5 repliesIn review

Patches in v1 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/10drivers: net: add missing interrupt.h includedrivers/net/arcnet/arcdevice.h drivers/net/ethernet/amd/xgbe/xgbe.h drivers/net/ethernet/synopsys/dwc-xlgmac-net.c +1 more+4 -10 replies
2/10vti: revert flush x-netns xfrm cache when vti interface is removednet/ipv4/ip_vti.c net/ipv6/ip6_vti.c+0 -620 replies
3/10net: xfrm: revert to lower xfrm dst gc limitDocumentation/networking/ip-sysctl.txt net/ipv4/xfrm4_policy.c net/ipv6/xfrm6_policy.c+4 -60 replies
4/10xfrm_policy: bypass flow_cache_lookupnet/xfrm/xfrm_policy.c+5 -90 replies
5/10xfrm_policy: remove always true/false branchesnet/xfrm/xfrm_policy.c+14 -600 replies
6/10xfrm_policy: kill flow to policy dir conversionnet/xfrm/xfrm_policy.c+4 -420 replies
7/10xfrm_policy: remove xfrm_policy_lookupnet/xfrm/xfrm_policy.c+4 -320 replies
8/10xfrm_policy: make xfrm_bundle_lookup return xfrm dst objectnet/xfrm/xfrm_policy.c+12 -160 replies
9/10xfrm: remove flow cacheinclude/net/flow.h include/net/flowcache.h include/net/netns/xfrm.h +10 more+2 -7340 replies
10/10xfrm: add xdst pcpu cacheinclude/net/xfrm.h net/xfrm/xfrm_device.c net/xfrm/xfrm_policy.c +1 more+132 -30 replies

Reviews trailers per patch

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

Read the v1 thread

Cover letter [PATCH net-next 0/10] xfrm: remove flow cache

After RCU-ification of ipsec packet path there are no major scalability issues anymore without flow cache.

We still incur a performance hit, which comes mostly from the extra xfrm dst allocation/freeing.
The last patch in the series adds a simple percpu cache to avoid the extra allocation if a packet matched the same policies as last one.

The main concern with this is that we will see performance drops, especially with large numbers of policies/SAs.

However, during hallway discussions at nfws 2017 it seemed the issues with flow caching outweight the removal downsides, and that it might be best to just 'remove it' and see where the practical issues (if any) will appear.

It should now be possible to also remove the genid member in the policies as we don't hold bundles for prolonged time anymore, but I think this change is controversial (and intrusive) enough as-is, so defer that to a later point in time.

Changes since last rfc:

- fix build failures due to implicit interrupt.h includes
- rework last patch (pcpu cache):
* avoid xchg()
* check policies for walk.dead = 1 instead of more costly bundle_ok().
* flush pcpu bundles when sa/policies get removed, to allow module references to go away (suggested by Ilan Tayari)

Documentation/networking/ip-sysctl.txt         |    7
drivers/net/arcnet/arcdevice.h                 |    2
drivers/net/ethernet/amd/xgbe/xgbe.h           |    1
drivers/net/ethernet/synopsys/dwc-xlgmac-net.c |    1
drivers/net/ieee802154/ca8210.c                |    1
include/net/flow.h                             |   34 -
include/net/netns/xfrm.h                       |   11
include/net/xfrm.h                             |    9
net/core/Makefile                              |    1
net/ipv4/ip_vti.c                              |   31 -
net/ipv4/xfrm4_policy.c                        |   11
net/ipv6/ip6_vti.c                             |   31 -
net/ipv6/xfrm6_policy.c                        |   11
net/key/af_key.c                               |    6
net/xfrm/xfrm_device.c                         |    4
net/xfrm/xfrm_policy.c                         |  417 +++++++-----------
net/xfrm/xfrm_state.c                          |    5
net/xfrm/xfrm_user.c                           |    3
security/selinux/include/xfrm.h                |    4
include/net/flowcache.h                        |   25 -
net/core/flow.c                                |  516 -----------------------
 21 files changed, 173 insertions(+), 957 deletions(-)