- MP-safe drivers provide a mutex to ifmedia that is used to serialize
access to media-related structures / hardware regsiters. Converted
drivers use the new ifmedia_init_with_lock() function for this. The
new name is provided to ease the transition.
- Un-converted drivers continue to call ifmedia_init(), which will supply
a compatibility lock to be used instead. Several media-related entry
points must be aware of this compatibility lock, and are able to acquire
it recursively a limited number of times, if needed. This is a SPIN
mutex with priority IPL_NET.
- This same lock is used to serialize access to PHY registers and other
MII-related data structures.
The PHY drivers are modified to acquire and release the lock, as needed,
and assert the lock is held as a diagnostic aid.
The "usbnet" framework has had an overhaul of its internal locking
protocols to fit in with the media / mii changes, and the drivers adapted.
USB wifi drivers have been changed to provide their own adaptive mutex
to the ifmedia later via a new ieee80211_media_init_with_lock() function.
This is required because the USB drivers need an adaptive mutex.
Besised "usbnet", a few other drivers are converted: vmx, wm, ixgbe / ixv.
mcx also now calls ifmedia_init_with_lock() because it needs to also use
an adaptive mutex. The mcx driver still needs to be fully converted to
NET_MPSAFE.
instead of the current process credentials (which can change via
set{e,}{u,g}id(2)) and by passing the fd to a different process. This makes
the routing socket behave like other file descriptors. Proposed in tech-kern.
must be serialized against the interrupts / soft-interrupts in which
they're manipulated, as well as protected from non-atomic 64-bit memory
loads on 32-bit platforms.
the conditional in place for a time in case serious problems are discovered,
so that the Old Way can be re-enabled quickly. After some time, the Old
Way will be removed completely.
an ifmedia. Currently calls ifmedia_removeall(). All drivers
that call ifmedia_init() and support detach should call this
routine.
- In ifmedia_delete_instance(), set ifm->ifm_cur to NULL and
ifm->ifm_media to IFM_NONE when removing / freeing that entry,
not simply when we've been asked to delete every media instance.
in per-cpu storage, and collecting them for export in an if_data structure
when user-space wants them.
The new if_stat API is structured to make a gradual transition to the
new way in network drivers possible, and per-cpu stats are currently
disabled (thus there is no kernel ABI change). Once all drivers have
been converted, the old ABI will be removed, and per-cpu stats will be
enabled universally.
defined as a "void *" to prevent using a net_stat_ref_t as an array.
- For each _NET_STATADD(), etc. macro, also define a _NET_STATADD_REF()
macro that takes a ref returned by _NET_STAT_GETREF() as an argument.
This is intended to replace direct subscripting of the refernce;
consumers of this API will be updated in future commits.
For non-NET_MPSAFE, this is benign, because we can nest raising to
splnet(). For the NET_MPSAFE, it means that drivers don't need to
raise to splnet() just in order to call ifmedia_ioctl().
this provides the correct source mac address for the packets.
there are routers out there that cache the source mac during
nd and then subsequently bypass/miss packet filters on carp
interfaces as they send to the parent interface mac instead of the
correct carp interface mac.