freebsd-dev/sys
Marko Zec 21ca7b57bd Change the curvnet variable from a global const struct vnet *,
previously always pointing to the default vnet context, to a
dynamically changing thread-local one.  The currvnet context
should be set on entry to networking code via CURVNET_SET() macros,
and reverted to previous state via CURVNET_RESTORE().  Recursions
on curvnet are permitted, though strongly discuouraged.

This change should have no functional impact on nooptions VIMAGE
kernel builds, where CURVNET_* macros expand to whitespace.

The curthread->td_vnet (aka curvnet) variable's purpose is to be an
indicator of the vnet context in which the current network-related
operation takes place, in case we cannot deduce the current vnet
context from any other source, such as by looking at mbuf's
m->m_pkthdr.rcvif->if_vnet, sockets's so->so_vnet etc.  Moreover, so
far curvnet has turned out to be an invaluable consistency checking
aid: it helps to catch cases when sockets, ifnets or any other
vnet-aware structures may have leaked from one vnet to another.

The exact placement of the CURVNET_SET() / CURVNET_RESTORE() macros
was a result of an empirical iterative process, whith an aim to
reduce recursions on CURVNET_SET() to a minimum, while still reducing
the scope of CURVNET_SET() to networking only operations - the
alternative would be calling CURVNET_SET() on each system call entry.
In general, curvnet has to be set in three typicall cases: when
processing socket-related requests from userspace or from within the
kernel; when processing inbound traffic flowing from device drivers
to upper layers of the networking stack, and when executing
timer-driven networking functions.

This change also introduces a DDB subcommand to show the list of all
vnet instances.

Approved by:	julian (mentor)
2009-05-05 10:56:12 +00:00
..
amd64 Do not try to initialize LAPIC timer if we are not going to use it. 2009-05-05 01:13:20 +00:00
arm Reduce the number of bounce zones (and thus the number of bounce pages 2009-04-23 20:24:19 +00:00
boot A simple rewrite of biossmap.c: 2009-04-15 17:31:22 +00:00
bsm Merge OpenBSM 1.1 from OpenBSM vendor branch to head. 2009-04-19 16:17:13 +00:00
cam Get rid of the device index number stored in the sa(4) unit number. 2009-04-20 10:40:42 +00:00
cddl Introduce the extensible jail framework, using the same "name=value" 2009-04-29 21:14:15 +00:00
compat Mark Linux MIB sysctls MPSAFE. 2009-05-04 19:06:05 +00:00
conf Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
contrib In preparation for turning on options VIMAGE in next commits, 2009-04-26 22:06:42 +00:00
crypto
ddb
dev Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
fs Add the experimental nfs subtree to the kernel, that includes 2009-05-04 15:23:58 +00:00
gdb
geom - Make the gvinum softc invisible to userland, as it is not needed. 2009-05-04 17:30:20 +00:00
gnu
i386 Do not try to initialize LAPIC timer if we are not going to use it. 2009-05-05 01:13:20 +00:00
ia64 Remove isa_irq_pending(). It's not used. 2009-04-24 03:43:20 +00:00
isa Rename statclock_disable variable to atrtcclock_disable that it actually is, 2009-05-03 17:47:21 +00:00
kern Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
kgssapi
legacy/dev Remove kue_fw.h, missed in previous IFF_NEEDSGIANT USB driver garbage 2009-04-17 09:48:20 +00:00
libkern
mips A variety of changes: 2009-05-02 06:12:38 +00:00
modules Bring in Andrew Thompson's port of Sepherosa Ziehau's bwi driver for 2009-05-03 04:01:43 +00:00
net Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
net80211 Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
netatalk Lock interface address list lock around ifaddr inserts and deletes 2009-04-19 22:01:38 +00:00
netgraph Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
netinet Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
netinet6 Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
netipsec Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
netipx Make the SPX code use its own copies of insque()/remque(). 2009-04-26 21:03:27 +00:00
netnatm
netncp
netsmb
nfs Adding sys/nfs/nfssvc.h and sys/nfs/nfs_nfssvc.c in preparation for 2009-04-07 19:06:51 +00:00
nfs4client Remove VOP_LEASE and supporting functions. This hasn't been used since 2009-04-10 10:52:19 +00:00
nfsclient Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
nfsserver Change nfsserver so that it uses the nfssvc() system call provided 2009-04-12 19:04:27 +00:00
nlm
opencrypto
pc98 Rename statclock_disable variable to atrtcclock_disable that it actually is, 2009-05-03 17:47:21 +00:00
pci For RTL8139C+ controllers, have controller handle padding short 2009-04-20 07:13:04 +00:00
powerpc Zero PCB during early AIM PowerPC init. 2009-04-24 08:57:54 +00:00
rpc Added a field to the SVCXPRT structure that the nfsv4 server can 2009-04-16 16:26:35 +00:00
security Rename MAC Framework-internal macros used to invoke policy entry points: 2009-05-01 21:05:40 +00:00
sparc64 Don't conditionally define CACHE_LINE_SHIFT, as we anticipate sizing 2009-04-20 12:59:23 +00:00
sun4v Don't conditionally define CACHE_LINE_SHIFT, as we anticipate sizing 2009-04-20 12:59:23 +00:00
sys Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
tools Add SDT DTrace probes for VFS vnode operations in the vfs:vop 2009-03-29 03:30:15 +00:00
ufs Change the semantics of i_modrev/va_filerev to what is required for 2009-04-27 16:46:16 +00:00
vm Eliminate vnode_pager_input_smlfs()'s pointless call to pmap_clear_modify(). 2009-05-04 06:30:00 +00:00
xdr
xen Fix the Xen build for i386 PV mode. 2009-04-01 17:06:28 +00:00
Makefile