]> CyberLeo.Net >> Repos - FreeBSD/FreeBSD.git/commit
Introduce and use a sysinit-based initialization scheme for virtual
authorrwatson <rwatson@FreeBSD.org>
Thu, 23 Jul 2009 20:46:49 +0000 (20:46 +0000)
committerrwatson <rwatson@FreeBSD.org>
Thu, 23 Jul 2009 20:46:49 +0000 (20:46 +0000)
commitb3be1c6e3bd7d3b5cf946ddb04c1c5811644229b
tree0191b21173debdadfbf9f7565dfc5a8b9eefe94a
parentfc8defe5dd957eaee1f1c841d45804df5bbf20f5
Introduce and use a sysinit-based initialization scheme for virtual
network stacks, VNET_SYSINIT:

- Add VNET_SYSINIT and VNET_SYSUNINIT macros to declare events that will
  occur each time a network stack is instantiated and destroyed.  In the
  !VIMAGE case, these are simply mapped into regular SYSINIT/SYSUNINIT.
  For the VIMAGE case, we instead use SYSINIT's to track their order and
  properties on registration, using them for each vnet when created/
  destroyed, or immediately on module load for already-started vnets.
- Remove vnet_modinfo mechanism that existed to serve this purpose
  previously, as well as its dependency scheme: we now just use the
  SYSINIT ordering scheme.
- Implement VNET_DOMAIN_SET() to allow protocol domains to declare that
  they want init functions to be called for each virtual network stack
  rather than just once at boot, compiling down to DOMAIN_SET() in the
  non-VIMAGE case.
- Walk all virtualized kernel subsystems and make use of these instead
  of modinfo or DOMAIN_SET() for init/uninit events.  In some cases,
  convert modular components from using modevent to using sysinit (where
  appropriate).  In some cases, do minor rejuggling of SYSINIT ordering
  to make room for or better manage events.

Portions submitted by: jhb (VNET_SYSINIT), bz (cleanup)
Discussed with: jhb, bz, julian, zec
Reviewed by: bz
Approved by: re (VIMAGE blanket)
28 files changed:
sys/kern/kern_vimage.c
sys/kern/uipc_domain.c
sys/net/flowtable.c
sys/net/if.c
sys/net/if_clone.c
sys/net/if_clone.h
sys/net/if_gif.c
sys/net/if_loop.c
sys/net/route.c
sys/net/rtsock.c
sys/net/vnet.c
sys/net/vnet.h
sys/netgraph/bluetooth/socket/ng_btsocket.c
sys/netgraph/netgraph.h
sys/netgraph/ng_base.c
sys/netgraph/ng_eiface.c
sys/netgraph/ng_ether.c
sys/netgraph/ng_iface.c
sys/netgraph/ng_socket.c
sys/netinet/igmp.c
sys/netinet/in_proto.c
sys/netinet6/in6_proto.c
sys/netinet6/mld6.c
sys/netipsec/ipsec.c
sys/netipsec/keysock.c
sys/sys/domain.h
sys/sys/kernel.h
sys/sys/vimage.h