Skip to content

[Edgecore][platform][as7726-32x] Add thermal threshold configuration.#13091

Closed
roger530-ho wants to merge 3 commits intosonic-net:masterfrom
roger530-ho:thermal-threshold
Closed

[Edgecore][platform][as7726-32x] Add thermal threshold configuration.#13091
roger530-ho wants to merge 3 commits intosonic-net:masterfrom
roger530-ho:thermal-threshold

Conversation

@roger530-ho
Copy link
Contributor

@roger530-ho roger530-ho commented Dec 17, 2022

Signed-off-by: roger530-ho [email protected]

Why I did it
The user needs to adjust the thermal threshold during system runtime to meet different deployment cases.

How I did it

  1. Implement set_xxx_threshold method to create /tmp/device_threshold.json during system runtime for saving new threshold.
  2. The get_xxx_threshold method first gets the threshold from /tmp/device_threshold.json; otherwise, it gets the value from the default threshold.

How to verify it

  1. Provide utility to configure the new threshold as below.
 admin@sonic:~$ sudo accton_as7726_32x_util.py threshold -h
usage: accton_as7726_32x_util.py threshold [-h] [-l] [-t THERMAL_NAME] [-ht THRESHOLD_VALUE] [-hct THRESHOLD_VALUE]

optional arguments:
  -h, --help            show this help message and exit
  -l                    list avaliable thermal
  -t THERMAL_NAME       thermal name, ex: -t 'Temp sensor 1'
  -ht THRESHOLD_VALUE   high threshold: 30.0 ~ 110.0
  -hct THRESHOLD_VALUE  high critical threshold : 30.0 ~ 110.0
admin@sonic:~$ sudo accton_as7726_32x_util.py threshold -l
Thermals: 'Temp sensor 1', 'Temp sensor 2', 'Temp sensor 3', 'Temp sensor 4', 'Temp sensor 5', 'Temp sensor 6', 'PSU-1 temp sensor 1', 'PSU-2 temp sensor 1'
  1. Perform 'show platform temperature' to verify the new threshold as below.
 admin@sonic:~$ show platform temperature
             Sensor    Temperature    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
-------------------  -------------  ---------  --------  --------------  -------------  ---------  -----------------
PSU-1 temp sensor 1            0           80       N/A             N/A            N/A      False  20220926 16:58:31
PSU-2 temp sensor 1           29           80       N/A             N/A            N/A      False  20220926 16:58:31
      Temp sensor 1           27           80       N/A             N/A            N/A      False  20220926 16:58:30
      Temp sensor 2           31           80       N/A             N/A            N/A      False  20220926 16:58:30
      Temp sensor 3           28.5         80       N/A             N/A            N/A      False  20220926 16:58:30
      Temp sensor 4           27           80       N/A             N/A            N/A      False  20220926 16:58:30
      Temp sensor 5           28           80       N/A             N/A            N/A      False  20220926 16:58:30
      Temp sensor 6           38           82       N/A           104.0            N/A      False  20220926 16:58:30

admin@sonic:~$ sudo accton_as7726_32x_util.py threshold -t 'Temp sensor 3' -ht 77
Apply the new high threshold successfully.
admin@sonic:~$ show platform temperature
             Sensor    Temperature    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
-------------------  -------------  ---------  --------  --------------  -------------  ---------  -----------------
PSU-1 temp sensor 1            0           80       N/A             N/A            N/A      False  20220926 17:03:30
PSU-2 temp sensor 1           29           80       N/A             N/A            N/A      False  20220926 17:03:30
      Temp sensor 1           27           80       N/A             N/A            N/A      False  20220926 17:03:29
      Temp sensor 2           31           80       N/A             N/A            N/A      False  20220926 17:03:29
      Temp sensor 3           28.5         77       N/A             N/A            N/A      False  20220926 17:03:29
      Temp sensor 4           27           80       N/A             N/A            N/A      False  20220926 17:03:29
      Temp sensor 5           28           80       N/A             N/A            N/A      False  20220926 17:03:29
      Temp sensor 6           38           82       N/A           104.0            N/A      False  20220926 17:03:29

admin@sonic:~$ sudo accton_as7726_32x_util.py threshold -t 'Temp sensor 3' -ht 80
Apply the new high threshold successfully.
admin@sonic:~$ show platform temperature
             Sensor    Temperature    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
-------------------  -------------  ---------  --------  --------------  -------------  ---------  -----------------
PSU-1 temp sensor 1            0           80       N/A             N/A            N/A      False  20220926 17:05:30
PSU-2 temp sensor 1           29           80       N/A             N/A            N/A      False  20220926 17:05:30
      Temp sensor 1           27           80       N/A             N/A            N/A      False  20220926 17:05:29
      Temp sensor 2           31           80       N/A             N/A            N/A      False  20220926 17:05:29
      Temp sensor 3           28.5         80       N/A             N/A            N/A      False  20220926 17:05:29
      Temp sensor 4           27           80       N/A             N/A            N/A      False  20220926 17:05:29
      Temp sensor 5           28           80       N/A             N/A            N/A      False  20220926 17:05:29
      Temp sensor 6           38           82       N/A           104.0            N/A      False  20220926 17:05:29

Which release branch to backport (provide reason below if selected)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211

Description for the changelog

Ensure to add label/tag for the feature raised. example - PR#2174 under sonic-utilities repo. where, Generic Config and Update feature has been labelled as GCU.

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

@roger530-ho roger530-ho requested a review from lguohan as a code owner December 17, 2022 05:18
@lguohan lguohan added the device label Sep 23, 2023
@linux-foundation-easycla
Copy link

CLA Missing ID CLA Not Signed

@roger530-ho
Copy link
Contributor Author

Migrated to PR #23737

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

Projects

None yet

Development

Successfully merging this pull request may close these issues.

2 participants