Project Home
Project Home
Wiki
Wiki
Discussion Forums
Discussions
Project Information
Project Info
BroadcastCommunity.qnx.com will be offline from May 31 6:00pm until June 2 12:00AM for upcoming system upgrades. For more information please go to https://community.qnx.com/sf/discussion/do/listPosts/projects.bazaar/discussion.bazaar.topc28418
Forum Topic - mbuf m_free(m) crash: Page 1 of 3 (3 Items)
   
mbuf m_free(m) crash  
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