Page MenuHomeFreeBSD

netipsec: use SYSINIT(9) instead of dom_init/dom_destroy
ClosedPublic

Authored by glebius on Dec 17 2021, 6:57 PM.
Tags
None
Referenced Files
F103893171: D33539.id100260.diff
Sat, Nov 30, 8:20 PM
Unknown Object (File)
Oct 21 2024, 11:19 AM
Unknown Object (File)
Sep 25 2024, 8:42 AM
Unknown Object (File)
Sep 25 2024, 1:02 AM
Unknown Object (File)
Sep 24 2024, 4:14 PM
Unknown Object (File)
Sep 20 2024, 7:51 PM
Unknown Object (File)
Sep 19 2024, 10:39 AM
Unknown Object (File)
Sep 17 2024, 6:58 PM
Subscribers

Details

Summary

While here, use just static initializer for key_cb.

Diff Detail

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

Event Timeline

Added John and Wojciech, who recently committed to ipsec to confirm that my static initialization of key is fine.

sys/netipsec/key.c
8332

Do you want to make this SI_ORDER_THIRD so that key_init is guaranteed to run before key_vnet_init()?

8464–8465

So it's a bit odd that you split key_init() but not key_destroy().

sys/netipsec/key.c
8332

Thanks. I'd rather change key_init() to SI_ORDER_FIRST. The plan is that: global domain init is SI_ORDER_FIRST, vnet domain init is SI_ORDER_SECOND, global protocol init is SI_ORDER_THIRD and vnet protocol init is SI_ORDER_FOURTH. netipsec doesn't have any protocols sysinited, so for it doesn't matter, but should match overall style.

8464–8465

That's a good observation! As you see key_destroy() was all hidden under ifdef VIMAGE, so I expected that it has only VNET destroy stuff. But at the end it acts as if sysinit code may legitimately call on default vnet. AFAIK, key.c doesn't belong to any loadable module. This was added d8ba1ddc0f2049544d869e0f6843cdab764120c0 by @ae . I'll ask him.

Split key_destroy() into VNET and global parts. Leave a note that
global part is dead code today but exists for future.

This revision was not accepted when it landed; it landed in state Needs Review.Jan 3 2022, 6:23 PM
This revision was automatically updated to reflect the committed changes.

Sorry, I didn't see your earlier updates. I think your refactors after my earlier questions look good.