newlib-cygwin/newlib/libc
jhb 2f55e1fa06 Add an external mbuf buffer type that holds
multiple unmapped pages.

Unmapped mbufs allow sendfile to carry multiple pages of data in a
single mbuf, without mapping those pages.  It is a requirement for
Netflix's in-kernel TLS, and provides a 5-10% CPU savings on heavy web
serving workloads when used by sendfile, due to effectively
compressing socket buffers by an order of magnitude, and hence
reducing cache misses.

For this new external mbuf buffer type (EXT_PGS), the ext_buf pointer
now points to a struct mbuf_ext_pgs structure instead of a data
buffer.  This structure contains an array of physical addresses (this
reduces cache misses compared to an earlier version that stored an
array of vm_page_t pointers).  It also stores additional fields needed
for in-kernel TLS such as the TLS header and trailer data that are
currently unused.  To more easily detect these mbufs, the M_NOMAP flag
is set in m_flags in addition to M_EXT.

Various functions like m_copydata() have been updated to safely access
packet contents (using uiomove_fromphys()), to make things like BPF
safe.

NIC drivers advertise support for unmapped mbufs on transmit via a new
IFCAP_NOMAP capability.  This capability can be toggled via the new
'nomap' and '-nomap' ifconfig(8) commands.  For NIC drivers that only
transmit packet contents via DMA and use bus_dma, adding the
capability to if_capabilities and if_capenable should be all that is
required.

If a NIC does not support unmapped mbufs, they are converted to a
chain of mapped mbufs (using sf_bufs to provide the mapping) in
ip_output or ip6_output.  If an unmapped mbuf requires software
checksums, it is also converted to a chain of mapped mbufs before
computing the checksum.

Submitted by:	gallatin (earlier version)
Reviewed by:	gallatin, hselasky, rrs
Discussed with:	ae, kp (firewalls)
Relnotes:	yes
Sponsored by:	Netflix
Differential Revision:	https://reviews.freebsd.org/D20616
2019-09-25 09:01:19 +02:00
..
argz ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
ctype update to Unicode 11.0 2019-01-13 23:33:51 +01:00
errno makedoc: make errors visible 2017-12-07 11:54:11 +00:00
iconv ansification: remove _EXFUN, _EXFUN_NOTHROW 2018-01-17 11:47:29 -06:00
include libc/include/devctl.h: Add SOCKCLOSE per FACE Technical Standard, Edition 3.0 2019-09-10 10:49:11 -05:00
locale newlib: Drop incorrect const qualifier from __loadlocale parameter 2018-10-10 11:18:20 +02:00
machine riscv/include/fenv.h: Use shared fenv.h. 2019-09-03 09:52:34 -05:00
misc RISC-V: Do not use _init/_fini 2018-07-30 10:47:57 +02:00
posix scandir: Add support for struct dirent::d_type 2019-02-01 10:37:00 +01:00
reent ansification: remove _DEFUN 2018-01-17 11:47:26 -06:00
search Miscellaneous Makefile.in regenerated 2019-08-09 17:49:16 +02:00
signal Fix newlib functions perror()/psignal() not to use writev(). 2018-07-05 15:33:49 -04:00
ssp AMD GCN Port contributed by Andrew Stubbs <ams@codesourcery.com> 2019-01-15 10:48:08 -05:00
stdio Fix vfwscanf(3) assignment suppression flag handling bug 2019-06-03 10:38:40 +02:00
stdio64 ansification: remove _EXFNPTR, _EXPARM 2018-01-17 11:47:27 -06:00
stdlib fix compile errors for efgcvt.c 2019-07-24 11:58:21 +02:00
string memmem.c and strstr.c: do not require -std=c99 2019-08-14 10:39:37 +02:00
sys Add an external mbuf buffer type that holds 2019-09-25 09:01:19 +02:00
syscalls ansification: remove _HAVE_STDC 2018-01-17 11:47:30 -06:00
time newlib: strftime: fix over-enthusiastic fix from 0283642f35 2018-08-08 23:59:34 +02:00
unix Fix comparison between two character arrays 2018-07-30 09:36:49 +02:00
xdr xdr_private.h needs sys/types.h for u_char 2018-09-06 14:10:42 +02:00
Makefile.am ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
Makefile.in ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
aclocal.m4 Fix up errors in regenerated files for 2.3.0 release. 2016-01-04 12:57:31 -05:00
configure Bump release to 3.1.0 for yearly snapshot 2018-12-31 23:40:11 -05:00
configure.in ssp: add build infrastructure 2017-11-29 11:25:46 -06:00
libc.in.xml ssp: add documentation 2017-11-29 11:25:45 -06:00
libc.texinfo ssp: add documentation 2017-11-29 11:25:45 -06:00
saber Remove matherr, and SVID and X/Open math library configurations 2019-01-23 10:46:24 +01:00
sys.tex Don't include stdio64 functions in reentrant syscalls menu when not bulding stdio64. 2015-08-03 09:54:33 +01:00