freebsd-dev/sys/net
Christian S.J. Peron 4d621040ff Introduce support for zero-copy BPF buffering, which reduces the
overhead of packet capture by allowing a user process to directly "loan"
buffer memory to the kernel rather than using read(2) to explicitly copy
data from kernel address space.

The user process will issue new BPF ioctls to set the shared memory
buffer mode and provide pointers to buffers and their size. The kernel
then wires and maps the pages into kernel address space using sf_buf(9),
which on supporting architectures will use the direct map region. The
current "buffered" access mode remains the default, and support for
zero-copy buffers must, for the time being, be explicitly enabled using
a sysctl for the kernel to accept requests to use it.

The kernel and user process synchronize use of the buffers with atomic
operations, avoiding the need for system calls under load; the user
process may use select()/poll()/kqueue() to manage blocking while
waiting for network data if the user process is able to consume data
faster than the kernel generates it. Patchs to libpcap are available
to allow libpcap applications to transparently take advantage of this
support. Detailed information on the new API may be found in bpf(4),
including specific atomic operations and memory barriers required to
synchronize buffer use safely.

These changes modify the base BPF implementation to (roughly) abstrac
the current buffer model, allowing the new shared memory model to be
added, and add new monitoring statistics for netstat to print. The
implementation, with the exception of some monitoring hanges that break
the netstat monitoring ABI for BPF, will be MFC'd.

Zerocopy bpf buffers are still considered experimental are disabled
by default. To experiment with this new facility, adjust the
net.bpf.zerocopy_enable sysctl variable to 1.

Changes to libpcap will be made available as a patch for the time being,
and further refinements to the implementation are expected.

Sponsored by:		Seccuris Inc.
In collaboration with:	rwatson
Tested by:		pwood, gallatin
MFC after:		4 months [1]

[1] Certain portions will probably not be MFCed, specifically things
    that can break the monitoring ABI.
