Page MenuHomeFreeBSD

ipsec key_havesp changes
ClosedPublic

Authored by mjg on Sep 7 2022, 8:40 PM.
Tags
None
Referenced Files
Unknown Object (File)
Fri, Oct 18, 12:45 PM
Unknown Object (File)
Oct 2 2024, 8:00 PM
Unknown Object (File)
Oct 2 2024, 7:29 PM
Unknown Object (File)
Oct 1 2024, 9:33 AM
Unknown Object (File)
Sep 30 2024, 1:41 PM
Unknown Object (File)
Sep 30 2024, 1:33 PM
Unknown Object (File)
Sep 30 2024, 1:32 PM
Unknown Object (File)
Sep 30 2024, 1:31 PM

Details

Summary
commit fe05dca7774e98adfeb1faefe8b98d6b398eae53 (HEAD -> ipsec)
Author: Mateusz Guzik <mjg@FreeBSD.org>
Date:   Wed Sep 7 22:05:38 2022 +0200

    ipsec: add key_havesp_any
    
    Saves on work in a common case of checking both directions.
    
    Note further work in the area is impending to elide these in the common
    case to begin with.
    
    Reviewed by:
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:

commit bec3c2d77d20bcc76a92f86f7340d1008b6e847d
Author: Mateusz Guzik <mjg@FreeBSD.org>
Date:   Wed Sep 7 22:27:15 2022 +0200

    ipsec: prohibit unknown directions in key_havesp
    
    Eliminates a branch checking for its validity.
    
    Reviewed by:
    Sponsored by:   Rubicon Communications, LLC ("Netgate")
    Differential Revision:

compiled in but disabled ipsec shows up on profiles, see https://github.com/ocochard/netbenches/blob/master/Xeon_E5-2697Av4_16Cores-Mellanox_ConnectX-4/firewalls/results/fbsd14-n277887-IPSEC/README.md

the above is an initial step towards fixing that problem

later I'm going to create a combined var recalculated on each V_forwarding + key_havesp_any change so that no function calls will be issued to begin with.

this in ip_input:

        if (V_ipforwarding != 0
#if defined(IPSEC) || defined(IPSEC_SUPPORT)
            && (!IPSEC_ENABLED(ipv4) ||
            IPSEC_CAPS(ipv4, m, IPSEC_CAP_OPERABLE) == 0)
#endif
            ) {

will collapse into

if (V_ipcantryforward != 0) {

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable