Page MenuHomeFreeBSD

Rework if_ipsec(4) to use epoch(9)-based locking model.
ClosedPublic

Authored by ae on Sep 17 2018, 10:38 AM.
Tags
None
Referenced Files
F81642617: D17190.id.diff
Fri, Apr 19, 9:45 AM
F81624428: D17190.id48117.diff
Fri, Apr 19, 4:08 AM
Unknown Object (File)
Thu, Apr 18, 5:04 AM
Unknown Object (File)
Thu, Apr 18, 12:01 AM
Unknown Object (File)
Jan 11 2024, 10:51 PM
Unknown Object (File)
Dec 9 2023, 7:58 AM
Unknown Object (File)
Dec 7 2023, 10:19 PM
Unknown Object (File)
Dec 7 2023, 10:18 PM
Subscribers

Details

Summary

Rework if_ipsec(4) to used epoch(9) instead of rmlock.

  • use CK_LIST and FNV hash to keep chains of softc;
  • read access to soft is protected by epoch();
  • write access is protected by ipsec_ioctl_sx. Change of softc fields allowed only when softc is unlinked from CK_LIST chains. And linking/unlinking is allowed only when ipsec_ioctl_sx is exclusive locked.
  • the plain LIST of all softc is replaced by hash table that uses ingress address of tunnels as key.
  • added support for appearing/disappearing of ingress address handling D17134. Now it is allowed configure non-local ingress IP address, and thus the problem with if_ipsec(4) configuration that happens on boot, when ingress address is not yet configured, is solved.

Diff Detail

Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 19616
Build 19192: arc lint + arc unit

Event Timeline

ae edited the summary of this revision. (Show Details)

Deduplicate the code that deletes softc from srchash.
And add another IPSEC_WAIT() to fix possible race in ipsec_if_input().

This revision was not accepted when it landed; it landed in state Needs Review.Oct 21 2018, 6:24 PM
This revision was automatically updated to reflect the committed changes.