fat-rwlock: fat_rwlock_tryrdlock() should never block
fat_rwlock_tryrdlock() used to call fat_rwlock_get_slot__() which could block
in the "slow path" case. This commit adds fat_rwlock_try_get_slot__() which
does not block, even in the "slow path" case.
This fixes a minor issue in dpif-netdev: when the datapath has no registered
upcall handler (e.g. if it is created with dpctl commands), dp_netdev_input()
hangs if it does not find a packet's flow in the classifier. This is
because dpif-netdev uses its upcall_rwlock as a way to enable and disable
upcalls and thus holds the upcall_rwlock write lock as long as upcalls are
disabled. Both holding the write lock and creating a slot require the
fat_rwlock's mutex, causing the hang.
Signed-off-by: Daniele Di Proietto <ddiproietto@vmware.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>