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

Add sai_query_attribute_enum_values_capability_ext #1766

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

itaibaz
Copy link
Collaborator

@itaibaz itaibaz commented Feb 28, 2023

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

@rck-innovium
Copy link
Contributor

As I discussed in the meeting, few possible problems with the current proposal are:

  • How will the new "ext" API work to identify the enums supported on an attribute A that is dependent on attribute B which in turn is dependent on attribute C?
  • application needs to know which attribute type depends on which attribute

@JaiOCP  Please elaborate on the use-case you said is coming up.

@itaibaz
Copy link
Collaborator Author

itaibaz commented Mar 6, 2023

One of suggested solutions during the meeting
input list of attribs (same as create)
attr_a = X
attr_b = Y
attr_c = Z

output per attribute capability list, in this case
attr_a capability given (attr_b=Y, attr_c=Z)
attr_b capability given (attr_a = X, attr_c = Z)
attr_c capability given (attr_a = X, attr_b = Y)

@JaiOCP
Copy link
Contributor

JaiOCP commented Mar 9, 2023

One of suggested solutions during the meeting input list of attribs (same as create) attr_a = X attr_b = Y attr_c = Z

output per attribute capability list, in this case attr_a capability given (attr_b=Y, attr_c=Z) attr_b capability given (attr_a = X, attr_c = Z) attr_c capability given (attr_a = X, attr_b = Y)

Hi Itai,

This is exactly what I am looking.

Can you please add an example in comments for such query.

@kcudnik
Copy link
Collaborator

kcudnik commented Jun 29, 2023

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

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

Successfully merging this pull request may close these issues.

4 participants