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
Unknown Object (File)
Fri, Apr 12, 6:47 AM
Unknown Object (File)
Mar 11 2024, 3:51 AM
Unknown Object (File)
Mar 11 2024, 3:47 AM
Unknown Object (File)
Mar 11 2024, 3:42 AM
Unknown Object (File)
Mar 11 2024, 3:42 AM
Unknown Object (File)
Mar 10 2024, 10:16 PM
Unknown Object (File)
Feb 28 2024, 10:08 AM
Unknown Object (File)
Feb 11 2024, 5:14 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.