From: Simon Horman <horms@kernel.org>
To: Tariq Toukan <tariqt@nvidia.com>
Cc: "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>,
Shahar Shitrit <shshitrit@nvidia.com>,
Gal Pressman <gal@nvidia.com>, Saeed Mahameed <saeedm@nvidia.com>,
Leon Romanovsky <leon@kernel.org>,
netdev@vger.kernel.org, linux-rdma@vger.kernel.org,
linux-kernel@vger.kernel.org,
Carolina Jubran <cjubran@nvidia.com>
Subject: Re: [PATCH net-next 4/4] net/mlx5: Add sensor name to temperature event message
Date: Sat, 15 Feb 2025 19:29:35 +0000 [thread overview]
Message-ID: <20250215192935.GU1615191@kernel.org> (raw)
In-Reply-To: <20250213094641.226501-5-tariqt@nvidia.com>
On Thu, Feb 13, 2025 at 11:46:41AM +0200, Tariq Toukan wrote:
> From: Shahar Shitrit <shshitrit@nvidia.com>
>
> Previously, a temperature event message included a bitmap indicating
> which sensors detect high temperatures.
>
> To enhance clarity, we modify the message format to explicitly list
> the names of the overheating sensors, alongside the sensors bitmap.
> If HWMON is not configured, the event message remains unchanged.
>
> Signed-off-by: Shahar Shitrit <shshitrit@nvidia.com>
> Reviewed-by: Carolina Jubran <cjubran@nvidia.com>
> Signed-off-by: Tariq Toukan <tariqt@nvidia.com>
Reviewed-by: Simon Horman <horms@kernel.org>
...
> +#if IS_ENABLED(CONFIG_HWMON)
> +static void print_sensor_names_in_bit_set(struct mlx5_core_dev *dev, struct mlx5_hwmon *hwmon,
> + u64 bit_set, int bit_set_offset)
> +{
> + unsigned long *bit_set_ptr = (unsigned long *)&bit_set;
> + int num_bits = sizeof(bit_set) * BITS_PER_BYTE;
> + int i;
> +
> + for_each_set_bit(i, bit_set_ptr, num_bits) {
> + const char *sensor_name = hwmon_get_sensor_name(hwmon, i + bit_set_offset);
> +
> + mlx5_core_warn(dev, "Sensor name[%d]: %s\n", i + bit_set_offset, sensor_name);
> + }
> +}
nit:
If you have to respin for some other reason, please consider limiting lines
to 80 columns wide or less here and elsewhere in this patch where it
doesn't reduce readability (subjective I know).
e.g.:
static void print_sensor_names_in_bit_set(struct mlx5_core_dev *dev,
struct mlx5_hwmon *hwmon,
u64 bit_set, int bit_set_offset)
{
unsigned long *bit_set_ptr = (unsigned long *)&bit_set;
int num_bits = sizeof(bit_set) * BITS_PER_BYTE;
int i;
for_each_set_bit(i, bit_set_ptr, num_bits) {
const char *sensor_name;
sensor_name = hwmon_get_sensor_name(hwmon, i + bit_set_offset);
mlx5_core_warn(dev, "Sensor name[%d]: %s\n",
i + bit_set_offset, sensor_name);
}
}
...
next prev parent reply other threads:[~2025-02-15 19:29 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 ` [PATCH net-next 3/4] net/mlx5: Modify LSB bitmask in temperature event to include only the first bit Tariq Toukan
2025-02-13 12:11 ` 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 [this message]
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=20250215192935.GU1615191@kernel.org \
--to=horms@kernel.org \
--cc=andrew+netdev@lunn.ch \
--cc=cjubran@nvidia.com \
--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 \
--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 an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.