From owner-freebsd-net Mon Jul 1 6:36:39 2002 Delivered-To: freebsd-net@freebsd.org Received: from mx1.FreeBSD.org (mx1.FreeBSD.org [216.136.204.125]) by hub.freebsd.org (Postfix) with ESMTP id 393E937B406 for ; Mon, 1 Jul 2002 06:36:31 -0700 (PDT) Received: from web.cs.ndsu.nodak.edu (web.cs.ndsu.NoDak.edu [134.129.125.7]) by mx1.FreeBSD.org (Postfix) with ESMTP id AAB4543E0A for ; Mon, 1 Jul 2002 06:36:30 -0700 (PDT) (envelope-from tinguely@web.cs.ndsu.nodak.edu) Received: (from tinguely@localhost) by web.cs.ndsu.nodak.edu (8.11.4/8.11.4) id g61DaTW63890; Mon, 1 Jul 2002 08:36:29 -0500 (CDT) (envelope-from tinguely) Date: Mon, 1 Jul 2002 08:36:29 -0500 (CDT) From: mark tinguely Message-Id: <200207011336.g61DaTW63890@web.cs.ndsu.nodak.edu> To: rizzo@icir.org Subject: Re: Should we keep a cache of mbuf+cluster ready for use ? Cc: net@FreeBSD.ORG In-Reply-To: <3D203E3B.F8F91B9B@pipeline.ch> Sender: owner-freebsd-net@FreeBSD.ORG Precedence: bulk List-ID: List-Archive: (Web Archive) List-Help: (List Instructions) List-Subscribe: List-Unsubscribe: X-Loop: FreeBSD.org Luigi Rizzo wrote: > during some experiments i was doing recently, i noticed that there > is a significant improvement in the forwarding speed (especially > at very high speeds) if we keep a small pool of mbuf+cluster > ready for use. I did this a few years back with an IDT NICsTAR ATM driver. I had a privately allocated/managed chunk of memory that held MBUFs and external cluster data. I made it contiguous which is over-kill. The idea was the IDT device needed to load the external buffers into the recieve port. I did not want to waste the time allocating a MBUF, freeing the MBUF only to allocate again. I can pre-index packet header and the DMA address to take care of any expected headers. If the MBUF was allocated when the the buffer was placed into the DMA recieve queue, when the PDU was complete, we could immediately shove the MBUF/cluster into the network stack. when the network stack released the packet, a new flag on the MBUF, which I called M_PERM, signaled the free code to not break the MBUF/cluster association. Then MBUF/cluster combination was programmed into the ATM recieve buffer. (the cluster was the physical address for DMA, the MBUF was the virtual return address returned by the interrupt complete code). --mark tinguely To Unsubscribe: send mail to majordomo@FreeBSD.org with "unsubscribe freebsd-net" in the body of the message