From owner-freebsd-current Sun Feb 18 12:23:41 1996 Return-Path: owner-current Received: (from root@localhost) by freefall.freebsd.org (8.7.3/8.7.3) id MAA01695 for current-outgoing; Sun, 18 Feb 1996 12:23:41 -0800 (PST) Received: from news1.gtn.com (news1.gtn.com [192.109.159.3]) by freefall.freebsd.org (8.7.3/8.7.3) with ESMTP id MAA01690 Sun, 18 Feb 1996 12:23:38 -0800 (PST) Received: (from uucp@localhost) by news1.gtn.com (8.7.2/8.7.2) id VAA12746; Sun, 18 Feb 1996 21:00:25 +0100 (MET) Received: (from andreas@localhost) by knobel.gun.de (8.7.3/8.7.3) id UAA02120; Sun, 18 Feb 1996 20:00:52 +0100 (MET) From: Andreas Klemm Message-Id: <199602181900.UAA02120@knobel.gun.de> Subject: Re: mbuf enhancement patch To: nao@sbl.cl.nec.co.jp (Naoki Hamada) Date: Sun, 18 Feb 1996 20:00:52 +0100 (MET) Cc: hackers@freebsd.org, current@freebsd.org In-Reply-To: <199602151344.WAA16411@sirius.sbl.cl.nec.co.jp> from "Naoki Hamada" at Feb 15, 96 10:44:13 pm X-Mailer: ELM [version 2.4 PL24 ME8b] MIME-Version: 1.0 Content-Type: text/plain; charset=US-ASCII Content-Transfer-Encoding: 7bit Sender: owner-current@freebsd.org Precedence: bulk > > > Hello, guys! > > I found mbuf's are not buffered though mclusters are. So here is my > patch for /sys/sys/mbuf.h. This seems to provide me slightly good > network performance. Did one of the core team members accept these patches officially ?! Will they go into -current ? Andreas /// > > -nao > > --- mbuf.h.orig Thu Feb 15 20:48:22 1996 > +++ mbuf.h Thu Feb 15 21:35:27 1996 > @@ -165,6 +165,8 @@ > /* > * mbuf allocation/deallocation macros: > * > + * MMALLOC(struct mbuf *m, int how, int type) > + * allocates an mbuf. > * MGET(struct mbuf *m, int how, int type) > * allocates an mbuf and initializes it to contain internal data. > * > @@ -172,8 +174,18 @@ > * allocates an mbuf and initializes it to contain a packet header > * and internal data. > */ > +#define MMALLOC(m, how, type) \ > + MBUFLOCK( \ > + if (mfree == 0) {\ > + MALLOC((m), struct mbuf *, MSIZE, mbtypes[type], (how)); \ > + } else { \ > + (m) = mfree; \ > + mfree = (m)->m_next; \ > + } \ > + ) > + > #define MGET(m, how, type) { \ > - MALLOC((m), struct mbuf *, MSIZE, mbtypes[type], (how)); \ > + MMALLOC((m), (how), (type)); \ > if (m) { \ > (m)->m_type = (type); \ > MBUFLOCK(mbstat.m_mtypes[type]++;) \ > @@ -186,7 +198,7 @@ > } > > #define MGETHDR(m, how, type) { \ > - MALLOC((m), struct mbuf *, MSIZE, mbtypes[type], (how)); \ > + MMALLOC((m), (how), (type)); \ > if (m) { \ > (m)->m_type = (type); \ > MBUFLOCK(mbstat.m_mtypes[type]++;) \ > @@ -270,7 +282,10 @@ > MCLFREE((m)->m_ext.ext_buf); \ > } \ > (nn) = (m)->m_next; \ > - FREE((m), mbtypes[(m)->m_type]); \ > + MBUFLOCK ( \ > + (m)->m_next = mfree; \ > + mfree = (m); \ > + ) \ > } > #endif > > @@ -358,6 +373,7 @@ > }; > > #ifdef KERNEL > +struct mbuf *mfree; > extern struct mbuf *mbutl; /* virtual address of mclusters */ > extern char *mclrefcnt; /* cluster reference counts */ > struct mbstat mbstat; > -- andreas@knobel.gun.de /\/\___ Wiechers & Partner Datentechnik GmbH Andreas Klemm ___/\/\/ $$ Support Unix - aklemm@wup.de $$ pgp p-key http://www-swiss.ai.mit.edu/~bal/pks-toplev.html >>> powered by <<< ftp://sunsite.unc.edu/pub/Linux/system/Printing/aps-491.tgz >>> FreeBSD <<<