xfrm: store xfrm_mode directly, not its address
authorFlorian Westphal <fw@strlen.de>
Fri, 29 Mar 2019 20:16:32 +0000 (21:16 +0100)
committerSteffen Klassert <steffen.klassert@secunet.com>
Mon, 8 Apr 2019 07:15:28 +0000 (09:15 +0200)
commitc9500d7b7de8ff6ac88ee3e38b782889f1616593
tree02e6040b32b9686f0f909e5e592dab6690be9275
parent4c145dce26013763490df88f2473714f5bc7857d
xfrm: store xfrm_mode directly, not its address

This structure is now only 4 bytes, so its more efficient
to cache a copy rather than its address.

No significant size difference in allmodconfig vmlinux.

With non-modular kernel that has all XFRM options enabled, this
series reduces vmlinux image size by ~11kb. All xfrm_mode
indirections are gone and all modes are built-in.

before (ipsec-next master):
    text      data      bss         dec   filename
21071494   7233140 11104324    39408958   vmlinux.master

after this series:
21066448   7226772 11104324    39397544   vmlinux.patched

With allmodconfig kernel, the size increase is only 362 bytes,
even all the xfrm config options removed in this series are
modular.

before:
    text      data     bss      dec   filename
15731286   6936912 4046908 26715106   vmlinux.master

after this series:
15731492   6937068  4046908  26715468 vmlinux

Signed-off-by: Florian Westphal <fw@strlen.de>
Reviewed-by: Sabrina Dubroca <sd@queasysnail.net>
Signed-off-by: Steffen Klassert <steffen.klassert@secunet.com>
13 files changed:
include/net/xfrm.h
net/ipv4/esp4_offload.c
net/ipv4/ip_vti.c
net/ipv4/xfrm4_output.c
net/ipv6/esp6_offload.c
net/ipv6/ip6_vti.c
net/ipv6/xfrm6_output.c
net/xfrm/xfrm_device.c
net/xfrm/xfrm_input.c
net/xfrm/xfrm_interface.c
net/xfrm/xfrm_output.c
net/xfrm/xfrm_policy.c
net/xfrm/xfrm_state.c