From ee9d7228dab530adf5cf2dd49fd4ee65b8c3925d Mon Sep 17 00:00:00 2001 From: Matthew Dillon Date: Mon, 20 Sep 2010 12:54:43 -0700 Subject: [PATCH] network - Increase MSIZE to 512 * The basic problem with 384 is that kmalloc() may hand back a buffer which crosses a page boundary, which gums up the DMA engines for numerous drivers. Many drivers can only handle one segment per mbuf and even those that can handle more sometimes have fairly low segment count limits. Reported-by: Jan Lentfer --- sys/sys/param.h | 10 ++++++---- 1 file changed, 6 insertions(+), 4 deletions(-) diff --git a/sys/sys/param.h b/sys/sys/param.h index acada705d5..cb9a6a9234 100644 --- a/sys/sys/param.h +++ b/sys/sys/param.h @@ -260,16 +260,18 @@ /* * MBUF Management. * - * MSIZE does not need to be a power of two but must be large enough - * to accomodate a reasonable small packet. Due to m_hdr and m_pkthdr - * bloat 256 is not big enough any more. + * Because many drivers can't deal with multiple DMA segments all mbufs + * must avoid crossing a page boundary. While we can accomodate mbufs + * which are not a power-of-2 sized kmalloc() will only guarantee + * non-crossing alignment if we use a power-of-2. 256 is no longer large + * enough due to m_hdr and m_pkthdr bloat. * * MCLBYTES must be a power of 2 and is typically significantly larger * than MSIZE, sufficient to hold a standard-mtu packet. 2K is considered * reasonable. */ #ifndef MSIZE -#define MSIZE 384 /* size of an mbuf */ +#define MSIZE 512 /* size of an mbuf */ #endif #ifndef MCLSHIFT -- 2.41.0