From: Tariq Toukan <tariqt@nvidia.com>
To: "David S. Miller" <davem@davemloft.net>,
Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
Eric Dumazet <edumazet@google.com>
Cc: <netdev@vger.kernel.org>, Saeed Mahameed <saeedm@nvidia.com>,
Gal Pressman <gal@nvidia.com>,
Leon Romanovsky <leonro@nvidia.com>,
Dragos Tatulea <dtatulea@nvidia.com>,
Breno Leitao <leitao@debian.org>,
Moshe Shemesh <moshe@nvidia.com>,
Tariq Toukan <tariqt@nvidia.com>
Subject: [PATCH net 3/5] net/mlx5e: Take state lock during tx timeout reporter
Date: Thu, 8 Aug 2024 17:41:04 +0300 [thread overview]
Message-ID: <20240808144107.2095424-4-tariqt@nvidia.com> (raw)
In-Reply-To: <20240808144107.2095424-1-tariqt@nvidia.com>
From: Dragos Tatulea <dtatulea@nvidia.com>
mlx5e_safe_reopen_channels() requires the state lock taken. The
referenced changed in the Fixes tag removed the lock to fix another
issue. This patch adds it back but at a later point (when calling
mlx5e_safe_reopen_channels()) to avoid the deadlock referenced in the
Fixes tag.
Fixes: eab0da38912e ("net/mlx5e: Fix possible deadlock on mlx5e_tx_timeout_work")
Signed-off-by: Dragos Tatulea <dtatulea@nvidia.com>
Link: https://lore.kernel.org/all/ZplpKq8FKi3vwfxv@gmail.com/T/
Reviewed-by: Breno Leitao <leitao@debian.org>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c | 2 ++
1 file changed, 2 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
index 22918b2ef7f1..09433b91be17 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/en/reporter_tx.c
@@ -146,7 +146,9 @@ static int mlx5e_tx_reporter_timeout_recover(void *ctx)
return err;
}
+ mutex_lock(&priv->state_lock);
err = mlx5e_safe_reopen_channels(priv);
+ mutex_unlock(&priv->state_lock);
if (!err) {
to_ctx->status = 1; /* all channels recovered */
return err;
--
2.44.0
next prev parent reply other threads:[~2024-08-08 14:43 UTC|newest]
Thread overview: 8+ messages / expand[flat|nested] mbox.gz Atom feed top
2024-08-08 14:41 [PATCH net 0/5] mlx5 misc fixes 2024-08-08 Tariq Toukan
2024-08-08 14:41 ` [PATCH net 1/5] net/mlx5: SD, Do not query MPIR register if no sd_group Tariq Toukan
2024-08-08 14:41 ` [PATCH net 2/5] net/mlx5e: SHAMPO, Increase timeout to improve latency Tariq Toukan
2024-08-08 14:41 ` Tariq Toukan [this message]
2024-08-08 14:41 ` [PATCH net 4/5] net/mlx5e: Correctly report errors for ethtool rx flows Tariq Toukan
2024-08-08 14:41 ` [PATCH net 5/5] net/mlx5e: Fix queue stats access to non-existing channels splat Tariq Toukan
2024-08-08 14:52 ` Joe Damato
2024-08-10 5:30 ` [PATCH net 0/5] mlx5 misc fixes 2024-08-08 patchwork-bot+netdevbpf
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20240808144107.2095424-4-tariqt@nvidia.com \
--to=tariqt@nvidia.com \
--cc=davem@davemloft.net \
--cc=dtatulea@nvidia.com \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--cc=leitao@debian.org \
--cc=leonro@nvidia.com \
--cc=moshe@nvidia.com \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox