John Efstathiades
|
Concurrency and mutual exclusion in io-pkt network drivers
|
John Efstathiades
03/27/2019 7:04 AM
post119608
|
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
|
|
|