-
Notifications
You must be signed in to change notification settings - Fork 1.8k
[AS9726-32D] support show system-health #8346
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
Closed
seanwu-ec
wants to merge
17
commits into
sonic-net:master
from
seanwu-ec:as9726-32x_support_systemhealth
Closed
Changes from 15 commits
Commits
Show all changes
17 commits
Select commit
Hold shift + click to select a range
f2c305e
Add sensors.conf for AS9726-32D
seanwu-ec 3d0addc
[AS9726-32D] enable thermalctld, disable pcied
seanwu-ec 140b328
[AS9726-32D] remove unneeded code in util.py
seanwu-ec a3a9242
[AS9726-32D] add MFR_MAX_TEMP_1 reading in driver
seanwu-ec 2ec7542
[AS9726-32D] support system-health check
seanwu-ec 0be970d
Fix LGTM alerts
seanwu-ec 0c7b91d
[as9726-32d] add thermal thresholds defined by HW
seanwu-ec cf4aac3
[as9726-32d] skip psu.temperature health check
seanwu-ec d80c699
Fix Sfp.get_name() on AS9726-32D
seanwu-ec fa571f6
Changes for R0C HW
seanwu-ec ccfc52c
Fix LGTM alerts, remove unused import
seanwu-ec 0d63cd7
[AS9726-32D] Add CPU coretemp to thermal.py
seanwu-ec b635441
Merge branch 'master' into as9726-32x_support_systemhealth
seanwu-ec 08a8a22
[AS9726-32D] Remove 6-levels temp thresholds
seanwu-ec 79b3c4d
Merge branch 'master' into as9726-32x_support_systemhealth
seanwu-ec c3b8239
[AS9726-32D] Update pcie.yaml
ec-michael-shih 425e645
[Edgecore][as9726_32d] Fix wrong "show platform fan" status
ec-michael-shih File filter
Filter by extension
Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
There are no files selected for viewing
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
2 changes: 1 addition & 1 deletion
2
device/accton/x86_64-accton_as9726_32d-r0/pmon_daemon_control.json
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,5 +1,5 @@ | ||
| { | ||
| "skip_ledd": true, | ||
| "skip_thermalctld": true | ||
| "skip_pcied": true | ||
| } | ||
|
|
||
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,56 @@ | ||
| # libsensors configuration file for as9726-32d | ||
| # ------------------------------------------------ | ||
| # | ||
|
|
||
| bus "i2c-14" "i2c-1-mux (chan_id 5)" | ||
| bus "i2c-9" "i2c-1-mux (chan_id 0)" | ||
| bus "i2c-15" "i2c-1-mux (chan_id 6)" | ||
|
|
||
|
|
||
| chip "ym2401-i2c-*-58" | ||
| label in3 "PSU 1 Voltage" | ||
| label fan1 "PSU 1 Fan" | ||
| label temp1 "PSU 1 Temperature" | ||
| label power2 "PSU 1 Power" | ||
| label curr2 "PSU 1 Current" | ||
|
|
||
| chip "ym2401-i2c-*-59" | ||
| label in3 "PSU 2 Voltage" | ||
| label fan1 "PSU 2 Fan" | ||
| label temp1 "PSU 2 Temperature" | ||
| label power2 "PSU 2 Power" | ||
| label curr2 "PSU 2 Current" | ||
|
|
||
|
|
||
| chip "as9726_32d_fan-*" | ||
| label fan1 "Fan 1 Front" | ||
| label fan2 "Fan 2 Front" | ||
| label fan3 "Fan 3 Front" | ||
| label fan4 "Fan 4 Front" | ||
| label fan5 "Fan 5 Front" | ||
| label fan6 "Fan 6 Front" | ||
| label fan11 "Fan 1 Rear" | ||
| label fan12 "Fan 2 Rear" | ||
| label fan13 "Fan 3 Rear" | ||
| label fan14 "Fan 4 Rear" | ||
| label fan15 "Fan 5 Rear" | ||
| label fan16 "Fan 6 Rear" | ||
|
|
||
|
|
||
| chip "lm75-i2c-*-48" | ||
| label temp1 "Main Board Temperature" | ||
|
|
||
| chip "lm75-i2c-*-49" | ||
| label temp1 "Main Board Temperature" | ||
|
|
||
| chip "lm75-i2c-*-4a" | ||
| label temp1 "Main Board Temperature" | ||
|
|
||
| chip "lm75-i2c-*-4b" | ||
| label temp1 "CPU Board Temperature" | ||
|
|
||
| chip "lm75-i2c-*-4c" | ||
| label temp1 "OCXO Temperature" | ||
|
|
||
| chip "lm75-i2c-*-4f" | ||
| label temp1 "Main Board Temperature" |
2 changes: 1 addition & 1 deletion
2
device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/__init__.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -1,2 +1,2 @@ | ||
| __all__ = ['chassis', 'eeprom', 'platform', 'psu', 'sfp', 'thermal', 'fan'] | ||
| __all__ = [ "platform", "chassis", "sfp", "eeprom", "component", "psu", "thermal", "fan", "fan_drawer" ] | ||
| from . import platform |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
55 changes: 55 additions & 0 deletions
55
device/accton/x86_64-accton_as9726_32d-r0/sonic_platform/event.py
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
| Original file line number | Diff line number | Diff line change |
|---|---|---|
| @@ -0,0 +1,55 @@ | ||
| try: | ||
| import time | ||
| from .helper import APIHelper | ||
| from sonic_py_common.logger import Logger | ||
| except ImportError as e: | ||
| raise ImportError(repr(e) + " - required module not found") | ||
|
|
||
|
|
||
| class SfpEvent: | ||
| ''' Listen to insert/remove sfp events ''' | ||
|
|
||
| def __init__(self, sfp_list): | ||
| self._api_helper = APIHelper() | ||
| self._sfp_list = sfp_list | ||
| self._logger = Logger() | ||
|
|
||
| sfp_change_event_data = {'valid': 0, 'last': 0, 'present': 0} | ||
| def get_sfp_event(self, timeout=2000): | ||
| now = time.time() | ||
| port_dict = {} | ||
| change_dict = {} | ||
| change_dict['sfp'] = port_dict | ||
|
|
||
| if timeout < 1000: | ||
| timeout = 1000 | ||
| timeout = timeout / float(1000) # Convert to secs | ||
|
|
||
| if now < (self.sfp_change_event_data['last'] + timeout) and self.sfp_change_event_data['valid']: | ||
| return True, change_dict | ||
|
|
||
| bitmap = 0 | ||
| for sfp in self._sfp_list: | ||
| modpres = sfp.get_presence() | ||
| i=sfp.port_num-1 | ||
| if modpres: | ||
| bitmap = bitmap | (1 << i) | ||
|
|
||
| changed_ports = self.sfp_change_event_data['present'] ^ bitmap | ||
| if changed_ports: | ||
| for sfp in self._sfp_list: | ||
| i=sfp.port_num-1 | ||
| if (changed_ports & (1 << i)): | ||
| if (bitmap & (1 << i)) == 0: | ||
| port_dict[i+1] = '0' | ||
| else: | ||
| port_dict[i+1] = '1' | ||
|
|
||
|
|
||
| # Update the cache dict | ||
| self.sfp_change_event_data['present'] = bitmap | ||
| self.sfp_change_event_data['last'] = now | ||
| self.sfp_change_event_data['valid'] = 1 | ||
| return True, change_dict | ||
| else: | ||
| return True, change_dict |
Oops, something went wrong.
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Is there any specific reason to skip the pcied?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
There is no pcie devices, so we skip.