SAI icon indicating copy to clipboard operation
SAI copied to clipboard

Add sai_query_attribute_enum_values_capability_ext

Open itaibaz opened this issue 1 year ago • 5 comments

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

itaibaz avatar Feb 28 '23 00:02 itaibaz

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.

rck-innovium avatar Mar 02 '23 17:03 rck-innovium

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)

itaibaz avatar Mar 06 '23 20:03 itaibaz

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.

JaiOCP avatar Mar 09 '23 22:03 JaiOCP

/azp run

kcudnik avatar Jun 29 '23 15:06 kcudnik

Azure Pipelines successfully started running 1 pipeline(s).

azure-pipelines[bot] avatar Jun 29 '23 15:06 azure-pipelines[bot]