xfrm: Remove xfrmi interface ID from flowi
Benedict Wong authored
In order to remove performance impact of having the extra u32 in every
single flowi, this change removes the flowi_xfrm struct, prefering to
take the if_id as a method parameter where needed.

In the inbound direction, if_id is only needed during the
__xfrm_check_policy() function, and the if_id can be determined at that
point based on the skb. As such, xfrmi_decode_session() is only called
with the skb in __xfrm_check_policy().

In the outbound direction, the only place where if_id is needed is the
xfrm_lookup() call in xfrmi_xmit2(). With this change, the if_id is
directly passed into the xfrm_lookup_with_ifid() call. All existing
callers can still call xfrm_lookup(), which uses a default if_id of 0.

This change does not change any behavior of XFRMIs except for improving
overall system performance via flowi size reduction.

This change has been tested against the Android Kernel Networking Tests:

https://android.googlesource.com/kernel/tests/+/master/net/test

Signed-off-by: default avatarBenedict Wong <benedictwong@google.com>
Signed-off-by: default avatarSteffen Klassert <steffen.klassert@secunet.com>
bc56b334
Name Last commit Last update
Documentation Merge tag 'dma-rename-4.18' of git://git.infradead.org/users/hch/dma-mapping
LICENSES LICENSES: Add Linux-OpenIB license text
arch Merge branch 'for-linus' of git://git.kernel.org/pub/scm/linux/kernel/git/s390/linux
block Merge tag 'for-linus-20180616' of git://git.kernel.dk/linux-block
certs docs: Fix some broken references
crypto docs: Fix some broken references
drivers r8169: enable ASPM on RTL8168E-VL
firmware kbuild: remove all dummy assignments to obj-
fs proc: fix missing final NUL in get_mm_cmdline() rewrite
include xfrm: Remove xfrmi interface ID from flowi
init dma-mapping: move all DMA mapping code to kernel/dma
ipc rhashtable: split rhashtable.h
kernel Merge git://git.kernel.org/pub/scm/linux/kernel/git/davem/net
lib rhashtable: clean up dereference of ->future_tbl.
mm revert "mm/memblock: add missing include <linux/bootmem.h>"
net xfrm: Remove xfrmi interface ID from flowi
samples Merge tag 'vfio-v4.18-rc1' of git://github.com/awilliam/linux-vfio
scripts scripts/documentation-file-ref-check: check tools/*/Documentation
security docs: Fix some broken references
sound docs: Fix some broken references
tools selftests: rtnetlink: use a local IP address for IPsec tests
usr kbuild: rename built-in.o to built-in.a
virt Merge tag 'overflow-v4.18-rc1-part2' of git://git.kernel.org/pub/scm/linux/kernel/git/kees/linux
.clang-format clang-format: add configuration file
.cocciconfig scripts: add Linux .cocciconfig for coccinelle
.get_maintainer.ignore
.gitattributes
.gitignore
.mailmap
COPYING
CREDITS
Kbuild
Kconfig
MAINTAINERS
Makefile
README
Linux kernel
============

There are several guides for kernel developers and users. These guides can
be rendered in a number of formats, like HTML and PDF. Please read
Documentation/admin-guide/README.rst first.

In order to build the documentation, use ``make htmldocs`` or
``make pdfdocs``.  The formatted documentation can also be read online at:

    https://www.kernel.org/doc/html/latest/

There are various text files in the Documentation/ subdirectory,
several of them using the Restructured Text markup notation.
See Documentation/00-INDEX for a list of what is contained in each file.

Please read the Documentation/process/changes.rst file, as it contains the
requirements for building and running the kernel, and information about
the problems which may result by upgrading your kernel.