Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[202012BR][Barefoot] Wedge100bf Add HW-defined thermal thresholds #9584

Closed

Conversation

seanwu-ec
Copy link
Contributor

Signed-off-by: Sean Wu sean_wu@edge-core.com

Why I did it

Makes customers be able to access HW-defined thermal thresholds.

How I did it

  1. HW guys evaluated reasonable thresholds for all sensors according to the result of the environment temperature test.
  2. Add these thresholds to thermal.py

How to verify it

  1. show platform temperature
root@wedge100bf-32x-2:/tmp# show plat temp
                           Sensor    Temperature    High TH    Low TH    Crit High TH    Crit Low TH    Warning          Timestamp
---------------------------------  -------------  ---------  --------  --------------  -------------  ---------  -----------------
   com_e_driver-i2c-4-33:cpu-temp         41          99.75         0             105              0      False  20211217 09:46:37
com_e_driver-i2c-4-33:memory-temp         31          80.75         0              85              0      False  20211217 09:46:54
         coretemp-isa-0000:core-0         40          93            0             104              0      False  20211217 09:45:47
         coretemp-isa-0000:core-1         41          93            0             104              0      False  20211217 09:45:47
         coretemp-isa-0000:core-2         41          93            0             104              0      False  20211217 09:45:47
         coretemp-isa-0000:core-3         41          93            0             104              0      False  20211217 09:45:47
   coretemp-isa-0000:package-id-0         40          93            0             104              0      False  20211217 09:45:47
           pfe1100-i2c-7-5a:temp1         36          47.5          0              50              0      False  20211217 09:46:41
           pfe1100-i2c-7-5a:temp2         24.125      85.5          0              90              0      False  20211217 09:46:43
           pfe1100-i2c-7-59:temp1         23.25       47.5          0              50              0      False  20211217 09:46:38
           pfe1100-i2c-7-59:temp2         22          85.5          0              90              0      False  20211217 09:46:40
   tmp75-i2c-3-4a:inlet-left-temp         27          57            0              60              0      False  20211217 09:46:47
       tmp75-i2c-3-4b:switch-temp         24          99.75         0             105              0      False  20211217 09:46:49
  tmp75-i2c-3-4c:inlet-right-temp         24          57            0              60              0      False  20211217 09:46:50
tmp75-i2c-3-48:outlet-middle-temp         30          76            0              80              0      False  20211217 09:46:44
 tmp75-i2c-3-49:inlet-middle-temp         27.5        57            0              60              0      False  20211217 09:46:46
 tmp75-i2c-8-48:outlet-right-temp         25          76            0              80              0      False  20211217 09:46:52
  tmp75-i2c-8-49:outlet-left-temp         26.5        76            0              80              0      False  20211217 09:46:53
  1. Code my own script to dump thresholds.
root@wedge100bf-32x-2:/tmp# python3 dump_thermal_thresholds.py 
{
    "1": {
        "error": 80750,
        "shutdown": 85000,
        "warning_lower": 0,
        "warning_upper": 76500
    },
    "2": {
        "error": 99750,
        "shutdown": 105000,
        "warning_lower": 0,
        "warning_upper": 94500
    },
    "3": {
        "error": 47500,
        "shutdown": 50000,
        "warning_lower": 0,
        "warning_upper": 45000
    },
    "4": {
        "error": 85500,
        "shutdown": 90000,
        "warning_lower": 0,
        "warning_upper": 81000
    },
    "5": {
        "error": 47500,
        "shutdown": 50000,
        "warning_lower": 0,
        "warning_upper": 45000
    },
    "6": {
        "error": 85500,
        "shutdown": 90000,
        "warning_lower": 0,
        "warning_upper": 81000
    },
    "7": {
        "error": 76000,
        "shutdown": 80000,
        "warning_lower": 0,
        "warning_upper": 72000
    },
    "8": {
        "error": 57000,
        "shutdown": 60000,
        "warning_lower": 0,
        "warning_upper": 54000
    },
    "9": {
        "error": 57000,
        "shutdown": 60000,
        "warning_lower": 0,
        "warning_upper": 54000
    },
    "10": {
        "error": 99750,
        "shutdown": 105000,
        "warning_lower": 0,
        "warning_upper": 94500
    },
    "11": {
        "error": 57000,
        "shutdown": 60000,
        "warning_lower": 0,
        "warning_upper": 54000
    },
    "12": {
        "error": 76000,
        "shutdown": 80000,
        "warning_lower": 0,
        "warning_upper": 72000
    },
    "13": {
        "error": 76000,
        "shutdown": 80000,
        "warning_lower": 0,
        "warning_upper": 72000
    },
    "14": {
        "error": 93000,
        "shutdown": 104000,
        "warning_lower": 0,
        "warning_upper": 82000
    },
    "15": {
        "error": 93000,
        "shutdown": 104000,
        "warning_lower": 0,
        "warning_upper": 82000
    },
    "16": {
        "error": 93000,
        "shutdown": 104000,
        "warning_lower": 0,
        "warning_upper": 82000
    },
    "17": {
        "error": 93000,
        "shutdown": 104000,
        "warning_lower": 0,
        "warning_upper": 82000
    },
    "18": {
        "error": 93000,
        "shutdown": 104000,
        "warning_lower": 0,
        "warning_upper": 82000
    }
}

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

  • 201811
  • 201911
  • 202006
  • 202012: The customers demand it.
  • 202106

Description for the changelog

[Wedge100bf-32X/65X] add HW-defined thermal thresholds

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

Signed-off-by: Sean Wu <sean_wu@edge-core.com>
@lgtm-com
Copy link

lgtm-com bot commented Dec 17, 2021

This pull request introduces 1 alert when merging 391a35e into a41c15a - view on LGTM.com

new alerts:

  • 1 for Wrong name for an argument in a call

@seanwu-ec
Copy link
Contributor Author

This pull request introduces 1 alert when merging 391a35e into a41c15a - view on LGTM.com

new alerts:

  • 1 for Wrong name for an argument in a call

I don't know how come LGTM got this alert. namedtuple DOES have 'defaults' argument, and it works well.

https://docs.python.org/3.7/library/collections.html#collections.namedtuple
https://github.com/python/cpython/blob/041bfafeb00b0e5e565986b01c00bf9cddce3b4c/Lib/collections/__init__.py#L316

@akokhan
Copy link
Contributor

akokhan commented Dec 20, 2021

@seanwu-ec , the same platform scripts are also used for wedge100bf_65x and as9516_32d. Please confirm that the same values are valid for all three. If not, some platform check should be added.

Also, I believe the changes should be added into the master branch first and then cherry-picked into 202012.

@seanwu-ec
Copy link
Contributor Author

@seanwu-ec , the same platform scripts are also used for wedge100bf_65x and as9516_32d. Please confirm that the same values are valid for all three. If not, some platform check should be added.

Also, I believe the changes should be added into the master branch first and then cherry-picked into 202012.

Ah, good point. I wasn't aware of that. I will include all 3 models and create another PR for the master branch. Thanks.

@seanwu-ec seanwu-ec closed this Dec 20, 2021
@akokhan
Copy link
Contributor

akokhan commented Dec 20, 2021

@seanwu-ec , please see the following PR that introduces significant update of platform plugins: #9540
I believe your changes should be based on that.

@seanwu-ec
Copy link
Contributor Author

@akokhan, No problem, will do. Thanks for the hints.

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

2 participants