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

ASIC temperature sensors support #694

Closed
wants to merge 1 commit into from

Conversation

padmanarayana
Copy link

Please do not merge yet.

Recently (opencomputeproject/SAI#880), new switch attributes were added to retrieve the temperature readings from the ASIC's internal sensors.

This is a preliminary commit (pending SAI support from vendors) for temperature monitoring. The max, average and the entire list of temperatures are now added to the flex counters DB so that platform sensors scripts may query and use these values in thermal control algorithms.

What I did

  1. Created a SWITCH_SENSORS_FLEX_GROUP to track sensors in the ASIC
  2. Added SAI_SWITCH_ATTR_MAX_TEMP, SAI_SWITCH_ATTR_AVERAGE_TEMP, SAI_SWITCH_ATTR_TEMP_LIST to the SWITCH sensors flex counters.

Why I did it

To provide a mechanism for platform sensor scripts to have a generic way of querying the ASIC sensors via SAI.

How I verified it

Currently checked using stubs. Awaiting SAI implementation from vendors.

Details if related

Copy link
Contributor

@stcheng stcheng left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

I will check internally about this pull request. it would be better to move the query functions into orchagent.


/* Add switch to flex_counter for updating sensors */
const auto id = sai_serialize_object_id(gSwitchId);
string key = getSwitchSensorsFlexCounterTableKey(id);
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string key = SWITCH_SENSORS_FLEX_GROUP + id;
i think it would be clearer

/* Add switch to flex_counter for updating sensors */
const auto id = sai_serialize_object_id(gSwitchId);
string key = getSwitchSensorsFlexCounterTableKey(id);
std::string delimiter = "";
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

remove the std::

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

Successfully merging this pull request may close these issues.

2 participants