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>
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;
}
* (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>
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);