lib/dpif-netdev: Make emc_mutex recursive.
authorJarno Rajahalme <jrajahalme@nicira.com>
Mon, 8 Sep 2014 22:33:00 +0000 (15:33 -0700)
committerJarno Rajahalme <jrajahalme@nicira.com>
Mon, 8 Sep 2014 22:33:00 +0000 (15:33 -0700)
commit3c33f0ffe76c83f7ec1786175ef34f776892cc0d
treed888ca4ae99aaf237e023a7f98454fab67b39fed
parent5545e7826896e861c07a04161d6db64ed61289fe
lib/dpif-netdev: Make emc_mutex recursive.

dpif_netdev_execute may be called while doing upcall processing.
Since the context of the input port is not tracked upto this point, we
use the shared dp->emc_cache for packet execution, where the emc_cache
is needed for recirculation.

While recursive mutexes can make thread safety analysis hard, for now
we change emc_mutex to be recursive.  Forthcoming new unit tests will
fail with the current non-recursive mutex.  Later improvements may
remove the need for this recursion.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Daniele Di Proietto <ddiproietto@vmware.com>
lib/dpif-netdev.c