Page MenuHomeFreeBSD

ifnet: allocate index at the end of if_alloc_domain()
ClosedPublic

Authored by glebius on Dec 4 2021, 9:13 PM.
Tags
None
Referenced Files
F163411472: D33259.id99577.diff
Wed, Jul 22, 11:46 PM
Unknown Object (File)
Mon, Jul 20, 4:34 AM
Unknown Object (File)
Sun, Jul 19, 5:27 PM
Unknown Object (File)
Sat, Jul 18, 11:32 AM
Unknown Object (File)
Sun, Jul 5, 8:38 AM
Unknown Object (File)
Thu, Jul 2, 5:23 AM
Unknown Object (File)
Jun 20 2026, 8:19 AM
Unknown Object (File)
Jun 15 2026, 2:57 AM
Subscribers

Details

Summary

Now that if_alloc_domain() never fails and actually doesn't
expose ifnet to outside we can eliminate IFNET_HOLD and two
step index allocation.

Diff Detail

Repository
rS FreeBSD src repository - subversion
Lint
Lint Passed
Unit
No Test Coverage
Build Status
Buildable 43138
Build 40026: arc lint + arc unit

Event Timeline

Apart from the suggestion this looks fine.

sys/net/if.c
636

idx here could right away be ifp->ifindex like it is done in if_vmove() further down and then the new "assignment" in ifnet_setbyindex() doesn't have to be there either as it is not related to that function (it is the reverse).

sys/net/if.c
636

That's what next revisions do. Collapse ifindex_alloc, ifnet_setbyindex and if_grow.

This revision is now accepted and ready to land.Dec 6 2021, 10:47 AM