Skip to content

ASIC temperature sensors support#694

Closed
padmanarayana wants to merge 1 commit intosonic-net:masterfrom
padmanarayana:asic_sens_swss
Closed

ASIC temperature sensors support#694
padmanarayana wants to merge 1 commit intosonic-net:masterfrom
padmanarayana:asic_sens_swss

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