Yurong Sun
01/13/2012 12:32 PM
post90930
|
Hi,
I am currently writing a native network driver for WIFI. I understand that the io-pkt threading model is that "An io-pkt
driver CANNOT create it's own thread". However, we have to have a thread to handle the 2nd half of interrupt handling,
like work_queue usage in Linux.
The problem I saw is that, once we have a transmit Packet, we stored the mbuf pointer in a queue. At the moment when the
DMA is done, we would free the mbuf via m_free. We call m_free in the thread we creat, not the io-pkt thread. The crash
happens when we call m_free.
My suspicion is that this is because we shouldn't call m_free in the thread other than io-pkt thread. Is it true? If yes
, what the best way to deal with this? I read some native driver source code, they seems use timer to periodically
harvest the mbuf. I am worried about the latency by doing this, is there any other way?
Thanks,
Yurong
|
|
|