summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_trigger.c
diff options
context:
space:
mode:
authorNĂ©lio Laranjeiro <nelio.laranjeiro@6wind.com>2017-10-09 16:44:43 +0200
committerFerruh Yigit <ferruh.yigit@intel.com>2017-10-12 01:36:58 +0100
commit3f2fe392bd49d3b35e54cb3797d02edc2a82175d (patch)
tree8b96ce80b5bdad32f7175b1e276d50906a20a875 /drivers/net/mlx5/mlx5_trigger.c
parent6af6b973b695ba554f12f92dbcf1394945ca9dfc (diff)
downloaddpdk-3f2fe392bd49d3b35e54cb3797d02edc2a82175d.zip
dpdk-3f2fe392bd49d3b35e54cb3797d02edc2a82175d.tar.gz
dpdk-3f2fe392bd49d3b35e54cb3797d02edc2a82175d.tar.xz
net/mlx5: fix crash during RETA update
Reta update needs to stop/start the port but stopping the port does not disable the polling functions which may end in a segfault if a core is polling the queue while the control thread is modifying it. This patch changes the sequences to an order where such situation cannot happen. Fixes: aa13338faf5e ("net/mlx5: rebuild flows on updating RETA") Cc: stable@dpdk.org Signed-off-by: Nelio Laranjeiro <nelio.laranjeiro@6wind.com> Acked-by: Yongseok Koh <yskoh@mellanox.com>
Diffstat (limited to 'drivers/net/mlx5/mlx5_trigger.c')
-rw-r--r--drivers/net/mlx5/mlx5_trigger.c7
1 files changed, 7 insertions, 0 deletions
diff --git a/drivers/net/mlx5/mlx5_trigger.c b/drivers/net/mlx5/mlx5_trigger.c
index 212b4df..eeb9585 100644
--- a/drivers/net/mlx5/mlx5_trigger.c
+++ b/drivers/net/mlx5/mlx5_trigger.c
@@ -30,6 +30,7 @@
* (INCLUDING NEGLIGENCE OR OTHERWISE) ARISING IN ANY WAY OUT OF THE USE
* OF THIS SOFTWARE, EVEN IF ADVISED OF THE POSSIBILITY OF SUCH DAMAGE.
*/
+#include <unistd.h>
#include <rte_ether.h>
#include <rte_ethdev.h>
@@ -118,6 +119,12 @@ mlx5_dev_stop(struct rte_eth_dev *dev)
return;
priv_lock(priv);
+ dev->data->dev_started = 0;
+ /* Prevent crashes when queues are still in use. */
+ dev->rx_pkt_burst = removed_rx_burst;
+ dev->tx_pkt_burst = removed_tx_burst;
+ rte_wmb();
+ usleep(1000 * priv->rxqs_n);
DEBUG("%p: cleaning up and destroying hash RX queues", (void *)dev);
priv_special_flow_disable_all(priv);
priv_mac_addrs_disable(priv);