-
Notifications
You must be signed in to change notification settings - Fork 160
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
Syslog for transceiver high/low temperature alarm #465
base: master
Are you sure you want to change the base?
Conversation
Add syslog for high/low temperature alarm/warning(compare the temperature with threshold) Signed-off-by: chiourung_huang <[email protected]>
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.
@mihirpat1 can you review
@chiourung please fix teh build failrue |
@chiourung Please update these secions Description |
sonic-xcvrd/xcvrd/xcvrd.py
Outdated
} | ||
|
||
for physical_port, physical_port_name in get_physical_port_name_dict(logical_port_name, self.port_mapping).items(): | ||
ori_temp_status = temperature_status.get(physical_port) |
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.
Can you please rename this to orig_temp_status
?
templowwarning = dom_th_info_dict.get("templowwarning") | ||
if temperature != 'N/A' and temphighalarm != 'N/A' and templowalarm != 'N/A' and \ | ||
temphighwarning != 'N/A' and templowwarning != 'N/A': | ||
if float(temperature) > float(temphighalarm): |
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.
@chiourung Can you please update the PR description with the snippet from the C_CMIS spec showing the shutdown behavior of the module due to high temperature.
Also, module shuts down only if current module temperature > temphighalarm or temphighwarning?
templowwarning = dom_th_info_dict.get("templowwarning") | ||
if temperature != 'N/A' and temphighalarm != 'N/A' and templowalarm != 'N/A' and \ | ||
temphighwarning != 'N/A' and templowwarning != 'N/A': | ||
if float(temperature) > float(temphighalarm): |
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.
@chiourung Does the module not shutdown if temperature) == temphighalarm?
sonic-xcvrd/xcvrd/xcvrd.py
Outdated
TEMP_LOW_WARNING = 4 | ||
|
||
TEMP_ERROR_TO_DESCRIPTION_DICT = { | ||
TEMP_NORMAL: "normal", |
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.
TEMP_NORMAL: "normal", | |
TEMP_NORMAL: "temperature normal", |
sonic-xcvrd/xcvrd/xcvrd.py
Outdated
|
||
if ori_temp_status != new_temp_status: | ||
temperature_status[physical_port] = new_temp_status | ||
helper_logger.log_notice("{}: temperature status change from {} to {}".format( |
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.
helper_logger.log_notice("{}: temperature status change from {} to {}".format( | |
helper_logger.log_notice("{}: temperature status changed from {} to {}".format( |
new_temp_status = TEMP_HIGH_ALARM | ||
elif float(temperature) > float(temphighwarning): | ||
new_temp_status = TEMP_HIGH_WARNING | ||
elif float(temperature) < float(templowalarm): | ||
new_temp_status = TEMP_LOW_ALARM | ||
elif float(temperature) < float(templowwarning): | ||
new_temp_status = TEMP_LOW_WARNING | ||
else: | ||
new_temp_status = TEMP_NORMAL |
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.
@chiourung Instead of Xcvrd doing the comparison, there are module flags for low/high warning thresholds in byte 9. Why not use those latched flag?
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.
@prgeor These flags are COR (Clear on Read). Cannot be used to determine if the temperature is from alarm/warning to normal. The comparison of the temperature can be kept to record when the temperature is alarm / warning.
Add syslog for high/low temperature alarm/warning(compare the temperature with threshold)
Description
Add syslog for high/low temperature alarm/warning(compare the temperature with threshold)
Motivation and Context
The ZR transceiver has a protective mechanism that shuts down the transceiver when the temperature is high.
However, the user is not aware when the ZR shuts down due to high temperature.
Add syslog for this situation.
How Has This Been Tested?
syslog:
Additional Information (Optional)