-/* Both RTNL lock and vport_mutex need to be held when updating dev_table.
- *
- * If you use vport_locate and then perform some operations, you need to hold
- * one of these locks if you don't want the vport to be deleted out from under
- * you.
- *
- * If you get a reference to a vport through a datapath, it is protected
- * by RCU and you need to hold rcu_read_lock instead when reading.
- *
- * If multiple locks are taken, the hierarchy is:
- * 1. RTNL
- * 2. DP
- * 3. vport
- */
-static DEFINE_MUTEX(vport_mutex);
-
-/**
- * vport_lock - acquire vport lock
- *
- * Acquire global vport lock. See above comment about locking requirements
- * and specific function definitions. May sleep.
- */
-void vport_lock(void)
-{
- mutex_lock(&vport_mutex);
-}
-
-/**
- * vport_unlock - release vport lock
- *
- * Release lock acquired with vport_lock.
- */
-void vport_unlock(void)
-{
- mutex_unlock(&vport_mutex);
-}
-
-#define ASSERT_VPORT() \
-do { \
- if (unlikely(!mutex_is_locked(&vport_mutex))) { \
- pr_err("vport lock not held at %s (%d)\n", \
- __FILE__, __LINE__); \
- dump_stack(); \
- } \
-} while (0)
-