Skip to content

xfrm: remove xfrm_mode indirections

Florian Westphal netdev 2 versions – In review

Get series with b4
b4 am [email protected]

Versions newest first · linked by author and title

  1. v2 Latest11 patches 2 repliesIn review
  2. v111 patches 10 repliesSuperseded

Patches in v2 No applies recorded yet

#Subject and filesSizeRepliesApplied
1/11xfrm: place af number into xfrm_mode structinclude/net/xfrm.h net/ipv4/xfrm4_mode_beet.c net/ipv4/xfrm4_mode_transport.c +6 more+32 -520 replies
2/11xfrm: prefer family stored in xfrm_mode structnet/ipv4/ip_vti.c net/ipv6/ip6_vti.c net/xfrm/xfrm_input.c +1 more+5 -50 replies
3/11xfrm: remove input indirection from xfrm_modeinclude/net/xfrm.h net/ipv4/xfrm4_mode_beet.c net/ipv4/xfrm4_mode_transport.c +5 more+72 -660 replies
4/11xfrm: remove output indirection from xfrm_modeinclude/net/xfrm.h net/core/pktgen.c net/ipv4/xfrm4_mode_beet.c +9 more+169 -1280 replies
5/11xfrm: remove xmit indirection from xfrm_modeinclude/net/xfrm.h net/ipv4/xfrm4_mode_transport.c net/ipv4/xfrm4_mode_tunnel.c +3 more+56 -600 replies
6/11xfrm: remove gso_segment indirection from xfrm_modeinclude/net/xfrm.h net/ipv4/esp4_offload.c net/ipv4/xfrm4_mode_transport.c +4 more+78 -580 replies
7/11xfrm: remove input2 indirection from xfrm_modeinclude/net/xfrm.h net/ipv4/xfrm4_mode_beet.c net/ipv4/xfrm4_mode_tunnel.c +4 more+222 -1730 replies
8/11xfrm: remove output2 indirection from xfrm_modeinclude/net/xfrm.h net/ipv4/xfrm4_mode_beet.c net/ipv4/xfrm4_mode_tunnel.c +3 more+207 -2240 replies
9/11xfrm: remove afinfo pointer from xfrm_modeinclude/net/xfrm.h net/ipv4/xfrm4_output.c net/ipv6/xfrm6_output.c +4 more+80 -140 replies
10/11xfrm: make xfrm modes builtininclude/net/xfrm.h net/ipv4/Kconfig net/ipv4/Makefile +17 more+81 -4930 replies
11/11xfrm: store xfrm_mode directly, not its addressinclude/net/xfrm.h net/ipv4/esp4_offload.c net/ipv4/ip_vti.c +10 more+55 -550 replies

Reviews trailers per patch

None of the 11 patches has a Reviewed-by or Acked-by of their own; the series has one for all of them.

PatchSabrina Dubroca
SeriesR-b
1/11
2/11
3/11
4/11
5/11
6/11
7/11
8/11
9/11
10/11
11/11

Trailers given in replies are filled; those carried in the patches from earlier versions are outlined with dashes.

Read the v2 thread

Cover letter [PATCH v2 ipsec-next 00/11] xfrm: remove xfrm_mode indirections

This series removes all function pointers from the xfrm_mode struct. They are either replaced by direct calls or a static helper.

This reduces code size: even merging all xfrm{4,6}_,mode* modules into the core reduces total size, as the infrastructure to maintain dynamic (un)register can be removed.

There are more opportunities for indirection avoidance, e.g. in xfrm_type. I plan to follow up once/if this series is accepted.

Tested with xfrm tunnel mode via netns with esp/aead.

I'd like thank Benedict Wong for running Android unit tests and taking the time to bisect a tunnel mode breakage added by v1 of this patch set.

I've addressed the comments/feedback from Sabrina and Eyal. The kbuild robot reported build breakage in patch #8 is fixed as well.

I've not addressed the sparse warning reported by the kbuild robot -- those warnings are in code not touched by this patch set.

Florian Westphal (11):
xfrm: place af number into xfrm_mode struct
xfrm: prefer family stored in xfrm_mode struct
xfrm: remove input indirection from xfrm_mode
xfrm: remove output indirection from xfrm_mode
xfrm: remove xmit indirection from xfrm_mode
xfrm: remove gso_segment indirection from xfrm_mode
xfrm: remove input2 indirection from xfrm_mode
xfrm: remove output2 indirection from xfrm_mode
xfrm: remove afinfo pointer from xfrm_mode
xfrm: make xfrm modes builtin
xfrm: store xfrm_mode directly, not its address

 include/net/xfrm.h                 |  106 ++-------
 net/core/pktgen.c                  |    2 
 net/ipv4/Kconfig                   |   29 --
 net/ipv4/Makefile                  |    3 
 net/ipv4/esp4_offload.c            |   40 +++
 net/ipv4/ip_vti.c                  |    6 
 net/ipv4/xfrm4_output.c            |   27 +-
 net/ipv6/Kconfig                   |   35 ---
 net/ipv6/Makefile                  |    4 
 net/ipv6/esp6_offload.c            |   40 +++
 net/ipv6/ip6_vti.c                 |    6 
 net/ipv6/xfrm6_output.c            |   36 +--
 net/xfrm/xfrm_device.c             |   58 +++++
 net/xfrm/xfrm_inout.h              |   38 +++
 net/xfrm/xfrm_input.c              |  299 ++++++++++++++++++++++++++-
 net/xfrm/xfrm_interface.c          |    6 
 net/xfrm/xfrm_output.c             |  377 ++++++++++++++++++++++++++++++++++-
 net/xfrm/xfrm_policy.c             |   14 +
 net/xfrm/xfrm_state.c              |  181 ++++++----------
 tools/testing/selftests/net/config |    2 
 net/ipv4/xfrm4_mode_beet.c         |  155 --------------
 net/ipv4/xfrm4_mode_transport.c    |  114 ----------
 net/ipv4/xfrm4_mode_tunnel.c       |  152 --------------
 net/ipv6/xfrm6_mode_beet.c         |  131 ------------
 net/ipv6/xfrm6_mode_ro.c           |   85 -------
 net/ipv6/xfrm6_mode_transport.c    |  121 -----------
 net/ipv6/xfrm6_mode_tunnel.c       |  151 --------------
 27 files changed, 976 insertions(+), 1247 deletions(-)