Skip to content

Commit 674161b

Browse files
committed
SAI Distributed HW Resource Infra
1 parent 657e537 commit 674161b

2 files changed

Lines changed: 31 additions & 5 deletions

File tree

doc/SAI-Proposal-HW-Resource.md

Lines changed: 13 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -29,11 +29,23 @@ New data type sai_object_stage_t is introduced. This data type specifies if a re
2929

3030
## Capability Query
3131
----------------
32-
Capability query API is enhanced with a query for attribute stage.NOS can query the attribute for a given HW support
32+
New query API is introduced for an attribute's stage. NOS can query the stage of an object's attribute for a given HW support. One of the following stage is returned as part the API
33+
- SAI_ATTR_STAGE_NA: Stage is not applicable
3334
- SAI_ATTR_STAGE_BOTH: Attribute is common to ingress and egress stage
3435
- SAI_ATTR_STAGE_INGRESS: Attribute is applicable only to ingress stage
3536
- SAI_ATTR_STAGE_EGRESS: Attribute is applicabe only to egress stage
3637

38+
Length of the returned array "stage" is attr_count. Caller must provide the buffer for array "stage".
39+
40+
```
41+
sai_status_t sai_query_object_stage(
42+
_In_ sai_object_id_t switch_id,
43+
_In_ sai_object_type_t object_type,
44+
_In_ uint32_t attr_count,
45+
_In_ const sai_attribute_t *attr_list,
46+
_Out_ sai_object_stage_t *stage);
47+
```
48+
3749
## HOSTIF Trap Group
3850
-----------------
3951
A new CREATE_ONLY trap group attribute is introduced. NOS can set this attribute to specify the stage of the trap group.

inc/saiobject.h

Lines changed: 18 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -138,10 +138,6 @@ typedef struct _sai_attr_capability_t
138138
*/
139139
bool get_implemented;
140140

141-
/**
142-
* @brief Attribute stage if applicable
143-
*/
144-
sai_attr_stage_t attr_stage;
145141
} sai_attr_capability_t;
146142

147143
/**
@@ -327,6 +323,24 @@ sai_status_t sai_bulk_object_clear_stats(
327323
_In_ sai_stats_mode_t mode,
328324
_Inout_ sai_status_t *object_statuses);
329325

326+
/**
327+
* @brief Query the HW stage of an attribute for the specified object type
328+
*
329+
* @param[in] switch_id SAI Switch object id
330+
* @param[in] object_type SAI object type
331+
* @param[in] attr_count Count of attributes
332+
* @param[in] attr_list List of attributes
333+
* @param[out] stage HW stage of the attributes. Length of the array should be attr_count. Caller must allocate the buffer.
334+
*
335+
* @return #SAI_STATUS_SUCCESS on success, failure status code on error
336+
*/
337+
sai_status_t sai_query_object_stage(
338+
_In_ sai_object_id_t switch_id,
339+
_In_ sai_object_type_t object_type,
340+
_In_ uint32_t attr_count,
341+
_In_ const sai_attribute_t *attr_list,
342+
_Out_ sai_object_stage_t *stage);
343+
330344
/**
331345
* @}
332346
*/

0 commit comments

Comments
 (0)