Skip to content

[action] [PR:18528] [Mellanox]PSU sensors dynamic configuration (#18528)#19801

Merged
mssonicbld merged 1 commit intosonic-net:202311from
mssonicbld:cherry/202311/18528
Aug 3, 2024
Merged

[action] [PR:18528] [Mellanox]PSU sensors dynamic configuration (#18528)#19801
mssonicbld merged 1 commit intosonic-net:202311from
mssonicbld:cherry/202311/18528

Conversation

@mssonicbld
Copy link
Collaborator

  • Why I did it
    Previously, the PSU sensor configuration inside sensors.conf is hardcoded for each platform, allowing no flexibility for other PSU combination possibilities. However, there exists a scenario that user has a second source of PSU which has different sensors compared to the original sensors.conf. Thereby it requires the system to have the ability to dynamically detect the PSU model in using and load relevant sensor’s configuration file.

  • How I did it
    This PR involves a new script and a corresponding data file which contains all PSU model’s sensor configuration info. The script reads the hardware PSU information through hw-management and determines its model. Based on that, it searches for the corresponding pre-defined PSU sensor data, integrate them into the sensors.conf, and let PMON copy it for further loading by lm-sensor.

It also integrates the script inside the platform's get_model() API. Therefore, each time this API is called by the psud code, it checks whether there has been a change in the PSU model. If a change is detected, it updates the PSU sensors configuration by calling the script.

  • How to verify it
    use sensors command and check the psu section is rightly labeled.

Signed-off-by: Yuanzhe, Liu [email protected]

- Why I did it
Previously, the PSU sensor configuration inside sensors.conf is hardcoded for each platform, allowing no flexibility for other PSU combination possibilities. However, there exists a scenario that user has a second source of PSU which has different sensors compared to the original sensors.conf. Thereby it requires the system to have the ability to dynamically detect the PSU model in using and load relevant sensor’s configuration file.

- How I did it
This PR involves a new script and a corresponding data file which contains all PSU model’s sensor configuration info. The script reads the hardware PSU information through hw-management and determines its model. Based on that, it searches for the corresponding pre-defined PSU sensor data, integrate them into the sensors.conf, and let PMON copy it for further loading by lm-sensor.

It also integrates the script inside the platform's get_model() API. Therefore, each time this API is called by the psud code, it checks whether there has been a change in the PSU model. If a change is detected, it updates the PSU sensors configuration by calling the script.

- How to verify it
use sensors command and check the psu section is rightly labeled.

Signed-off-by: Yuanzhe, Liu <[email protected]>
@mssonicbld
Copy link
Collaborator Author

Original PR: #18528

@mssonicbld mssonicbld merged commit 5e94e28 into sonic-net:202311 Aug 3, 2024
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants