Page MenuHomeFreeBSD

ifnet: Initialize address family dependent data region earlier
AcceptedPublic

Authored by zlei on Fri, Mar 14, 11:56 AM.
Tags
None
Referenced Files
Unknown Object (File)
Mon, Mar 17, 11:11 PM
Unknown Object (File)
Mon, Mar 17, 3:53 AM
Unknown Object (File)
Sun, Mar 16, 4:22 AM
Unknown Object (File)
Sun, Mar 16, 12:33 AM
Subscribers

Details

Reviewers
glebius
melifaro
Group Reviewers
network
Summary

if_link_ifnet() add the interface to global network interface list, and
is a natural synchronization point, i.e., any threads that obtain the
reference of the interface via ifunit(), ifunit_ref() e.g., can see the
address family dependent data.

Currently there's no reports about the potential synchronization issue,
but we can make guarantee that it will never happen.

MFC after: 2 weeks

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Skipped
Unit
Tests Skipped

Event Timeline

zlei requested review of this revision.Fri, Mar 14, 11:56 AM

This depends on D49357 , as if_attachdomain1() tries to update in6_maxmtu .

This looks correct to me. Does it fix any uninitialized af_data races? If it does, that is a strong MFC candidate.

P.S. You may want to move it even down lower beyond EVENTHANDLER_INVOKE(ifnet_arrival_event, ifp). But not in this commit. The if_attachdomain() is a 1980s relic, long before EVENTHANDLER(9) was introduced to kernel. My vague hand-waving plan on attacking the uninitialized af_data problem is to switch to EVENTHANDLER(9) and code a proper sequence. This reminds me work of moving domains/protocols to SYSINIT(9): 89128ff3e42196c8b41a3c59f7a2d95c0a4ac0ee, 24e1c6ae7d3f7731a0884a62e9d5273e5ca1335a, 81a34d374ed6e5a7b14f24583bc8e3abfdc66306.

This revision is now accepted and ready to land.Fri, Mar 14, 5:03 PM