SAI Switch Temperature Attributes for Sub-degree Precision#2306
SAI Switch Temperature Attributes for Sub-degree Precision#2306bp899348 wants to merge 1 commit into
Conversation
SAI Switch Temperature Attributes for Sub-degree Precision `SAI_SWITCH_ATTR_TEMP_LIST` returns temperature values rounded to whole degrees Celsius. This discards sub-degree precision that is available from the hardware, making it unsuitable for applications that require finer thermal granularity. Signed-off-by: Barmesh Pandey <barmeshwar.pandey@broadcom.com>
| * | ||
| * @type sai_s32_list_t | ||
| * @flags READ_ONLY | ||
| */ |
There was a problem hiding this comment.
The commit added a new tag @precision. You can define the precision in SAI_SWITCH_ATTR_TEMP_LIST_RAW and no need SAI_SWITCH_ATTR_TEMP_BASE_TEN_PRECISION. You can get the precision from the meta data attr->valuePrecision.
See the examples in https://github.com/opencomputeproject/SAI/blob/master/experimental/saiexperimentalotnoa.h
There was a problem hiding this comment.
Thank you for the suggestion. The @precision tag is a compile-time constant in the metadata — it is hardcoded at attribute definition time and cannot change at runtime.
In our case, the temperature resolution is hardware and platform dependent and must be queried at runtime. SAI_SWITCH_ATTR_TEMP_BASE_TEN_PRECISION is a READ_ONLY attribute that the driver reports dynamically, allowing consumers to adapt without any code or metadata change as platforms evolve.
So yes, @precision would still be hardcoded — just in a different place.
SAI Switch Temperature Attributes for Sub-degree Precision
SAI_SWITCH_ATTR_TEMP_LISTreturns temperature values rounded to whole degrees Celsius. This discards sub-degree precision that is available from the hardware, making it unsuitable for applications that require finer thermal granularity.