dpdk_eth_dev_init() must be called with dpdk_mutex.  However,
netdev_dpdk_set_multiq() fails to follow this rule.  This commit
fixes this breach.

Found by clang.

Signed-off-by: Alex Wang <al...@nicira.com>
---
 lib/netdev-dpdk.c |    2 ++
 1 file changed, 2 insertions(+)

diff --git a/lib/netdev-dpdk.c b/lib/netdev-dpdk.c
index e66eb6e..df45d72 100644
--- a/lib/netdev-dpdk.c
+++ b/lib/netdev-dpdk.c
@@ -618,6 +618,7 @@ netdev_dpdk_set_multiq(struct netdev *netdev_, unsigned int 
n_txq,
     struct netdev_dpdk *netdev = netdev_dpdk_cast(netdev_);
     int err = 0;
 
+    ovs_mutex_lock(&dpdk_mutex);
     if (netdev->up.n_txq == n_txq && netdev->up.n_rxq == n_rxq) {
         return err;
     }
@@ -632,6 +633,7 @@ netdev_dpdk_set_multiq(struct netdev *netdev_, unsigned int 
n_txq,
         netdev_dpdk_set_txq(netdev, n_txq);
     }
     ovs_mutex_unlock(&netdev->mutex);
+    ovs_mutex_unlock(&dpdk_mutex);
 
     return err;
 }
-- 
1.7.9.5

_______________________________________________
dev mailing list
dev@openvswitch.org
http://openvswitch.org/mailman/listinfo/dev

Reply via email to