[ovs-dev] [thread-safety 02/11] stp: Make the STP module thread safe.

Ethan Jackson ethan at nicira.com
Wed Jul 31 00:50:02 UTC 2013


> There are definitely ways around the thread safety analysis.  My
> feeling is that we should be pretty strict about it except in modules
> where contention is a real problem.
>
>> Why does stp need a recursive mutex?  I don't see any natural
>> recursion here.

So looking back at this, I'd like to keep the recursive mutex.
stp_send_bpdu() uses a call back function to send a packet through
ofproto-dpif.  If this packet is going through a patch port it could
loop back into the stp module causing a dead lock.  I don't think
there's a clean thread safe way to do this without the recursive mutex
short of ditching the call back function.  I'd be all for doing that
in future, but for now I'd prefer to keep the patch as-is (with the
possible addition of a comment explaining why the recursive mutex is
necessary).


Thoughts?
Ethan
X-CudaMail-Whitelist-To: dev at openvswitch.org



More information about the dev mailing list