freebsd-skq/sys/netinet
Marko Zec bfe1aba468 Introduce vnet module registration / initialization framework with
dependency tracking and ordering enforcement.

With this change, per-vnet initialization functions introduced with
r190787 are no longer directly called from traditional initialization
functions (which cc in most cases inlined to pre-r190787 code), but are
instead registered via the vnet framework first, and are invoked only
after all prerequisite modules have been initialized.  In the long run,
this framework should allow us to both initialize and dismantle
multiple vnet instances in a correct order.

The problem this change aims to solve is how to replay the
initialization sequence of various network stack components, which
have been traditionally triggered via different mechanisms (SYSINIT,
protosw).  Note that this initialization sequence was and still can be
subtly different depending on whether certain pieces of code have been
statically compiled into the kernel, loaded as modules by boot
loader, or kldloaded at run time.

The approach is simple - we record the initialization sequence
established by the traditional mechanisms whenever vnet_mod_register()
is called for a particular vnet module.  The vnet_mod_register_multi()
variant allows a single initializer function to be registered multiple
times but with different arguments - currently this is only used in
kern/uipc_domain.c by net_add_domain() with different struct domain *
as arguments, which allows for protosw-registered initialization
routines to be invoked in a correct order by the new vnet
initialization framework.

For the purpose of identifying vnet modules, each vnet module has to
have a unique ID, which is statically assigned in sys/vimage.h.
Dynamic assignment of vnet module IDs is not supported yet.

A vnet module may specify a single prerequisite module at registration
time by filling in the vmi_dependson field of its vnet_modinfo struct
with the ID of the module it depends on.  Unless specified otherwise,
all vnet modules depend on VNET_MOD_NET (container for ifnet list head,
rt_tables etc.), which thus has to and will always be initialized
first.  The framework will panic if it detects any unresolved
dependencies before completing system initialization.  Detection of
unresolved dependencies for vnet modules registered after boot
(kldloaded modules) is not provided.

Note that the fact that each module can specify only a single
prerequisite may become problematic in the long run.  In particular,
INET6 depends on INET being already instantiated, due to TCP / UDP
structures residing in INET container.  IPSEC also depends on INET,
which will in turn additionally complicate making INET6-only kernel
configs a reality.

The entire registration framework can be compiled out by turning on the
VIMAGE_GLOBALS kernel config option.

