public inbox for newlib-cvs@sourceware.org
help / color / mirror / Atom feed
* [newlib-cygwin] Add an external mbuf buffer type that holds
@ 2019-09-25  7:03 Sebastian Huber
  0 siblings, 0 replies; only message in thread
From: Sebastian Huber @ 2019-09-25  7:03 UTC (permalink / raw)
  To: newlib-cvs

https://sourceware.org/git/gitweb.cgi?p=newlib-cygwin.git;h=2f55e1fa06fc0236cc0c1a9cd3ca5f8bf9d86a65

commit 2f55e1fa06fc0236cc0c1a9cd3ca5f8bf9d86a65
Author: jhb <jhb@FreeBSD.org>
Date:   Sat Jun 29 00:48:33 2019 +0000

    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

Diff:
---
 newlib/libc/sys/rtems/include/net/if.h | 1 +
 1 file changed, 1 insertion(+)

diff --git a/newlib/libc/sys/rtems/include/net/if.h b/newlib/libc/sys/rtems/include/net/if.h
index a9b875c..a60374d 100644
--- a/newlib/libc/sys/rtems/include/net/if.h
+++ b/newlib/libc/sys/rtems/include/net/if.h
@@ -246,6 +246,7 @@ struct if_data {
 #define	IFCAP_HWSTATS		0x800000 /* manages counters internally */
 #define	IFCAP_TXRTLMT		0x1000000 /* hardware supports TX rate limiting */
 #define	IFCAP_HWRXTSTMP		0x2000000 /* hardware rx timestamping */
+#define	IFCAP_NOMAP		0x4000000 /* can TX unmapped mbufs */
 
 #define IFCAP_HWCSUM_IPV6	(IFCAP_RXCSUM_IPV6 | IFCAP_TXCSUM_IPV6)


^ permalink raw reply	[flat|nested] only message in thread

only message in thread, other threads:[~2019-09-25  7:03 UTC | newest]

Thread overview: (only message) (download: mbox.gz / follow: Atom feed)
-- links below jump to the message on this page --
2019-09-25  7:03 [newlib-cygwin] Add an external mbuf buffer type that holds Sebastian Huber

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox;
as well as URLs for read-only IMAP folder(s) and NNTP newsgroup(s).