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

[Mellanox] Disable thermal algorithm #159

Closed
wants to merge 4 commits into from
Closed
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension

Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
76 changes: 4 additions & 72 deletions device/mellanox/x86_64-mlnx_msn2700-r0/thermal_policy.json
Original file line number Diff line number Diff line change
@@ -1,80 +1,12 @@
{
{
"thermal_control_algorithm": {
"run_at_boot_up": "true",
"fan_speed_when_suspend": "60"
},
"info_types": [
{
"type": "fan_info"
},
{
"type": "psu_info"
},
{
"type": "chassis_info"
}

],
"policies": [
{
"name": "any fan absence",
"conditions": [
{
"type": "fan.any.absence"
}
],
"actions": [
{
"type": "fan.all.set_speed",
"speed": "100"
}
]
},
{
"name": "any psu absence",
"conditions": [
{
"type": "psu.any.absence"
}
],
"actions": [
{
"type": "fan.all.set_speed",
"speed": "100"
}
]
},
{
"name": "any fan broken",
"conditions": [
{
"type": "fan.any.fault"
}
],
"actions": [
{
"type": "fan.all.set_speed",
"speed": "100"
}
]
},
{
"name": "all fan and psu presence",
"conditions": [
{
"type": "fan.all.presence"
},
{
"type": "psu.all.presence"
},
{
"type": "fan.all.good"
}
],
"actions": [
{
"type": "thermal.recover"
}
]
}

]
}
}
105 changes: 1 addition & 104 deletions platform/mellanox/mlnx-platform-api/sonic_platform/device_data.py
Original file line number Diff line number Diff line change
Expand Up @@ -23,21 +23,13 @@
DEVICE_DATA = {
'x86_64-mlnx_msn2700-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:30":13, "31:40":14 , "41:120":15},
"unk_untrust": {"-127:25":13, "26:30":14 , "31:35":15, "36:120":16}
},
"capability": {
"comex_amb": False
}
}
},
'x86_64-mlnx_msn2740-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:120":13},
"unk_untrust": {"-127:15":13, "16:25":14 , "26:30":15, "31:120":17},
},
"capability": {
"cpu_pack": False,
"comex_amb": False
Expand All @@ -46,10 +38,6 @@
},
'x86_64-mlnx_msn2100-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:40":12, "41:120":13},
"unk_untrust": {"-127:15":12, "16:25":13, "26:30":14, "31:35":15, "36:120":16}
},
"capability": {
"cpu_pack": False,
"comex_amb": False
Expand All @@ -58,108 +46,47 @@
},
'x86_64-mlnx_msn2410-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:30":13, "31:40":14 , "41:120":15},
"unk_untrust": {"-127:25":13, "26:30":14 , "31:35":15, "36:120":16}
},
"capability": {
"comex_amb": False
}
}
},
'x86_64-mlnx_msn2010-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:120":12},
"unk_untrust": {"-127:15":12, "16:20":13 , "21:30":14, "31:35":15, "36:120":16}
},
"capability": {
"cpu_pack": False,
"comex_amb": False
}
}
},
'x86_64-mlnx_msn3700-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:25":12, "26:40":13 , "41:120":14},
"unk_untrust": {"-127:15":12, "16:30":13 , "31:35":14, "36:40":15, "41:120":16},
}
}
},
'x86_64-mlnx_msn3700c-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:40":12, "41:120":13},
"unk_untrust": {"-127:10":12, "11:20":13 , "21:30":14, "31:35":15, "36:120":16},
}
}
},
'x86_64-mlnx_msn3800-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:30":12, "31:40":13 , "41:120":14},
"unk_untrust": {"-127:0":12, "1:10":13 , "11:15":14, "16:20":15, "21:35":16, "36:120":17},
}
}
},
'x86_64-mlnx_msn4700-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:35":14, "36:120":15},
"unk_untrust": {"-127:35":14, "36:120":15},
}
}
},
'x86_64-mlnx_msn4410-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:40":12, "41:120":13},
"unk_untrust": {"-127:10":12, "11:20":13, "21:30":14, "31:35":15, "36:120":16},
}
}
},
'x86_64-mlnx_msn3420-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:120":12},
"unk_untrust": {"-127:25":12, "26:35":13, "36:40":14, "41:120":16},
}
}
},
'x86_64-mlnx_msn4600c-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:40":12, "41:120":13},
"unk_untrust": {"-127:5":12, "6:20":13, "21:30":14, "31:35":15, "36:40":16, "41:120":17},
}
}
},
'x86_64-mlnx_msn4600-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:40": 12, "41:120": 13},
"unk_untrust": {"-127:5": 12, "6:20": 13, "21:30": 14, "31:35": 15, "36:40": 16, "41:120": 17},
}
}
},
'x86_64-nvidia_sn4800-r0': {
'thermal': {
"capability": {
"comex_amb": False
},
'cpu_threshold': (80, 95) # min=80, max=95
}
},
'sfp': {
'max_port_per_line_card': 16
}
},
'x86_64-nvidia_sn2201-r0': {
'thermal': {
'minimum_table': {
"unk_trust": {"-127:30": 13, "31:35": 14, "36:40": 15, "41:120": 16},
"unk_untrust": {"-127:15": 13, "16:20": 14, "21:25": 15, "26:30": 16, "31:35": 17, "36:40": 18, "41:120": 19},
},
"capability": {
"comex_amb": False,
"cpu_amb": True
Expand Down Expand Up @@ -242,19 +169,6 @@ def get_cpu_thermal_count(cls):
def get_sodimm_thermal_count(cls):
return len(glob.glob('/run/hw-management/thermal/sodimm*_temp_input'))

@classmethod
@utils.read_only_cache()
def get_minimum_table(cls):
platform_data = DEVICE_DATA.get(cls.get_platform_name(), None)
if not platform_data:
return None

thermal_data = platform_data.get('thermal', None)
if not thermal_data:
return None

return thermal_data.get('minimum_table', None)

@classmethod
@utils.read_only_cache()
def get_thermal_capability(cls):
Expand Down Expand Up @@ -285,23 +199,6 @@ def get_linecard_max_port_count(cls):
return 0
return sfp_data.get('max_port_per_line_card', 0)

@classmethod
def is_cpu_thermal_control_supported(cls):
return cls.get_cpu_thermal_threshold() != (None, None)

@classmethod
@utils.read_only_cache()
def get_cpu_thermal_threshold(cls):
platform_data = DEVICE_DATA.get(cls.get_platform_name(), None)
if not platform_data:
return None, None

thermal_data = platform_data.get('thermal', None)
if not thermal_data:
return None, None

return thermal_data.get('cpu_threshold', (None, None))

@classmethod
def get_bios_component(cls):
from .component import ComponentBIOS, ComponentBIOSSN2201
Expand Down
3 changes: 2 additions & 1 deletion platform/mellanox/mlnx-platform-api/sonic_platform/fan.py
Original file line number Diff line number Diff line change
Expand Up @@ -216,7 +216,7 @@ def get_target_speed(self):
"""
try:
# Get PSU fan target speed according to current system cooling level
cooling_level = Thermal.get_cooling_level()
cooling_level = utils.read_int_from_file('/run/hw-management/thermal/cooling_cur_state', log_func=None)
return int(self.PSU_FAN_SPEED[cooling_level], 16)
except Exception:
return self.get_speed()
Expand Down Expand Up @@ -250,6 +250,7 @@ def set_speed(self, speed):
logger.log_error('Failed to set PSU FAN speed - {}'.format(e))
return False


class Fan(MlnxFan):
"""Platform-specific Fan class"""
def __init__(self, fan_index, fan_drawer, position):
Expand Down
Loading