freebsd-dev/sys/netgraph
Robert Watson eddfbb763d Build on Jeff Roberson's linker-set based dynamic per-CPU allocator
(DPCPU), as suggested by Peter Wemm, and implement a new per-virtual
network stack memory allocator.  Modify vnet to use the allocator
instead of monolithic global container structures (vinet, ...).  This
change solves many binary compatibility problems associated with
VIMAGE, and restores ELF symbols for virtualized global variables.

Each virtualized global variable exists as a "reference copy", and also
once per virtual network stack.  Virtualized global variables are
tagged at compile-time, placing the in a special linker set, which is
loaded into a contiguous region of kernel memory.  Virtualized global
variables in the base kernel are linked as normal, but those in modules
are copied and relocated to a reserved portion of the kernel's vnet
region with the help of a the kernel linker.

Virtualized global variables exist in per-vnet memory set up when the
network stack instance is created, and are initialized statically from
the reference copy.  Run-time access occurs via an accessor macro, which
converts from the current vnet and requested symbol to a per-vnet
address.  When "options VIMAGE" is not compiled into the kernel, normal
global ELF symbols will be used instead and indirection is avoided.

This change restores static initialization for network stack global
variables, restores support for non-global symbols and types, eliminates
the need for many subsystem constructors, eliminates large per-subsystem
structures that caused many binary compatibility issues both for
monitoring applications (netstat) and kernel modules, removes the
per-function INIT_VNET_*() macros throughout the stack, eliminates the
need for vnet_symmap ksym(2) munging, and eliminates duplicate
definitions of virtualized globals under VIMAGE_GLOBALS.

Bump __FreeBSD_version and update UPDATING.

