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>,
"Andrew Lunn" <andrew+netdev@lunn.ch>
Cc: Shahar Shitrit <shshitrit@nvidia.com>,
Gal Pressman <gal@nvidia.com>, Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
"Tariq Toukan" <tariqt@nvidia.com>, <netdev@vger.kernel.org>,
<linux-rdma@vger.kernel.org>, <linux-kernel@vger.kernel.org>
Subject: [PATCH net-next 3/4] net/mlx5: Modify LSB bitmask in temperature event to include only the first bit
Date: Thu, 13 Feb 2025 11:46:40 +0200 [thread overview]
Message-ID: <20250213094641.226501-4-tariqt@nvidia.com> (raw)
In-Reply-To: <20250213094641.226501-1-tariqt@nvidia.com>
From: Shahar Shitrit <shshitrit@nvidia.com>
In the sensor_count field of the MTEWE register, bits 1-62 are
supported only for unmanaged switches, not for NICs, and bit 63
is reserved for internal use.
To prevent confusing output that may include set bits that are
not relevant to NIC sensors, we update the bitmask to retain only
the first bit, which corresponds to the sensor ASIC.
Signed-off-by: Shahar Shitrit <shshitrit@nvidia.com>
Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
---
drivers/net/ethernet/mellanox/mlx5/core/events.c | 4 ++++
1 file changed, 4 insertions(+)
diff --git a/drivers/net/ethernet/mellanox/mlx5/core/events.c b/drivers/net/ethernet/mellanox/mlx5/core/events.c
index a661aa522a9a..e85a9042e3c2 100644
--- a/drivers/net/ethernet/mellanox/mlx5/core/events.c
+++ b/drivers/net/ethernet/mellanox/mlx5/core/events.c
@@ -163,6 +163,10 @@ static int temp_warn(struct notifier_block *nb, unsigned long type, void *data)
u64 value_msb;
value_lsb = be64_to_cpu(eqe->data.temp_warning.sensor_warning_lsb);
+ /* bit 1-63 are not supported for NICs,
+ * hence read only bit 0 (asic) from lsb.
+ */
+ value_lsb &= 0x1;
value_msb = be64_to_cpu(eqe->data.temp_warning.sensor_warning_msb);
if (net_ratelimit())
--
2.45.0
next prev parent reply other threads:[~2025-02-13 9:47 UTC|newest]
Thread overview: 14+ messages / expand[flat|nested] mbox.gz Atom feed top
2025-02-13 9:46 [PATCH net-next 0/4] mlx5: Add sensor name in temperature message Tariq Toukan
2025-02-13 9:46 ` [PATCH net-next 1/4] net/mlx5: Apply rate-limiting to high temperature warning Tariq Toukan
2025-02-13 10:15 ` Mateusz Polchlopek
2025-02-13 9:46 ` [PATCH net-next 2/4] net/mlx5: Prefix temperature event bitmap with '0x' for clarity Tariq Toukan
2025-02-13 10:33 ` Mateusz Polchlopek
2025-02-13 9:46 ` Tariq Toukan [this message]
2025-02-13 12:11 ` [PATCH net-next 3/4] net/mlx5: Modify LSB bitmask in temperature event to include only the first bit Mateusz Polchlopek
2025-02-13 9:46 ` [PATCH net-next 4/4] net/mlx5: Add sensor name to temperature event message Tariq Toukan
2025-02-15 19:29 ` Simon Horman
2025-02-18 0:27 ` Jakub Kicinski
2025-02-19 13:00 ` Tariq Toukan
2025-02-19 15:28 ` Jakub Kicinski
2025-02-20 22:22 ` Saeed Mahameed
2025-02-18 0:40 ` [PATCH net-next 0/4] mlx5: Add sensor name in temperature message 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=20250213094641.226501-4-tariqt@nvidia.com \
--to=tariqt@nvidia.com \
--cc=andrew+netdev@lunn.ch \
--cc=davem@davemloft.net \
--cc=edumazet@google.com \
--cc=gal@nvidia.com \
--cc=kuba@kernel.org \
--cc=leon@kernel.org \
--cc=linux-kernel@vger.kernel.org \
--cc=linux-rdma@vger.kernel.org \
--cc=netdev@vger.kernel.org \
--cc=pabeni@redhat.com \
--cc=saeedm@nvidia.com \
--cc=shshitrit@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