Subject: Re: [net V2 5/9] net/mlx5: Register a unique thermal zone per device

From: Saeed Mahameed <[email-masked]>
Date: Wed, 5 Jul 2023 23:09:36 -0700

On 05 Jul 20:20, Jakub Kicinski wrote:
>On Wed,  5 Jul 2023 10:57:53 -0700 Saeed Mahameed wrote:
>> Prior to this patch only one "mlx5" thermal zone could have been
>> registered regardless of the number of individual mlx5 devices in the
>> system.
>>
>> To fix this setup a unique name per device to register its own thermal
>> zone.
>>
>> In order to not register a thermal zone for a virtual device (VF/SF) add
>> a check for PF device type.
>>
>> The new name is a concatenation between "mlx5_" and "<PCI_DEV_BDF>", which
>> will also help associating a thermal zone with its PCI device.
>>
>> $ lspci | grep ConnectX
>> 00:04.0 Ethernet controller: Mellanox Technologies MT2892 Family [ConnectX-6 Dx]
>> 00:05.0 Ethernet controller: Mellanox Technologies MT2892 Family [ConnectX-6 Dx]
>>
>> $ cat /sys/devices/virtual/thermal/thermal_zone0/type
>> mlx5_0000:00:04.0
>> $ cat /sys/devices/virtual/thermal/thermal_zone1/type
>> mlx5_0000:00:05.0
>
>Damn, that's strange. What's the reason you went with thermal zone
>instead of a hwmon device?

hwmon is planned for next release, it will replace the thermal. Internal
code review is almost done.
I just wanted to fix this so those who still have old kernel will at least
enjoy the thermal interface :) ..