NetBSD/sys/netipsec
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
..
ah_var.h
ah.h
esp_var.h
esp.h
files.netipsec IPSEC has not come in two speeds for a long time now (IPSEC == kame, 2013-06-05 19:01:26 +00:00
ipcomp_var.h
ipcomp.h
ipip_var.h
ipsec6.h
ipsec_input.c Avoid storing a pointer of an interface in a mbuf 2016-06-10 13:31:43 +00:00
ipsec_mbuf.c
ipsec_netbsd.c Introduce 2 new variables: ipsec_enabled and ipsec_used. 2014-05-30 01:39:03 +00:00
ipsec_osdep.h introduce new ifnet MP-scalable sending interface "if_transmit". 2016-04-28 01:37:17 +00:00
ipsec_output.c Tidy up opt_ipsec.h inclusions 2015-03-30 03:51:50 +00:00
ipsec_private.h
ipsec_var.h
ipsec.c Pull out ipsec routines from ip6_input 2015-04-01 02:49:44 +00:00
ipsec.h Pull out ipsec routines from ip6_input 2015-04-01 02:49:44 +00:00
key_debug.c Avoid storing a pointer of an interface in a mbuf 2016-06-10 13:31:43 +00:00
key_debug.h Add more debugging, no functional change. 2016-03-05 20:11:09 +00:00
key_var.h
key.c PR/50905: Henning Petersen: Fix useless comparison (from FreeBSD) 2016-03-07 13:08:48 +00:00
key.h Tidy up opt_ipsec.h inclusions 2015-03-30 03:51:50 +00:00
keydb.h Tidy up opt_ipsec.h inclusions 2015-03-30 03:51:50 +00:00
keysock.c Introduce m_set_rcvif and m_reset_rcvif 2016-06-10 13:27:10 +00:00
keysock.h Eliminate struct protosw::pr_output. 2016-01-20 21:43:59 +00:00
Makefile
xform_ah.c Tidy up opt_ipsec.h inclusions 2015-03-30 03:51:50 +00:00
xform_esp.c Tidy up opt_ipsec.h inclusions 2015-03-30 03:51:50 +00:00
xform_ipcomp.c - apply some __diagused 2013-11-03 18:37:10 +00:00
xform_ipip.c Avoid storing a pointer of an interface in a mbuf 2016-06-10 13:31:43 +00:00
xform_tcp.c
xform.h eliminate variable argument in encapsw 2016-01-26 06:00:10 +00:00