diff options
-rw-r--r-- | sys/kern/kern_mbuf.c | 7 |
1 files changed, 4 insertions, 3 deletions
diff --git a/sys/kern/kern_mbuf.c b/sys/kern/kern_mbuf.c index 7846be8..8cc8def 100644 --- a/sys/kern/kern_mbuf.c +++ b/sys/kern/kern_mbuf.c @@ -104,13 +104,14 @@ struct mbstat mbstat; static void tunable_mbinit(void *dummy) { + TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); /* This has to be done before VM init. */ - nmbclusters = 1024 + maxusers * 64; + if (nmbclusters == 0) + nmbclusters = 1024 + maxusers * 64; nmbjumbop = nmbclusters / 2; nmbjumbo9 = nmbjumbop / 2; nmbjumbo16 = nmbjumbo9 / 2; - TUNABLE_INT_FETCH("kern.ipc.nmbclusters", &nmbclusters); } SYSINIT(tunable_mbinit, SI_SUB_TUNABLES, SI_ORDER_ANY, tunable_mbinit, NULL); @@ -409,8 +410,8 @@ mb_ctor_mbuf(void *mem, int size, void *arg, int how) if (flags & M_PKTHDR) { m->m_data = m->m_pktdat; m->m_pkthdr.rcvif = NULL; - m->m_pkthdr.len = 0; m->m_pkthdr.header = NULL; + m->m_pkthdr.len = 0; m->m_pkthdr.csum_flags = 0; m->m_pkthdr.csum_data = 0; m->m_pkthdr.tso_segsz = 0; |