[recorder] Fix incorrect attribute enum value capability query#843
Conversation
Recorder was assuming that attribute query is executed for is has a valuetype of a s32 list. When querying SAI_DEBUG_COUNTER_ATTR_TYPE using sai_query_attribute_enum_values_capability a warning is printed in syslog: "enum value 4 not found in enum sai_debug_counter_type". This happens because SAI_DEBUG_COUNTER_ATTR_TYPE attrvaluetype is int32 (enum value) and sai_s32_list_t structure was casted to int32. Since we initialize sai_s32_list with .count = 4 (the number of values in sai_debug_counter_type_t enum) value 4 is printed in the syslog. Signed-off-by: Stepan Blyschak <[email protected]>
|
int32 is exact same as s32 type, what's the problem here? if the problem i that count is treated as first value, then point it to list.list |
|
This serialization works fine, because SAI_DEBUG_COUNTER_ATTR_IN_DROP_REASON_LIST has attrvaluetype of SAI_ATTR_VALUE_TYPE_INT32_LIST -> And below code will not work and throw a warning in log, attrvaluetype for SAI_DEBUG_COUNTER_ATTR_TYPE is SAI_ATTR_VALUE_TYPE_INT32 -> Overall this looks strange because enum value capability serialization is handled as an attribute serialization but enum value capability is not an attribute. [KC] if the problem i that count is treated as first value, then point it to list.list |
|
please provide unittest that will test both test cases |
|
@kcudnik I have thought about it, I wanted to use existing infra (sonic-sairedis/tests), but I found that even existing tests BCM56850/query_attr_enum_values_capability.rec are not checked because 'q' and 'Q' types of operations are skipped - https://github.com/Azure/sonic-sairedis/blob/master/saiplayer/SaiPlayer.cpp#L1980 |
|
could you then add explicit test in lib/src/tests.cpp for Recorder.cpp class for this api? |
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
Signed-off-by: Stepan Blyschak <[email protected]>
run "make check" locally to see if all test will pass |
Signed-off-by: Stepan Blyschak <[email protected]>
|
@kcudnik could you please merge? |
|
something is broken here in tests, can you force push to this ? or add some dumy commit/squast, to retrigger build? |
…m-value-cap-query-recorder
|
@liat-grozovik Yes, cherry-pick into 202012 is clean. |
|
@qiluo-msft or @kcudnik have no permission to run tests on this repo. Can you please retrigger? |
|
something is wrong with this tests, they get canceled, not sure whats happening on this pipeline |
|
It always timeout after 180 min. So something is hanging at "Install dependencies" step. |
…-net#843) Recorder was assuming that enum value capability query is executed for an attribute that has a value type of a s32 list. When querying SAI_DEBUG_COUNTER_ATTR_TYPE using sai_query_attribute_enum_values_capability a warning is printed in syslog: "enum value 4 not found in enum sai_debug_counter_type". This happens because SAI_DEBUG_COUNTER_ATTR_TYPE attrvaluetype is int32 (enum value) and sai_s32_list_t structure was casted to int32. Since we initialize sai_s32_list with .count = 4 (the number of values in sai_debug_counter_type_t enum) value 4 is printed in the syslog.
Recorder was assuming that enum value capability query is executed for an attribute that has a value type of a s32 list. When querying SAI_DEBUG_COUNTER_ATTR_TYPE using sai_query_attribute_enum_values_capability a warning is printed in syslog: "enum value 4 not found in enum sai_debug_counter_type". This happens because SAI_DEBUG_COUNTER_ATTR_TYPE attrvaluetype is int32 (enum value) and sai_s32_list_t structure was casted to int32. Since we initialize sai_s32_list with .count = 4 (the number of values in sai_debug_counter_type_t enum) value 4 is printed in the syslog.
…-net#843) Recorder was assuming that enum value capability query is executed for an attribute that has a value type of a s32 list. When querying SAI_DEBUG_COUNTER_ATTR_TYPE using sai_query_attribute_enum_values_capability a warning is printed in syslog: "enum value 4 not found in enum sai_debug_counter_type". This happens because SAI_DEBUG_COUNTER_ATTR_TYPE attrvaluetype is int32 (enum value) and sai_s32_list_t structure was casted to int32. Since we initialize sai_s32_list with .count = 4 (the number of values in sai_debug_counter_type_t enum) value 4 is printed in the syslog.
Recorder was assuming that enum value capability query is executed for an
attribute that has a value type of a s32 list.
When querying SAI_DEBUG_COUNTER_ATTR_TYPE using
sai_query_attribute_enum_values_capability a warning is printed in
syslog: "enum value 4 not found in enum sai_debug_counter_type".
This happens because SAI_DEBUG_COUNTER_ATTR_TYPE attrvaluetype is int32
(enum value) and sai_s32_list_t structure was casted to int32. Since we
initialize sai_s32_list with .count = 4 (the number of values in
sai_debug_counter_type_t enum) value 4 is printed in the syslog.
Signed-off-by: Stepan Blyschak [email protected]