freebsd-dev/sys
Bjoern A. Zeeb 89856f7e2d 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
..
amd64 Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
arm Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
arm64 Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
boot Print a message when disks are found but no logical partition are 2016-06-17 17:09:22 +00:00
bsm
cam Commit the bits of nda that were missed. This should fix the build. 2016-06-10 06:04:53 +00:00
cddl Fix gcc build. 2016-06-18 20:20:00 +00:00
compat Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
conf Update 11.0 to -ALPHA4 in preparation of a new set of snapshot 2016-06-17 00:00:45 +00:00
contrib Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
crypto Connect the SHA-512t256 and Skein hashing algorithms to ZFS 2016-05-31 04:12:14 +00:00
ddb Add a small set of logical operators to DDB command language. 2016-05-16 19:42:38 +00:00
dev Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
fs Do not access NFS data for reclaimed vnode. 2016-06-19 18:29:43 +00:00
gdb
geom When we are in panic, always go the asynchronous path in g_mirror_destroy(), 2016-06-01 22:11:54 +00:00
gnu Revert changes for local testing, inadvertantly commited in r300811. 2016-05-26 23:59:42 +00:00
i386 Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
isa sys/isa: minor spelling fixes. 2016-05-03 21:51:52 +00:00
kern Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
kgssapi kgssapi: insignificant spelling fix. 2016-05-03 22:05:03 +00:00
libkern sys: Make use of our rounddown() macro when sys/param.h is available. 2016-04-30 14:41:18 +00:00
mips Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
modules Change the default build behavior so we don't compile extra TCP modules by 2016-06-10 19:06:11 +00:00
net Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
net80211 [net80211] remove node scan lock / generation number + fix few LORs 2016-06-19 07:31:02 +00:00
netgraph Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
netinet Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
netinet6 Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
netipsec Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
netnatm kernel: use our nitems() macro when it is available through param.h. 2016-04-19 23:48:27 +00:00
netpfil Get closer to a VIMAGE network stack teardown from top to bottom rather 2016-06-21 13:48:49 +00:00
netsmb sys/net*: minor spelling fixes. 2016-05-03 18:05:43 +00:00
nfs NFS: spelling fixes on comments. 2016-04-29 16:07:25 +00:00
nfsclient
nfsserver
nlm Remote and local adv lock servers might de-synchronize (the added comment 2016-06-19 18:32:35 +00:00
ofed Fix bug in iwcm that caused a panic in iw_cm_wq when krping is run 2016-06-14 20:58:05 +00:00
opencrypto sys/opencrypto: minor spelling fixes. 2016-05-06 23:37:19 +00:00
pc98 Move 'device pci' for the PCI bus driver to the MI NOTES file. 2016-04-29 23:53:55 +00:00
powerpc Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
riscv Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
rpc Deobfuscate cleanup path in clnt_bck_create(..) 2016-06-10 17:53:28 +00:00
security Implement AUE_PREAD and AUE_PWRITE BSM conversion support, eliminating 2016-06-13 09:22:20 +00:00
sparc64 Update comments for the MD functions managing contexts for new 2016-06-16 12:05:44 +00:00
sys vfs: ifdef out noop vop_* primitives on !DEBUG_VFS_LOCKS kernels 2016-06-17 19:41:30 +00:00
teken
tests
tools
ufs arc4random() returns 0 to (2**32)−1, use an alternative to initialize 2016-05-22 14:31:20 +00:00
vm Fix inconsistent locking of the swap pager named objects list. 2016-06-13 03:42:46 +00:00
x86 Trim some spaces to record correct commit message for the r301278. 2016-06-03 18:23:45 +00:00
xdr RPC: for pointers replace 0 with NULL. 2016-04-14 17:06:37 +00:00
xen xen: Correct typo in #undef for symbol NBPL 2016-06-06 14:55:46 +00:00
Makefile