Reviewed by:	bz
Approved by:	julian (mentor)
2009-04-11 05:58:58 +00:00
..
libalias -don't pass down, to module's fingerprint function, unused data like 2009-04-08 11:56:49 +00:00
accf_data.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
accf_dns.c Add an accept filter for TCP based DNS requests. It waits until the 2008-07-18 14:44:51 +00:00
accf_http.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
icmp6.h Second round of putting global variables, which were virtualized 2008-12-13 19:13:03 +00:00
icmp_var.h Second round of putting global variables, which were virtualized 2008-12-13 19:13:03 +00:00
if_atm.c This main goals of this project are: 2008-12-15 06:10:57 +00:00
if_atm.h
if_ether.c Introduce vnet module registration / initialization framework with 2009-04-11 05:58:58 +00:00
if_ether.h remove dependency on net/if.h of this header 2009-02-16 15:07:40 +00:00
igmp_var.h Merge IGMPv3 and Source-Specific Multicast (SSM) to the FreeBSD 2009-03-09 17:53:05 +00:00
igmp.c Fix mbuf chain layout pessimization: 2009-04-04 15:32:23 +00:00
igmp.h Comment IGMP_PIM as being very historic, as in, don't use. 2009-03-19 01:15:26 +00:00
in_cksum.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
in_gif.c On architectures with strict alignment requirements compensate 2009-03-07 19:08:58 +00:00
in_gif.h
in_mcast.c If KTR_SUBSYS is compiled in, it does not necessarily mean that user 2009-04-05 23:25:06 +00:00
in_pcb.c Correct a number of evolved problems with inp_vflag and inp_flags: 2009-03-15 09:58:31 +00:00
in_pcb.h Import "flowid" support for serializing flows across transmit queues 2009-04-10 06:16:14 +00:00
in_proto.c Merge IGMPv3 and Source-Specific Multicast (SSM) to the FreeBSD 2009-03-09 17:53:05 +00:00
in_rmx.c For all files including net/vnet.h directly include opt_route.h and 2009-02-27 14:12:05 +00:00
in_systm.h Use uint32_t instead of n_long and n_time, and uint16_t instead of n_short. 2009-02-13 15:14:43 +00:00
in_var.h Merge IGMPv3 and Source-Specific Multicast (SSM) to the FreeBSD 2009-03-09 17:53:05 +00:00
in.c Deal with the case where ifma_protospec may be NULL, during 2009-03-17 14:41:54 +00:00
in.h Namespace: Defining htonl() and friends here instead of arpa/inet.h is 2009-03-14 20:16:54 +00:00
ip6.h Start removing IPv6 Type 0 Routing header code. 2009-03-03 13:12:12 +00:00
ip_carp.c This main goals of this project are: 2008-12-15 06:10:57 +00:00
ip_carp.h Make sure that carp_header is 36 bytes long 2006-12-01 18:37:41 +00:00
ip_divert.c Adds support for SCTP checksum offload. This means 2009-02-03 11:00:43 +00:00
ip_divert.h
ip_dummynet.c Add emulation of delay profiles, which lets you model various 2009-04-09 12:46:00 +00:00
ip_dummynet.h Add emulation of delay profiles, which lets you model various 2009-04-09 12:46:00 +00:00
ip_ecn.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
ip_ecn.h
ip_encap.c Add FBSDID to all files in netinet so that people can more 2007-10-07 20:44:24 +00:00
ip_encap.h
ip_fastfwd.c This main goals of this project are: 2008-12-15 06:10:57 +00:00
ip_fw2.c Implement an ipfw action to reassemble ip packets: reass. 2009-04-01 20:23:47 +00:00
ip_fw_nat.c Add SCTP NAT support. 2009-02-07 18:49:42 +00:00
ip_fw_pfil.c Implement an ipfw action to reassemble ip packets: reass. 2009-04-01 20:23:47 +00:00
ip_fw.h First pass at separating per-vnet initializer functions 2009-04-06 22:29:41 +00:00
ip_gre.c Enqueue de-capsulated packet instead of performing direct dispatch. It's 2008-07-04 21:01:30 +00:00
ip_gre.h
ip_icmp.c Use uint32_t instead of n_long and n_time, and uint16_t instead of n_short. 2009-02-13 15:14:43 +00:00
ip_icmp.h Use uint32_t instead of n_long and n_time, and uint16_t instead of n_short. 2009-02-13 15:14:43 +00:00
ip_id.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
ip_input.c Introduce vnet module registration / initialization framework with 2009-04-11 05:58:58 +00:00
ip_ipsec.c Try to remove/assimilate as much of formerly IPv4/6 specific 2009-02-08 09:27:07 +00:00
ip_ipsec.h Take the route mtu into account, if available, when sending an 2008-04-09 05:17:18 +00:00
ip_mroute.c Fix brainos introduced during mechanical KTR change. 2009-03-20 13:13:50 +00:00
ip_mroute.h Introduce a number of changes to the MROUTING code. 2009-03-19 01:43:03 +00:00
ip_options.c Add function ip_checkrouteralert(), which will be used 2009-03-04 02:51:22 +00:00
ip_options.h Add function ip_checkrouteralert(), which will be used 2009-03-04 02:51:22 +00:00
ip_output.c Import "flowid" support for serializing flows across transmit queues 2009-04-10 06:16:14 +00:00
ip_var.h Merge IGMPv3 and Source-Specific Multicast (SSM) to the FreeBSD 2009-03-09 17:53:05 +00:00
ip.h Use uint32_t instead of n_long and n_time, and uint16_t instead of n_short. 2009-02-13 15:14:43 +00:00
pim_var.h
pim.h
raw_ip.c Merge IGMPv3 and Source-Specific Multicast (SSM) to the FreeBSD 2009-03-09 17:53:05 +00:00
sctp_asconf.c Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_asconf.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_auth.c - Cleanup checksum code. 2009-02-03 11:04:03 +00:00
sctp_auth.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_bsd_addr.c Nit 2008-08-09 11:28:57 +00:00
sctp_bsd_addr.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_cc_functions.c - Macro-izes the packed declaration in all headers. 2008-06-14 07:58:05 +00:00
sctp_cc_functions.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_constants.h Fixes several PR-SCTP releated bugs. 2009-03-14 13:42:13 +00:00
sctp_crc32.c Fix the add stream feature of strm-reset to really work: 2009-02-27 20:54:45 +00:00
sctp_crc32.h This commit fixes the issue with alias_sctp.c. No 2009-02-14 11:34:57 +00:00
sctp_header.h Add the add-stream capability. Still needs more 2009-02-20 15:03:54 +00:00
sctp_indata.c Fix a FR bug. When doing PR-SCTP with number rtx 2009-04-08 12:52:05 +00:00
sctp_indata.h Code from the hack-session known as the IETF (and a 2008-12-06 13:19:54 +00:00
sctp_input.c Many bug fixes (from the IETF hack-fest): 2009-04-04 11:43:32 +00:00
sctp_input.h 1) Adds the rest of the VIMAGE change macros 2008-07-09 16:45:30 +00:00
sctp_lock_bsd.h - Make strict-sacks be the default. 2008-08-28 09:44:07 +00:00
sctp_os_bsd.h - PR-SCTP bug, where the CUM-ACK was not being updated 2009-03-04 20:54:42 +00:00
sctp_os.h - Fix address add handling to clear cached routes and source addresses 2007-08-24 00:53:53 +00:00
sctp_output.c Many bug fixes (from the IETF hack-fest): 2009-04-04 11:43:32 +00:00
sctp_output.h Fix the add stream feature of strm-reset to really work: 2009-02-27 20:54:45 +00:00
sctp_pcb.c Many bug fixes (from the IETF hack-fest): 2009-04-04 11:43:32 +00:00
sctp_pcb.h - Cleanup checksum code. 2009-02-03 11:04:03 +00:00
sctp_peeloff.c - Macro-izes the packed declaration in all headers. 2008-06-14 07:58:05 +00:00
sctp_peeloff.h - Copyright change, cisco's silly tool wants it to say: 2007-05-08 17:01:12 +00:00
sctp_structs.h Many bug fixes (from the IETF hack-fest): 2009-04-04 11:43:32 +00:00
sctp_sysctl.c Add more padding and a new variable. This will 2009-04-08 12:49:36 +00:00
sctp_sysctl.h Many bug fixes (from the IETF hack-fest): 2009-04-04 11:43:32 +00:00
sctp_timer.c Fixes several PR-SCTP releated bugs. 2009-03-14 13:42:13 +00:00
sctp_timer.h Invariants changes that make more sense. 2008-10-27 13:53:31 +00:00
sctp_uio.h Add more padding and a new variable. This will 2009-04-08 12:49:36 +00:00
sctp_usrreq.c Many bug fixes (from the IETF hack-fest): 2009-04-04 11:43:32 +00:00
sctp_var.h Fixes several PR-SCTP releated bugs. 2009-03-14 13:42:13 +00:00
sctp.h Fixes several PR-SCTP releated bugs. 2009-03-14 13:42:13 +00:00
sctputil.c Many bug fixes (from the IETF hack-fest): 2009-04-04 11:43:32 +00:00
sctputil.h Fixes several PR-SCTP releated bugs. 2009-03-14 13:42:13 +00:00
tcp_debug.c To my reading there are no real consumers of ip6_plen (IPv6 2008-09-07 20:44:45 +00:00
tcp_debug.h Use uint32_t instead of n_long and n_time, and uint16_t instead of n_short. 2009-02-13 15:14:43 +00:00
tcp_fsm.h Make tcpstates[] static, and make sure TCPSTATES is defined before 2007-07-30 11:06:42 +00:00
tcp_hostcache.c Use inc_flags instead of the inc_isipv6 alias which so far 2008-12-17 12:52:34 +00:00
tcp_hostcache.h Add an essential .h file that skipped from the last commit (r185419). 2008-11-28 23:39:25 +00:00
tcp_input.c Import "flowid" support for serializing flows across transmit queues 2009-04-10 06:16:14 +00:00
tcp_lro.c Don't calculate checksum if it has already been validated 2008-08-24 02:31:09 +00:00
tcp_lro.h Add generic TCP LOR into netinet 2008-06-11 22:12:50 +00:00
tcp_offload.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
tcp_offload.h - Switch to INP_WLOCK macro from inp_wlock 2008-07-21 21:22:56 +00:00
tcp_output.c Rather than using hidden includes (with cicular dependencies), 2008-12-02 21:37:28 +00:00
tcp_reass.c First pass at separating per-vnet initializer functions 2009-04-06 22:29:41 +00:00
tcp_sack.c First pass at separating per-vnet initializer functions 2009-04-06 22:29:41 +00:00
tcp_seq.h
tcp_subr.c First pass at separating per-vnet initializer functions 2009-04-06 22:29:41 +00:00
tcp_syncache.c Since we allow conditional allocation of labels on syncache entries, 2009-01-11 20:01:43 +00:00
tcp_syncache.h Move syncache flag definitions below data structure, compress some vertical 2008-12-10 11:11:43 +00:00
tcp_timer.c Correct a number of evolved problems with inp_vflag and inp_flags: 2009-03-15 09:58:31 +00:00
tcp_timer.h Two changes: 2007-09-24 05:26:24 +00:00
tcp_timewait.c First pass at separating per-vnet initializer functions 2009-04-06 22:29:41 +00:00
tcp_usrreq.c With the right comparison we get a proper wscale value and thus 2009-04-07 14:42:40 +00:00
tcp_var.h Add externs to fix build with VIMAGE_GLOBALS after r187289. 2009-01-22 10:29:09 +00:00
tcp.h add rcv_nxt, snd_nxt, and toe offload id to FreeBSD-specific 2008-05-05 20:13:31 +00:00
tcpip.h
toedev.h Don't check if an interface can do tcp offload if there are no offload devices registered on the system. 2008-09-01 05:30:22 +00:00
udp_usrreq.c Merge IGMPv3 and Source-Specific Multicast (SSM) to the FreeBSD 2009-03-09 17:53:05 +00:00
udp_var.h Add the ability of an alternate transport protocol 2009-01-06 12:13:40 +00:00
udp.h Gratuitous UDP restyling toward style(9) in 7.x. 2007-02-20 10:13:11 +00:00
vinet.h First pass at separating per-vnet initializer functions 2009-04-06 22:29:41 +00:00