Portions submitted by:  bz
Reviewed by:            bz, zec
Discussed with:         gnn, jamie, jeff, jhb, julian, sam
Suggested by:           peter
Approved by:            re (kensmith)
2009-07-14 22:48:30 +00:00
..
atm Build on Jeff Roberson's linker-set based dynamic per-CPU allocator 2009-07-14 22:48:30 +00:00
bluetooth Fix a typeo in the frame len function to unbreak the build, make it shorter 2009-06-23 06:00:31 +00:00
netflow Fix copy-paste bug in NGM_NETFLOW_SETCONFIG argument size verification. 2009-05-13 02:26:34 +00:00
netgraph.h Build on Jeff Roberson's linker-set based dynamic per-CPU allocator 2009-07-14 22:48:30 +00:00
ng_async.c Fix a number of style issues in the MALLOC / FREE commit. I've tried to 2008-10-23 20:26:15 +00:00
ng_async.h
ng_atmllc.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_atmllc.h
ng_base.c Build on Jeff Roberson's linker-set based dynamic per-CPU allocator 2009-07-14 22:48:30 +00:00
ng_bpf.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_bpf.h
ng_bridge.c Conditionally compile out V_ globals while instantiating the appropriate 2008-12-10 23:12:39 +00:00
ng_bridge.h
ng_car.c - Account all node stats at the shape mode. 2008-03-30 07:53:51 +00:00
ng_car.h Add option to set packets per second limits instead of default 2007-12-19 22:50:14 +00:00
ng_cisco.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_cisco.h
ng_deflate.c Use m_unshare()+m_copyback() instead of m_freem()+m_devget() to keep 2009-01-18 19:25:36 +00:00
ng_deflate.h A node that implements the Deflate sub-protocols of the Compression Control 2006-12-28 15:44:05 +00:00
ng_device.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_device.h
ng_echo.c
ng_echo.h
ng_eiface.c Build on Jeff Roberson's linker-set based dynamic per-CPU allocator 2009-07-14 22:48:30 +00:00
ng_eiface.h
ng_etf.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_etf.h
ng_ether_echo.c Add a trivial node to reflect ethernet frames to whence they came. 2008-12-25 00:01:29 +00:00
ng_ether_echo.h Add a trivial node to reflect ethernet frames to whence they came. 2008-12-25 00:01:29 +00:00
ng_ether.c Build on Jeff Roberson's linker-set based dynamic per-CPU allocator 2009-07-14 22:48:30 +00:00
ng_ether.h
ng_fec.c Change if_output to take a struct route as its fourth argument in order 2009-04-16 20:30:28 +00:00
ng_fec.h
ng_frame_relay.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_frame_relay.h
ng_gif_demux.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_gif_demux.h
ng_gif.c Build on Jeff Roberson's linker-set based dynamic per-CPU allocator 2009-07-14 22:48:30 +00:00
ng_gif.h
ng_hole.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_hole.h
ng_hub.c
ng_hub.h
ng_iface.c Build on Jeff Roberson's linker-set based dynamic per-CPU allocator 2009-07-14 22:48:30 +00:00
ng_iface.h Check for infinite recursion possible on some broken PPTP/L2TP/... VPN setups. 2009-01-20 22:26:09 +00:00
ng_ip_input.c Introduce a mechanism for detecting calls from outbound path of the 2009-06-11 16:50:49 +00:00
ng_ip_input.h
ng_ipfw.c Close long existed race with net.inet.ip.fw.one_pass = 0: 2009-06-09 21:27:11 +00:00
ng_ipfw.h Close long existed race with net.inet.ip.fw.one_pass = 0: 2009-06-09 21:27:11 +00:00
ng_ksocket.c - Turn the third (islocked) argument of the knote call into flags parameter. 2009-06-28 21:49:43 +00:00
ng_ksocket.h
ng_l2tp.c Add memmove() to the kernel, making the kernel compile with Clang. 2009-02-28 16:21:25 +00:00
ng_l2tp.h
ng_lmi.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_lmi.h
ng_message.h World now builds without these defines, so eliminate them. 2009-06-09 07:07:20 +00:00
ng_mppc.c If source mbuf chain consists of only one mbuf, use it directly as source 2009-01-18 21:09:34 +00:00
ng_mppc.h
ng_nat.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_nat.h Fix incorrect field name. 2008-03-04 11:10:54 +00:00
ng_one2many.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_one2many.h
ng_parse.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_parse.h
ng_pipe.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_pipe.h Add Marko's pipe node. 2008-09-03 18:17:45 +00:00
ng_ppp.c Remove strict limitation on minimal multilink MRRU. RFC claims that MRRU 2009-01-18 12:03:43 +00:00
ng_ppp.h Add 64bit statistic counters to the ng_ppp node. 2007-08-01 20:49:35 +00:00
ng_pppoe.c Make Netgraph compile with Clang. 2009-03-03 18:47:33 +00:00
ng_pppoe.h Make Netgraph compile with Clang. 2009-03-03 18:47:33 +00:00
ng_pptpgre.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_pptpgre.h Rewrite node to support multiple hooks, alike to ng_l2tp, to use one pair 2008-03-24 22:55:22 +00:00
ng_pred1.c Use m_unshare()+m_copyback() instead of m_freem()+m_devget() to keep 2009-01-18 19:25:36 +00:00
ng_pred1.h A node that implements Predictor-1 compression for PPP. 2006-12-29 09:54:32 +00:00
ng_rfc1490.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_rfc1490.h
ng_sample.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_sample.h
ng_socket.c Remove unused variable. 2008-11-22 16:55:55 +00:00
ng_socket.h Make the sg_len and sg_family members of the sockaddr_ng the same type 2006-10-17 11:03:55 +00:00
ng_socketvar.h
ng_source.c Fix error message content. 2008-09-21 07:33:33 +00:00
ng_source.h Add "setcounter" and "getcounter" messages, providing the the ability 2007-03-02 01:44:04 +00:00
ng_split.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_split.h
ng_sppp.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_sppp.h
ng_tag.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_tag.h A netgraph node that can do different manipulations with 2006-06-27 12:45:28 +00:00
ng_tcpmss.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_tcpmss.h
ng_tee.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_tee.h
ng_tty.c Remove node shutdown on tty close. This could be easily done by user-level 2008-12-13 22:05:46 +00:00
ng_tty.h Assign new cookie to the node to reflect API change. 2008-11-08 02:05:41 +00:00
ng_UI.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_UI.h
ng_vjc.c Mark ng_vjc node as FORCE_WRITER to protect slcompress state. 2009-01-08 17:51:15 +00:00
ng_vjc.h
ng_vlan.c Retire the MALLOC and FREE macros. They are an abomination unto style(9). 2008-10-23 15:53:51 +00:00
ng_vlan.h
NOTES