NetBSD/sys/altq
ozaki-r fe6d427551 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.
2016-06-10 13:31:43 +00:00
..
altq_afmap.c
altq_afmap.h
altq_blue.c IFQ_ENQUEUE refactor (2/3) : eliminate pktattr argument from altq implemantation 2016-04-20 08:58:48 +00:00
altq_blue.h
altq_cbq.c IFQ_ENQUEUE refactor (2/3) : eliminate pktattr argument from altq implemantation 2016-04-20 08:58:48 +00:00
altq_cbq.h
altq_cdnr.c Avoid storing a pointer of an interface in a mbuf 2016-06-10 13:31:43 +00:00
altq_cdnr.h
altq_classq.h
altq_conf.c Add d_discard to all struct cdevsw instances I could find. 2014-07-25 08:10:31 +00:00
altq_conf.h
altq_fifoq.c IFQ_ENQUEUE refactor (2/3) : eliminate pktattr argument from altq implemantation 2016-04-20 08:58:48 +00:00
altq_fifoq.h
altq_flowvalve.h
altq_hfsc.c IFQ_ENQUEUE refactor (2/3) : eliminate pktattr argument from altq implemantation 2016-04-20 08:58:48 +00:00
altq_hfsc.h
altq_jobs.c IFQ_ENQUEUE refactor (2/3) : eliminate pktattr argument from altq implemantation 2016-04-20 08:58:48 +00:00
altq_jobs.h
altq_localq.c
altq_priq.c IFQ_ENQUEUE refactor (2/3) : eliminate pktattr argument from altq implemantation 2016-04-20 08:58:48 +00:00
altq_priq.h
altq_red.c IFQ_ENQUEUE refactor (2/3) : eliminate pktattr argument from altq implemantation 2016-04-20 08:58:48 +00:00
altq_red.h
altq_rio.c Use M_GETCTX and M_SETCTX instead of open-coding rcvif 2016-05-16 09:53:59 +00:00
altq_rio.h
altq_rmclass_debug.h
altq_rmclass.c
altq_rmclass.h
altq_subr.c Protect ifnet list with psz and psref 2016-05-12 02:24:16 +00:00
altq_var.h
altq_wfq.c IFQ_ENQUEUE refactor (2/3) : eliminate pktattr argument from altq implemantation 2016-04-20 08:58:48 +00:00
altq_wfq.h
altq.h
altqconf.h
files.altq Build altq module. 2014-11-17 06:04:01 +00:00
if_altq.h IFQ_ENQUEUE refactor (2/3) : eliminate pktattr argument from altq implemantation 2016-04-20 08:58:48 +00:00
Makefile