freebsd-skq/sys/contrib
bz 7a1c0b1ad1 Get closer to a VIMAGE network stack teardown from top to bottom rather
than removing the network interfaces first. This change is rather larger
and convoluted as the ordering requirements cannot be separated.

Move the pfil(9) framework to SI_SUB_PROTO_PFIL, move Firewalls and
related modules to their own SI_SUB_PROTO_FIREWALL.
Move initialization of "physical" interfaces to SI_SUB_DRIVERS,
move virtual (cloned) interfaces to SI_SUB_PSEUDO.
Move Multicast to SI_SUB_PROTO_MC.

Re-work parts of multicast initialisation and teardown, not taking the
huge amount of memory into account if used as a module yet.

For interface teardown we try to do as many of them as we can on
SI_SUB_INIT_IF, but for some this makes no sense, e.g., when tunnelling
over a higher layer protocol such as IP. In that case the interface
has to go along (or before) the higher layer protocol is shutdown.

Kernel hhooks need to go last on teardown as they may be used at various
higher layers and we cannot remove them before we cleaned up the higher
layers.

For interface teardown there are multiple paths:
(a) a cloned interface is destroyed (inside a VIMAGE or in the base system),
(b) any interface is moved from a virtual network stack to a different
network stack ("vmove"), or (c) a virtual network stack is being shut down.
All code paths go through if_detach_internal() where we, depending on the
vmove flag or the vnet state, make a decision on how much to shut down;
in case we are destroying a VNET the individual protocol layers will
cleanup their own parts thus we cannot do so again for each interface as
we end up with, e.g., double-frees, destroying locks twice or acquiring
already destroyed locks.
When calling into protocol cleanups we equally have to tell them
whether they need to detach upper layer protocols ("ulp") or not
(e.g., in6_ifdetach()).

Provide or enahnce helper functions to do proper cleanup at a protocol
rather than at an interface level.

Approved by:		re (hrs)
Obtained from:		projects/vnet
Reviewed by:		gnn, jhb
Sponsored by:		The FreeBSD Foundation
MFC after:		2 weeks
Differential Revision:	https://reviews.freebsd.org/D6747
2016-06-21 13:48:49 +00:00
..
alpine-hal Import Annapurna Labs Alpine HAL for networking 2016-01-26 15:22:04 +00:00
cloudabi Make CloudABI's way of doing TLS more friendly to userspace emulators. 2016-04-06 11:11:31 +00:00
dev [ath] implement TX queue configuration extensions for the AR9380 HAL. 2016-06-20 16:12:27 +00:00
ipfilter/netinet Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
libfdt
libnv Add support for the arrays in nvlist library. 2015-08-15 06:34:49 +00:00
ncsw Zero the newly allocated spinlock. 2016-04-24 01:38:45 +00:00
ngatm Fix the following -Werror warning from clang 3.5.0, while building 2014-11-19 07:47:37 +00:00
octeon-sdk
rdma/krping Fix for printf() compile warning when fast_reg.length is 64-bit. 2016-04-22 07:29:38 +00:00
v4l
vchiq/interface ARM: Use new ARMv6 naming conventions for cache and TLB functions 2016-02-05 14:57:41 +00:00
x86emu Optimize ROL and ROR emulations and fix comments. 2016-02-18 23:03:37 +00:00
xz-embedded