From owner-freebsd-bugs Mon May 13 13:31:20 1996 Return-Path: owner-bugs Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id NAA19606 for bugs-outgoing; Mon, 13 May 1996 13:31:20 -0700 (PDT) Received: from kitten.mcs.com (Kitten.mcs.com [192.160.127.90]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id NAA19597 for ; Mon, 13 May 1996 13:31:17 -0700 (PDT) Received: from mailbox.mcs.com (Mailbox.mcs.com [192.160.127.87]) by kitten.mcs.com (8.7.5/8.6.9) with SMTP id PAA28567; Mon, 13 May 1996 15:31:14 -0500 (CDT) Received: by mailbox.mcs.com (/\==/\ Smail3.1.28.1 #28.5) id ; Mon, 13 May 96 15:31 CDT Received: by mercury.mcs.com (/\==/\ Smail3.1.28.1 #28.5) id ; Mon, 13 May 96 15:31 CDT Date: Mon, 13 May 1996 15:31:04 -0500 (CDT) From: Alex Nash X-Sender: nash@Mercury.mcs.com To: Tony Ardolino cc: bugs@FreeBSD.ORG, cam@solidsys.com Subject: Re: Freebsd, mbuf cluster size MINCLSIZE In-Reply-To: <31972068.4DCF@netcon.com> Message-ID: MIME-Version: 1.0 Content-Type: TEXT/PLAIN; charset=US-ASCII Sender: owner-bugs@FreeBSD.ORG X-Loop: FreeBSD.org Precedence: bulk On Mon, 13 May 1996, Tony Ardolino wrote: > We have just completed porting our NetCon product to FreeBSD this product > includes among other things; a NEW IPX/SPX protocol stack, and a NEW NetWare > compatible vfs file system (TFS). Both the protocol stack and file system use > the MBUF subsystem. > What we don't understand is why is MINCLSIZE being set to 208 bytes when it > should be 100 bytes. Is there something wrong here or is that we just > don't understatnd what going on. > > We see the following throughout the FreeBSD code: > > MGET(m, M_WAIT, MT_DATA); > or > MGETHDR(m, M_WAIT, MT_DATA); > if(len >= MINCLSIZE) > MCLGET(m, M_WAIT); > > in mbuf.h > #define MINCLSIZE (MHLEN + MLEN) > MINCLSIZE = 208 ((MLEN = MSIZE 128 - m_hdr 20) + (MHLEN = MLEN 108 - pkthdr > 8) > > should MINCLSIZE == 100 not 208, and if this is a bug how come TCP/IP works > so well. Our code crashes when we have packets > 100 and < 208. > Can anyone shed any light on this please? MINCLSIZE should indeed be 208. For an excellent discussion of this, see Wright/Stevens TCP/IP Illustrated Volume 2. Specifically, pages 31-33. Note that the text points out that clusters are used for buffers greater than *or equal* to 208 bytes, when in fact this should really be greater than 208 bytes. Alex