diff options
| author | ozaki-r <ozaki-r@NetBSD.org> | 2016-06-10 13:31:43 +0000 |
|---|---|---|
| committer | ozaki-r <ozaki-r@NetBSD.org> | 2016-06-10 13:31:43 +0000 |
| commit | 9d07c6951111af4da6c06f9194f7be7164089c5e (patch) | |
| tree | e85ada1323d51fa8b195fc579719c0bc06edf174 /sys/dev/microcode/rum | |
| parent | 758ba73ee55c20eff84a121752cf7d6087976630 (diff) | |
Avoid storing a pointer of an interface in a mbuf
Having a pointer of an interface in a mbuf isn't safe if we remove big
kernel locks; an interface object (ifnet) can be destroyed anytime in any
packet processing and accessing such object via a pointer is racy. Instead
we have to get an object from the interface collection (ifindex2ifnet) via
an interface index (if_index) that is stored to a mbuf instead of an
pointer.
The change provides two APIs: m_{get,put}_rcvif_psref that use psref(9)
for sleep-able critical sections and m_{get,put}_rcvif that use
pserialize(9) for other critical sections. The change also adds another
API called m_get_rcvif_NOMPSAFE, that is NOT MP-safe and for transition
moratorium, i.e., it is intended to be used for places where are not
planned to be MP-ified soon.
The change adds some overhead due to psref to performance sensitive paths,
however the overhead is not serious, 2% down at worst.
Proposed on tech-kern and tech-net.
Diffstat (limited to 'sys/dev/microcode/rum')
0 files changed, 0 insertions, 0 deletions
