mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 14:25:26 +00:00
netdev-dpdk: Fix thread-safety breach.
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 <alexw@nicira.com> Acked-by: Daniele Di Proietto <ddiproietto@vmware.com>
This commit is contained in:
@@ -622,6 +622,7 @@ netdev_dpdk_set_multiq(struct netdev *netdev_, unsigned int n_txq,
|
|||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
|
||||||
|
ovs_mutex_lock(&dpdk_mutex);
|
||||||
ovs_mutex_lock(&netdev->mutex);
|
ovs_mutex_lock(&netdev->mutex);
|
||||||
rte_eth_dev_stop(netdev->port_id);
|
rte_eth_dev_stop(netdev->port_id);
|
||||||
netdev->up.n_txq = n_txq;
|
netdev->up.n_txq = n_txq;
|
||||||
@@ -632,6 +633,7 @@ netdev_dpdk_set_multiq(struct netdev *netdev_, unsigned int n_txq,
|
|||||||
netdev_dpdk_set_txq(netdev, n_txq);
|
netdev_dpdk_set_txq(netdev, n_txq);
|
||||||
}
|
}
|
||||||
ovs_mutex_unlock(&netdev->mutex);
|
ovs_mutex_unlock(&netdev->mutex);
|
||||||
|
ovs_mutex_unlock(&dpdk_mutex);
|
||||||
|
|
||||||
return err;
|
return err;
|
||||||
}
|
}
|
||||||
|
Reference in New Issue
Block a user