]> git.ipfire.org Git - thirdparty/kernel/linux.git/commitdiff
net/mlx5e: Refine TX timeout handling to skip non-timed-out SQ
authorShahar Shitrit <shshitrit@nvidia.com>
Mon, 12 Jan 2026 09:16:23 +0000 (11:16 +0200)
committerPaolo Abeni <pabeni@redhat.com>
Thu, 15 Jan 2026 10:55:05 +0000 (11:55 +0100)
mlx5e_tx_timeout_work() is invoked when the dev_watchdog reports a
timed-out TX queue. Currently, the recovery flow is triggered for all
stopped SQs, which is not always correct — some SQs may be temporarily
stopped without actually timing out. Attempting to recover such SQs
results in no EQE being polled (since no real timeout occurred), which
the driver misinterprets as a recovery failure, unnecessarily causing
channel reopening.

Improve the logic to initiate recovery only for SQs that are both
stopped and timed out. Utilize the helper introduced in the previous
patch to determine whether the netdevice watchdog timeout period has
elapsed since the SQ’s last transmit timestamp.

Signed-off-by: Shahar Shitrit <shshitrit@nvidia.com>
Reviewed-by: Yael Chemla <ychemla@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Link: https://patch.msgid.link/1768209383-1546791-4-git-send-email-tariqt@nvidia.com
Reviewed-by: Simon Horman <horms@kernel.org>
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/mellanox/mlx5/core/en_main.c

index 3ac47df83ac8b7cb0c202c4a18c0904e1ef59936..7dbcf71404d8d1f8149f193cbfe47712bf748df5 100644 (file)
@@ -5137,7 +5137,7 @@ static void mlx5e_tx_timeout_work(struct work_struct *work)
                        netdev_get_tx_queue(netdev, i);
                struct mlx5e_txqsq *sq = priv->txq2sq[i];
 
-               if (!netif_xmit_stopped(dev_queue))
+               if (!netif_xmit_timeout_ms(dev_queue))
                        continue;
 
                if (mlx5e_reporter_tx_timeout(sq))