1
0
mirror of https://git.FreeBSD.org/src.git synced 2025-01-17 15:27:36 +00:00
freebsd/sys/netinet6
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
..
dest6.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
frag6.c First pass at separating per-vnet initializer functions 2009-04-06 22:29:41 +00:00
icmp6.c Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
icmp6.h
in6_cksum.c Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
in6_gif.c On architectures with strict alignment requirements compensate 2009-03-07 19:08:58 +00:00
in6_gif.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
in6_ifattach.c Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00
in6_ifattach.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
in6_mcast.c Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00
in6_pcb.c Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
in6_pcb.h Merge in6_pcbfree() into in_pcbfree() which after the previous 2008-11-27 12:04:35 +00:00
in6_proto.c Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00
in6_rmx.c Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
in6_src.c First pass at separating per-vnet initializer functions 2009-04-06 22:29:41 +00:00
in6_var.h Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
in6.c Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
in6.h Add IN6ADDR_LINKLOCAL_ALLV2ROUTERS_INIT, in6addr_linklocal_allv2routers 2009-04-29 10:22:44 +00:00
ip6_ecn.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
ip6_forward.c Try to remove/assimilate as much of formerly IPv4/6 specific 2009-02-08 09:27:07 +00:00
ip6_id.c Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
ip6_input.c Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00
ip6_ipsec.c Try to remove/assimilate as much of formerly IPv4/6 specific 2009-02-08 09:27:07 +00:00
ip6_ipsec.h #if 0 out a currently unsued (and incomplete) function: ip6_ipsec_mtu(). 2008-03-14 11:44:30 +00:00
ip6_mroute.c Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
ip6_mroute.h Introduce a number of changes to the MROUTING code. 2009-03-19 01:43:03 +00:00
ip6_output.c Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
ip6_var.h Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
ip6.h
ip6protosw.h struct ip6protosw is a copy of struct protosw, so remove pr_usrreq there 2009-01-04 21:13:51 +00:00
mld6_var.h Bite the bullet, and make the IPv6 SSM and MLDv2 mega-commit: 2009-04-29 19:19:13 +00:00
mld6.c Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
mld6.h Add MLDv2 protocol header, but do not connect it to the build. 2009-04-29 11:31:23 +00:00
nd6_nbr.c Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
nd6_rtr.c In preparation for turning on options VIMAGE in next commits, 2009-04-26 22:06:42 +00:00
nd6.c Change the curvnet variable from a global const struct vnet *, 2009-05-05 10:56:12 +00:00
nd6.h Change if_output to take a struct route as its fourth argument in order 2009-04-16 20:30:28 +00:00
pim6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
pim6.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
raw_ip6.c Permit buiding kernels with options VIMAGE, restricted to only a single 2009-04-30 13:36:26 +00:00
raw_ip6.h Second round of putting global variables, which were virtualized 2008-12-13 19:13:03 +00:00
route6.c Start removing IPv6 Type 0 Routing header code. 2009-03-03 13:12:12 +00:00
scope6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
scope6.c First pass at separating per-vnet initializer functions 2009-04-06 22:29:41 +00:00
sctp6_usrreq.c - Cleanup checksum code. 2009-02-03 11:04:03 +00:00
sctp6_var.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
tcp6_var.h Put a global variables, which were virtualized but formerly 2008-12-11 16:26:38 +00:00
udp6_usrreq.c Limit scope of acquisition of INP_RLOCK for multicast input filter 2009-05-01 11:05:24 +00:00
udp6_var.h Clean up VCS Ids. 2007-12-10 16:03:40 +00:00
vinet6.h Make indentation more uniform accross vnet container structs. 2009-05-02 08:16:26 +00:00