*BSD News Article 15304


Return to BSD News archive

Newsgroups: comp.unix.bsd
Path: sserve!newshost.anu.edu.au!munnari.oz.au!news.Hawaii.Edu!ames!elroy.jpl.nasa.gov!ncar!destroyer!cs.ubc.ca!van-bc!inde!newshost!gday
From: gday@ignatz.inde.bc.ca (Gordon Day)
Subject: Re: mbuf documentation ?
In-Reply-To: medira@cs.tu-berlin.de's message of 27 Apr 1993 18:32:31 GMT
Message-ID: <GDAY.93Apr28110418@ignatz.inde.bc.ca>
Sender: news@inde.bc.ca
Organization: INDE Electronics, Inc.
References: <1rju7v$jvg@news.cs.tu-berlin.de>
Date: Wed, 28 Apr 1993 19:04:18 GMT
Lines: 25

>>>"cornelia" == Cornelia Langenkamp <medira@cs.tu-berlin.de> writes:

cornelia> Does anybody know why the mbuf-structure has the specified
cornelia> length of 128 Byte ?  Is there any historical reason for
cornelia> that ?  I'd be glad to get some advice for any documentation
cornelia> about mbufs at all.

My guess is that the 128 byte length is the only power of two that
wasn't too big/small for what the mbufs intended purpose was: packet
handling.  The power of two is nice for things like:

   /* address in mbuf to mbuf head */
   #define dtom(x)  ((struct mbuf *)((int)x & ~(MSIZE-1)))

Check out "The Design and Implementation of the 4.3BSD Operating
System" by Leffler, McKusick, Karels, and Quarterman (ISBN 0-201-06196-1)
This gives an overview of the mbuf structure.

Ta,

Gordon.

_______________________________________________________________________________
gordon day, inde electronics, +1-604-430-1446.