This is the mail archive of the
ecos-discuss@sourceware.org
mailing list for the eCos project.
Re: MFREE(m,n) from the DSR context
- From: Nick Garnett <nickg at ecoscentric dot com>
- To: manu shetty <shetty_m at yahoo dot com>
- Cc: ecos-discuss at ecos dot sourceware dot org
- Date: 15 Sep 2006 10:29:55 +0100
- Subject: Re: [ECOS] MFREE(m,n) from the DSR context
- References: <20060915082756.50058.qmail@web51705.mail.yahoo.com>
manu shetty <shetty_m@yahoo.com> writes:
> Hi,
> Can I call MFREE(m,n) from the DSR context to
> free the mbuf ?.
No. Ethernet drivers do all IO in a thread context and are passed
scatter/gather lists for data. While these lists are often derived
from an mbuf chain, the driver never gets access to the actual
mbufs. IO is done from a thread context since it is necessary to have
the network stack locked during the call. Any attempt to manipulate
mbufs or any other network stack data structures outside the lock
would result in data corruption. If you are writing drivers for some
other device, you should follow the model established by the ethernet
drivers.
--
Nick Garnett eCos Kernel Architect
http://www.ecoscentric.com The eCos and RedBoot experts
--
Before posting, please read the FAQ: http://ecos.sourceware.org/fom/ecos
and search the list archive: http://ecos.sourceware.org/ml/ecos-discuss