From: Alexander Kozyrev Date: Wed, 6 May 2020 18:10:59 +0000 (+0000) Subject: net/mlx5: fix Tx queue release debug log timing X-Git-Url: http://git.droids-corp.org/?a=commitdiff_plain;h=776aec28fc47dbf29466555b34cd79ab9cf7a7bc;p=dpdk.git net/mlx5: fix Tx queue release debug log timing Program received signal SIGSEGV, Segmentation fault. 0x00000000008ef7c4 in mlx5_tx_queue_release (dpdk_txq=0x17ce01680) at drivers/net/mlx5/mlx5_txq.c:302 301 mlx5_txq_release(ETH_DEV(priv), i); 302 DRV_LOG(DEBUG, "port %u removing Tx queue %u from list", 303 PORT_ID(priv), txq->idx); The problem is txq is freed inside the mlx5_txq_release() function and no longer valid in the debug log right after this invocation. Move the debug log before the mlx5_txq_release() function to fix this. Fixes: a6d83b6a9209 ("net/mlx5: standardize on negative errno values") Cc: stable@dpdk.org Signed-off-by: Alexander Kozyrev Acked-by: Matan Azrad --- diff --git a/drivers/net/mlx5/mlx5_txq.c b/drivers/net/mlx5/mlx5_txq.c index 29e5cabab6..a211fa91b2 100644 --- a/drivers/net/mlx5/mlx5_txq.c +++ b/drivers/net/mlx5/mlx5_txq.c @@ -298,9 +298,9 @@ mlx5_tx_queue_release(void *dpdk_txq) priv = txq_ctrl->priv; for (i = 0; (i != priv->txqs_n); ++i) if ((*priv->txqs)[i] == txq) { - mlx5_txq_release(ETH_DEV(priv), i); DRV_LOG(DEBUG, "port %u removing Tx queue %u from list", PORT_ID(priv), txq->idx); + mlx5_txq_release(ETH_DEV(priv), i); break; } }