diff options
author | Tobias Brunner <tobias@strongswan.org> | 2016-09-21 10:16:00 +0200 |
---|---|---|
committer | Tobias Brunner <tobias@strongswan.org> | 2016-09-30 14:54:52 +0200 |
commit | ac9759a53270bfdb26ff73226209ee290320c4d5 (patch) | |
tree | eab983000d76fc6aa053b2c5992eca5465109fcf /src/_updown/Makefile.am | |
parent | dbff6373e104123c51a71033ba6f9fe874a980fa (diff) | |
download | strongswan-ac9759a53270bfdb26ff73226209ee290320c4d5.tar.bz2 strongswan-ac9759a53270bfdb26ff73226209ee290320c4d5.tar.xz |
kernel-netlink: Support configuring XFRM policy hashing thresholds
If the number of flows over a gateway exceeds the flow cache size of the Linux
kernel, policy lookup gets very expensive. Policies covering more than a single
address don't get hash-indexed by default, which results in wasting most of
the cycles in xfrm_policy_lookup_bytype() and its xfrm_policy_match() use.
Starting with several hundred policies the overhead gets inacceptable.
Starting with Linux 3.18, Linux can hash the first n-bit of a policy subnet
to perform indexed lookup. With correctly chosen netbits, this can completely
eliminate the performance impact of policy lookups, freeing the resources
for ESP crypto.
WARNING: Due to a bug in kernels 3.19 through 4.7, the kernel crashes with a
NULL pointer dereference if a socket policy is installed while hash thresholds
are changed. And because the hashtable rebuild triggered by the threshold
change that causes this is scheduled it might also happen if the socket
policies are seemingly installed after setting the thresholds.
The fix for this bug - 6916fb3b10b3 ("xfrm: Ignore socket policies when
rebuilding hash tables") - is included since 4.8 (and might get backported).
As a workaround `charon.plugins.kernel-netlink.port_bypass` may be enabled
to replace the socket policies that allow IKE traffic with port specific
bypass policies.
Diffstat (limited to 'src/_updown/Makefile.am')
0 files changed, 0 insertions, 0 deletions