2008-03-24 13:49:17 +00:00
..
bpf_buffer.c Introduce support for zero-copy BPF buffering, which reduces the 2008-03-24 13:49:17 +00:00
bpf_buffer.h Introduce support for zero-copy BPF buffering, which reduces the 2008-03-24 13:49:17 +00:00
bpf_filter.c Improve convergence of bpf_filter.c toward style(9). 2008-03-09 21:13:43 +00:00
bpf_jitter.c
bpf_jitter.h
bpf_zerocopy.c Introduce support for zero-copy BPF buffering, which reduces the 2008-03-24 13:49:17 +00:00
bpf_zerocopy.h Introduce support for zero-copy BPF buffering, which reduces the 2008-03-24 13:49:17 +00:00
bpf.c Introduce support for zero-copy BPF buffering, which reduces the 2008-03-24 13:49:17 +00:00
bpf.h Introduce support for zero-copy BPF buffering, which reduces the 2008-03-24 13:49:17 +00:00
bpfdesc.h Introduce support for zero-copy BPF buffering, which reduces the 2008-03-24 13:49:17 +00:00
bridgestp.c Fix spelling. 2007-12-09 20:47:12 +00:00
bridgestp.h Fix spelling. 2007-12-09 20:47:12 +00:00
bsd_comp.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
ethernet.h Use a uint16_t type for the vlan tag rather an int. 2007-10-18 21:52:31 +00:00
fddi.h
firewire.h
ieee8023ad_lacp.c Switch the LACP state machine over to its own mutex to protect the internals, 2008-03-16 19:25:30 +00:00
ieee8023ad_lacp.h Remove extra semicolons. 2008-03-17 01:26:44 +00:00
if_arc.h
if_arcsubr.c
if_arp.h
if_atm.h
if_atmsubr.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
if_bridge.c Remove a chunk of duplicated code, test the destination address against the 2008-01-18 09:34:09 +00:00
if_bridgevar.h Add an option to limit the number of source MACs that can be behind a bridge 2007-11-04 08:32:27 +00:00
if_clone.c
if_clone.h
if_disc.c Add a comment explaining why disc(4) bears the IFF_LOOPBACK flag. 2007-10-27 19:57:41 +00:00
if_dl.h
if_edsc.c Give a hint that softc can contain many things besides ifp. 2007-03-26 09:05:10 +00:00
if_ef.c
if_enc.c Fix a panic where if the mbuf was consumed by the filter for requeueing 2007-12-26 08:41:58 +00:00
if_ethersubr.c back out last change as Sam believes that it breaks multicast - need to revisit after following up with pyun 2008-03-20 06:19:34 +00:00
if_faith.c
if_fddisubr.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
if_fwsubr.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
if_gif.c Improve EtherIP interaction with the bridge 2008-03-06 19:02:37 +00:00
if_gif.h
if_gre.c Replace really convoluted code that simplifies to "a ^= 0x01;" 2008-03-19 22:29:11 +00:00
if_gre.h
if_iso88025subr.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
if_lagg.c Switch the LACP state machine over to its own mutex to protect the internals, 2008-03-16 19:25:30 +00:00
if_lagg.h Fix two panics in lagg. 2007-10-12 03:03:16 +00:00
if_llc.h Move the __packed declarations. This makes sizeof(struct llc) 8 again 2006-12-01 17:50:11 +00:00
if_loop.c if_loop doesn't need to keep the list of lo(4) interfaces. Today 2007-10-27 18:25:53 +00:00
if_media.c
if_media.h remove IFM_IEEE80211_HT40PLUS and IFM_IEEE80211_HT40MINUS; they 2007-09-18 20:30:40 +00:00
if_mib.c
if_mib.h
if_ppp.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
if_ppp.h
if_pppvar.h Use callout mechanism instead of timeout()/untimeout(). 2006-12-05 18:54:21 +00:00
if_sl.c
if_slvar.h
if_sppp.h
if_spppfr.c
if_spppsubr.c Cast the ioctl define to the type of the variable being switched on. 2007-06-10 04:53:13 +00:00
if_stf.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
if_stf.h
if_tap.c Add a sysctl net.link.tap.up_on_open which defaults to zero; when it 2007-03-19 18:17:31 +00:00
if_tap.h
if_tapvar.h
if_tun.c Merge first in a series of TrustedBSD MAC Framework KPI changes 2007-10-24 19:04:04 +00:00
if_tun.h
if_types.h Remove IPX over IP tunneling support, which allows IPX routing over IP 2007-06-13 14:01:43 +00:00
if_var.h Add padding for anticipated functionality 2007-12-07 01:46:13 +00:00
if_vlan_var.h Prepare for 802.1p: 2007-02-28 22:05:30 +00:00
if_vlan.c The bridging output function puts the mbuf directly on the interfaces send 2007-10-18 21:22:15 +00:00
if.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
if.h fix bonehead cut and paste error in last commit 2007-12-15 22:06:23 +00:00
iso88025.h
netisr.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
netisr.h Update netisr comment for the SMPng world order: netisr is no longer 2007-12-31 20:58:50 +00:00
pfil.c pfil(9) locking take 3: Switch to rmlock(9) 2007-11-25 12:41:47 +00:00
pfil.h pfil(9) locking take 3: Switch to rmlock(9) 2007-11-25 12:41:47 +00:00
pfkeyv2.h Commit the change from FAST_IPSEC to IPSEC. The FAST_IPSEC 2007-07-03 12:13:45 +00:00
ppp_comp.h
ppp_deflate.c
ppp_defs.h
ppp_tty.c Use callout mechanism instead of timeout()/untimeout(). 2006-12-05 18:54:21 +00:00
radix.c
radix.h
raw_cb.c
raw_cb.h
raw_usrreq.c
route.c Use RTFREE_LOCKED() instead of rtfree() when releasing a reference on the 2008-02-13 16:57:58 +00:00
route.h Add a workaround for a deadlock between the rt_setgate() and rt_check() 2007-12-27 10:00:57 +00:00
rtsock.c In keeping with style(9)'s recommendations on macros, use a ';' 2008-03-16 10:58:09 +00:00
slcompress.c
slcompress.h
slip.h
zlib.c
zlib.h