summaryrefslogtreecommitdiff
path: root/drivers/net/mlx5/mlx5_rss.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_rss.c
parent6af6b973b695ba554f12f92dbcf1394945ca9dfc (diff)
downloaddpdk-next-eventdev-3f2fe392bd49d3b35e54cb3797d02edc2a82175d.zip
dpdk-next-eventdev-3f2fe392bd49d3b35e54cb3797d02edc2a82175d.tar.gz
dpdk-next-eventdev-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_rss.c')
-rw-r--r--drivers/net/mlx5/mlx5_rss.c9
1 files changed, 5 insertions, 4 deletions
diff --git a/drivers/net/mlx5/mlx5_rss.c b/drivers/net/mlx5/mlx5_rss.c
index d3d2603..8942879 100644
--- a/drivers/net/mlx5/mlx5_rss.c
+++ b/drivers/net/mlx5/mlx5_rss.c
@@ -351,11 +351,12 @@ mlx5_dev_rss_reta_update(struct rte_eth_dev *dev,
struct priv *priv = dev->data->dev_private;
assert(!mlx5_is_secondary());
- mlx5_dev_stop(dev);
priv_lock(priv);
ret = priv_dev_rss_reta_update(priv, reta_conf, reta_size);
priv_unlock(priv);
- if (ret)
- return -ret;
- return mlx5_dev_start(dev);
+ if (dev->data->dev_started) {
+ mlx5_dev_stop(dev);
+ mlx5_dev_start(dev);
+ }
+ return -ret;
}