From owner-freebsd-questions@FreeBSD.ORG Thu Oct 2 13:05:58 2008 Return-Path: Delivered-To: freebsd-questions@freebsd.org Received: from mx1.freebsd.org (mx1.freebsd.org [IPv6:2001:4f8:fff6::34]) by hub.freebsd.org (Postfix) with ESMTP id 00D11106568B for ; Thu, 2 Oct 2008 13:05:58 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from out3.smtp.messagingengine.com (out3.smtp.messagingengine.com [66.111.4.27]) by mx1.freebsd.org (Postfix) with ESMTP id CB57E8FC14 for ; Thu, 2 Oct 2008 13:05:57 +0000 (UTC) (envelope-from bms@FreeBSD.org) Received: from compute2.internal (compute2.internal [10.202.2.42]) by out1.messagingengine.com (Postfix) with ESMTP id CF6CD17137A; Thu, 2 Oct 2008 08:46:22 -0400 (EDT) Received: from heartbeat2.messagingengine.com ([10.202.2.161]) by compute2.internal (MEProxy); Thu, 02 Oct 2008 08:46:22 -0400 X-Sasl-enc: 2MkX8hjFlbJGIgzevviyxLSbtLFeKNDPbZ20VrrT90m+ 1222951582 Received: from empiric.lon.incunabulum.net (82-35-112-254.cable.ubr07.dals.blueyonder.co.uk [82.35.112.254]) by mail.messagingengine.com (Postfix) with ESMTPSA id 3478A31009; Thu, 2 Oct 2008 08:46:22 -0400 (EDT) Message-ID: <48E4C29D.1020200@FreeBSD.org> Date: Thu, 02 Oct 2008 13:46:21 +0100 From: "Bruce M. Simpson" User-Agent: Thunderbird 2.0.0.14 (X11/20080514) MIME-Version: 1.0 To: Yony Yossef References: <20def4870810020216x31f9c0d8yd4776622928c412e@mail.gmail.com> In-Reply-To: <20def4870810020216x31f9c0d8yd4776622928c412e@mail.gmail.com> X-Enigmail-Version: 0.95.6 Content-Type: text/plain; charset=ISO-8859-1; format=flowed Content-Transfer-Encoding: 7bit Cc: freebsd-net@freebsd.org, freebsd-questions@freebsd.org Subject: Re: Freeing an mbuf cluster X-BeenThere: freebsd-questions@freebsd.org X-Mailman-Version: 2.1.5 Precedence: list List-Id: User questions List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , X-List-Received-Date: Thu, 02 Oct 2008 13:05:58 -0000 Yony Yossef wrote: > Hi All, > > I'm trying to manually build an mbuf chain with clusters in various sizes. > I'm doing it using the MGETHDR and MEXTADD macros, it works fine. > Now I'm looking for the simplest way to free an mbuf cluster, since I want > to free the clusters seperately. This function will be given as a parameter > to MEXTADD. > > Is there a simple command like 'free(buf)' to free an mbuf cluster? > You don't specify if you are trying to add the external storage from a pool you manage, in which case, you're on your own. m_free() for a cluster or mbuf should just "do the right thing". Since the UMA cleanup there are destructor functions which should free the mbuf or cluster using the right pool. m_freem() works on chains, of course. cheers BMS