Add sai_query_attribute_enum_values_capability_ext #1766
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
Add extended query enum capabilities function
The new function can accept additional attribute values
Used to query capabilities in case the queried attribute capability is dependent on other attribute values
For example, let's assume the SAI adapter supports different SAI_TUNNEL_ATTR_PEER_MODE values based on the SAI_TUNNEL_ATTR_TYPE. For SAI_TUNNEL_TYPE_IPINIP both SAI_TUNNEL_PEER_MODE_P2P, SAI_TUNNEL_PEER_MODE_P2MP are supported. While for SAI_TUNNEL_TYPE_VXLAN only SAI_TUNNEL_PEER_MODE_P2MP is supported.
There was no way to describe this with the existing API sai_query_attribute_enum_values_capability()
Using the new API, application can pass
attr_id = SAI_TUNNEL_ATTR_PEER_MODE
additional_attr_count=1
additional_attr_list[0].id = SAI_TUNNEL_ATTR_TYPE
additional_attr_list[0].value.s32 = SAI_TUNNEL_TYPE_IPINIP
and query the supported values for IPIMIP
Then pass
attr_id = SAI_TUNNEL_ATTR_PEER_MODE
additional_attr_count=1
additional_attr_list[0].id = SAI_TUNNEL_ATTR_TYPE
additional_attr_list[0].value.s32 = SAI_TUNNEL_TYPE_VXLAN
and query the supported values for VXLAN
In case the SAI adapter doesn't have any relationship/limitations between the queried attribute id and the additional attributes, the additional attributes can just be ignored