[ECOS] MFREE(m,n) from the DSR context

Nick Garnett nickg@ecoscentric.com
Fri Sep 15 09:30:00 GMT 2006


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



More information about the Ecos-discuss mailing list