netdev.vger.kernel.org archive mirror
 help / color / mirror / Atom feed
From: Saeed Mahameed <saeed@kernel.org>
To: "David S. Miller" <davem@davemloft.net>,
	Jakub Kicinski <kuba@kernel.org>, Paolo Abeni <pabeni@redhat.com>,
	Eric Dumazet <edumazet@google.com>
Cc: Saeed Mahameed <saeedm@nvidia.com>,
	netdev@vger.kernel.org, Tariq Toukan <tariqt@nvidia.com>,
	Gal Pressman <gal@nvidia.com>,
	Leon Romanovsky <leonro@nvidia.com>, Aya Levin <ayal@nvidia.com>,
	Moshe Shemesh <moshe@nvidia.com>
Subject: [net V2 4/9] net/mlx5: Fix fw reporter diagnose output
Date: Fri,  1 Mar 2024 23:03:13 -0800	[thread overview]
Message-ID: <20240302070318.62997-5-saeed@kernel.org> (raw)
In-Reply-To: <20240302070318.62997-1-saeed@kernel.org>

From: Aya Levin <ayal@nvidia.com>

Restore fw reporter diagnose to print the syndrome even if it is zero.
Following the cited commit, in this case (syndrome == 0) command returns no
output at all.

This fix restores command output in case syndrome is cleared:
$ devlink health diagnose pci/0000:82:00.0 reporter fw
    Syndrome: 0

Fixes: d17f98bf7cc9 ("net/mlx5: devlink health: use retained error fmsg API")
Signed-off-by: Aya Levin <ayal@nvidia.com>
Reviewed-by: Moshe Shemesh <moshe@nvidia.com>
Signed-off-by: Saeed Mahameed <saeedm@nvidia.com>
---
 drivers/net/ethernet/mellanox/mlx5/core/health.c | 2 +-
 1 file changed, 1 insertion(+), 1 deletion(-)

diff --git a/drivers/net/ethernet/mellanox/mlx5/core/health.c b/drivers/net/ethernet/mellanox/mlx5/core/health.c
index 8ff6dc9bc803..b5c709bba155 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/health.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/health.c
@@ -452,10 +452,10 @@ mlx5_fw_reporter_diagnose(struct devlink_health_reporter *reporter,
 	struct health_buffer __iomem *h = health->health;
 	u8 synd = ioread8(&h->synd);
 
+	devlink_fmsg_u8_pair_put(fmsg, "Syndrome", synd);
 	if (!synd)
 		return 0;
 
-	devlink_fmsg_u8_pair_put(fmsg, "Syndrome", synd);
 	devlink_fmsg_string_pair_put(fmsg, "Description", hsynd_str(synd));
 
 	return 0;
-- 
2.44.0


  parent reply	other threads:[~2024-03-02  7:03 UTC|newest]

Thread overview: 11+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2024-03-02  7:03 [pull request][net V2 0/9] mlx5 fixes 2024-03-01 Saeed Mahameed
2024-03-02  7:03 ` [net V2 1/9] Revert "net/mlx5: Block entering switchdev mode with ns inconsistency" Saeed Mahameed
2024-03-05  6:10   ` patchwork-bot+netdevbpf
2024-03-02  7:03 ` [net V2 2/9] Revert "net/mlx5e: Check the number of elements before walk TC rhashtable" Saeed Mahameed
2024-03-02  7:03 ` [net V2 3/9] net/mlx5: E-switch, Change flow rule destination checking Saeed Mahameed
2024-03-02  7:03 ` Saeed Mahameed [this message]
2024-03-02  7:03 ` [net V2 5/9] net/mlx5: Check capability for fw_reset Saeed Mahameed
2024-03-02  7:10 ` [net V2 6/9] net/mlx5e: Change the warning when ignore_flow_level is not supported Saeed Mahameed
2024-03-02  7:10 ` [net V2 7/9] net/mlx5e: Fix MACsec state loss upon state update in offload path Saeed Mahameed
2024-03-02  7:10 ` [net V2 8/9] net/mlx5e: Use a memory barrier to enforce PTP WQ xmit submission tracking occurs after populating the metadata_map Saeed Mahameed
2024-03-02  7:10 ` [net V2 9/9] net/mlx5e: Switch to using _bh variant of of spinlock API in port timestamping NAPI poll context Saeed Mahameed

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=20240302070318.62997-5-saeed@kernel.org \
    --to=saeed@kernel.org \
    --cc=ayal@nvidia.com \
    --cc=davem@davemloft.net \
    --cc=edumazet@google.com \
    --cc=gal@nvidia.com \
    --cc=kuba@kernel.org \
    --cc=leonro@nvidia.com \
    --cc=moshe@nvidia.com \
    --cc=netdev@vger.kernel.org \
    --cc=pabeni@redhat.com \
    --cc=saeedm@nvidia.com \
    --cc=tariqt@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;
as well as URLs for NNTP newsgroup(s).