FreeBSD src
Go to file
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
bin Implement ^T support for rm: now it will report the next file it 2009-04-29 18:08:18 +00:00
cddl Switch over to gnu99 compilation on default for userland. 2009-03-14 17:55:16 +00:00
contrib This belongs in //svn.freebsd.org/base/vendor/file/dist now. 2009-05-04 00:42:15 +00:00
crypto Don't leak information via uninitialized space in db(3) records. [09:07] 2009-04-22 14:07:14 +00:00
etc Added (pre|post)(start|stop) jail hooks. These can be used to run 2009-04-28 09:45:32 +00:00
games Too good to pass. 2009-03-06 13:24:54 +00:00
gnu Fix build breakage due to the interplay between r189801 and r189824. 2009-03-14 22:50:03 +00:00
include Revert r190943, since the problem in ports seems to be fixed now. 2009-04-17 14:19:18 +00:00
kerberos5 Add strndup(3) prototype to string.h. 2008-12-08 21:04:24 +00:00
lib Our grantpt(3) and unlockpt(3) don't comply with POSIX. 2009-05-04 18:14:45 +00:00
libexec Prefer <sys/param.h> to <machine/param.h> for the definition of 2009-04-20 10:35:50 +00:00
release fix various build errors (missing or wrong return types for 2009-04-27 16:57:19 +00:00
rescue Libarchive is sprouting dependencies on libmd and libcrypto. 2009-04-18 06:01:55 +00:00
sbin Do no spam the ifconfig output for the aggregated interface with 'laggdev laggX'. 2009-04-30 14:31:52 +00:00
secure Enable getaudit_addr(2) for sshd again. This will un-break the subject 2008-11-30 15:35:24 +00:00
share Fix typos: 2009-05-02 11:59:56 +00:00
sys Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
tools A script for plucking packages and their runtime dependencies for 2009-04-19 18:23:23 +00:00
usr.bin Merge vendor/file/dist@191739, bringing FILE 5.00 to 8-CURRENT. 2009-05-04 00:37:44 +00:00
usr.sbin Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
COPYRIGHT Bump the odometer of the years. A little early this year for 7.1R. 2008-12-30 04:46:25 +00:00
LOCKS Update LOCKS syntax. 2008-06-05 19:47:58 +00:00
MAINTAINERS Replace anholt with myself as drm maintainer. 2009-03-20 18:51:13 +00:00
Makefile Add a new world named 'mips' to our universe. 2009-04-01 17:11:50 +00:00
Makefile.inc1 Revert c190007 at the request of Ruslan. It was not correct because 2009-04-05 00:24:49 +00:00
ObsoleteFiles.inc usbdevs(8) is not obsoleted, just temporarily disconnected from the build 2009-04-18 22:16:46 +00:00
README Virgin import of Christos Zoulas's FILE 5.00. 2009-05-02 06:25:51 +00:00
UPDATING Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00

This is the top level of the FreeBSD source directory.  This file
was last revised on:
$FreeBSD$

For copyright information, please see the file COPYRIGHT in this
directory (additional copyright information also exists for some
sources in this tree - please see the specific source directories for
more information).

The Makefile in this directory supports a number of targets for
building components (or all) of the FreeBSD source tree, the most
commonly used one being ``world'', which rebuilds and installs
everything in the FreeBSD system from the source tree except the
kernel, the kernel-modules and the contents of /etc.  The ``world''
target should only be used in cases where the source tree has not
changed from the currently running version.  See:
http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/makeworld.html
for more information, including setting make(1) variables.

The ``buildkernel'' and ``installkernel'' targets build and install
the kernel and the modules (see below).  Please see the top of
the Makefile in this directory for more information on the
standard build targets and compile-time flags.

Building a kernel is a somewhat more involved process, documentation
for which can be found at:
   http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/kernelconfig.html
And in the config(8) man page.
Note: If you want to build and install the kernel with the
``buildkernel'' and ``installkernel'' targets, you might need to build
world before.  More information is available in the handbook.

The sample kernel configuration files reside in the sys/<arch>/conf
sub-directory (assuming that you've installed the kernel sources), the
file named GENERIC being the one used to build your initial installation
kernel.  The file NOTES contains entries and documentation for all possible
devices, not just those commonly used.  It is the successor of the ancient
LINT file, but in contrast to LINT, it is not buildable as a kernel but a
pure reference and documentation file.


Source Roadmap:
---------------
bin		System/user commands.

contrib		Packages contributed by 3rd parties.

crypto		Cryptography stuff (see crypto/README).

etc		Template files for /etc.

games		Amusements.

gnu		Various commands and libraries under the GNU Public License.
		Please see gnu/COPYING* for more information.

include		System include files.

kerberos5	Kerberos5 (Heimdal) package.

lib		System libraries.

libexec		System daemons.

release		Release building Makefile & associated tools.

rescue		Build system for statically linked /rescue utilities.

sbin		System commands.

secure		Cryptographic libraries and commands.

share		Shared resources.

sys		Kernel sources.

tools		Utilities for regression testing and miscellaneous tasks.

usr.bin		User commands.

usr.sbin	System administration commands.


For information on synchronizing your source tree with one or more of
the FreeBSD Project's development branches, please see:

  http://www.freebsd.org/doc/en_US.ISO8859-1/books/handbook/synching.html