Skip site navigation (1)Skip section navigation (2)
Date:      Thu, 02 Oct 2008 13:46:21 +0100
From:      "Bruce M. Simpson" <bms@FreeBSD.org>
To:        Yony Yossef <yonyossef.lists@gmail.com>
Cc:        freebsd-net@freebsd.org, freebsd-questions@freebsd.org
Subject:   Re: Freeing an mbuf cluster
Message-ID:  <48E4C29D.1020200@FreeBSD.org>
In-Reply-To: <20def4870810020216x31f9c0d8yd4776622928c412e@mail.gmail.com>
References:  <20def4870810020216x31f9c0d8yd4776622928c412e@mail.gmail.com>

next in thread | previous in thread | raw e-mail | index | archive | help
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



Want to link to this message? Use this URL: <https://mail-archive.FreeBSD.org/cgi/mid.cgi?48E4C29D.1020200>