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 - Concurrency and mutual exclusion in io-pkt network drivers: Page 1 of 10 (10 Items)
   
Concurrency and mutual exclusion in io-pkt network drivers  
Hello,

I am developing a driver for a PCI-based network interface for QNX 7. I have read the Writing Network Drivers for io-pkt
 section in the Core Networking Stack User's Guide and looked at the ravb and mx6x driver source.

It is still not entirely clear to me if and when there may be more than one thread executing the driver code. I don't 
anticipate having to create my own separate driver threads.

My device has MSI-X interrupts so I plan to have multiple ISRs, one for each MSI-X interrupt source. I would therefore 
expect that multiple interrupt event handling threads could run concurrently. If that is possible I will need to protect
 driver resources, including device registers, from concurrent access. 

Can the io-pkt stack context thread run concurrently with the interrupt event handling threads? For example, can the 
stack queue packets for transmission or update the link speed, etc, while receive and transmit interrupt events are 
being processed by io-pkt worker threads?

The drivers source I have looked at has almost no locking. There is a little use of nic_mutex_lock/unlock but only in 
some peripheral cases. Is nic_mutex_lock/unlock the right mechanism to provide access serialisation in the driver code?

BTW, I cannot find mention of nic_mutex_lock/unlock and nic_delay in the documentation. Where are these functions 
described?

If anyone can shed some light on this it would be greatly appreciated.

Thanks,
John