Page MenuHomeFreeBSD

IPv6: rc boot time improvements
Needs ReviewPublic

Authored by bz on Nov 10 2021, 12:11 AM.
Tags
None
Referenced Files
Unknown Object (File)
Sun, May 10, 8:14 AM
Unknown Object (File)
Fri, May 8, 8:58 PM
Unknown Object (File)
Sat, May 2, 12:07 AM
Unknown Object (File)
Wed, Apr 29, 10:36 AM
Unknown Object (File)
Apr 24 2026, 12:34 PM
Unknown Object (File)
Apr 24 2026, 8:49 AM
Unknown Object (File)
Apr 21 2026, 7:06 PM
Unknown Object (File)
Apr 20 2026, 9:44 AM
Subscribers
This revision needs review, but there are no reviewers specified.

Details

Reviewers
None
Summary

This is a first cut to improve boot time for IPv6.
Hisotrically we did sleep quite a lot more than we needed.

If IPv6 is enabled we call rtsol on that interface so waiting in
rtsold is counterproductive; if one was to just use rtsold -F then
they are on their own for having the addresses usable during the
remaining startup time.

Rather than sleeping dad_count + 1 seconds we are now checking for
any tentative addresses on the interface and only then slee
dad_count up-to 2 times. This should not save us anything with the
defaults but there are too many assumptions invovled anyway
(RETRANS_TIMER in the kernel being 1000ms being one).
The reason why we need to sleep more than dad_count (1s default)
seems to be that first DAD for the link-local address clears and
only then solicited (or other global) addresses are handled.

Diff Detail

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

Event Timeline

bz requested review of this revision.Nov 10 2021, 12:11 AM

Just a first cut for your testing to see what difference it makes?
I would assume you'd sleep 2 rather than 4 seconds.

I'll add reviewers once we have initial results.

libexec/rc/network.subr
51

This is unrelated for this and should be a follow-up to an old commit I once did ... (lookup hash and factor out here). Should not matter anyway.

1749

This should be done separately as well; we are only interested in inet6 addresses so avoid printing a load of other stuff.

More unrelated noise in the change.

libexec/rc/rc.d/netif
228

Also unrelated: moving the interfaces between vnets does not need DAD as we should never move addresses (link-local maybe on the vnetdown case) but really interface address configuration in that case is what matters and not the interface appearing.

On the IPv4 side, when /etc/rc.d/dhclient runs, it gets an IPv4 address before the dhclient process is backgrounded and the boot process continues; so anything which comes later in the boot process is guaranteed to see the necessary addresses.

On the IPv6 side, I don't think we have any sort of deliberate wait-for-addresses-to-arrive... except that we might be getting that accidentally thanks to the extra sleeping here?