Added saithrift support to return sai_object_id for a given system_port_id and read VOQ counters for system port#1931
Added saithrift support to return sai_object_id for a given system_port_id and read VOQ counters for system port#1931kcudnik merged 2 commits intoopencomputeproject:masterfrom saksarav-nokia:saksarav-voq-counters
Conversation
…rt_id and read VOQ counters for system port Signed-off-by: saksarav <sakthivadivu.saravanaraj@nokia.com>
|
@vmittal-msft , this is the saithrift PR for VOQ counters. |
|
|
||
| extern sai_object_id_t gSwitchId; | ||
|
|
||
|
|
There was a problem hiding this comment.
Removed the extra blank line
|
should we develop saithrift v2 instead of saithrift ? |
I see only .h file in saithriftv2 and the source code is only in saithrift for all the existing functions. |
| } | ||
| // Returns sai_object_id for a system_port_id | ||
| sai_thrift_object_id_t sai_thrift_get_sys_port_obj_id_by_port_id(const int32_t sys_port_id) { | ||
| printf("sai_thrift_get_sys_port_id_by_port_id\n"); |
There was a problem hiding this comment.
Can we use SAI_THRIFT log instead of printf ?
|
|
||
| status = sai_api_query(SAI_API_SWITCH, (void **) &switch_api); | ||
| if (status != SAI_STATUS_SUCCESS) { | ||
| printf("sai_api_query failed!!!\n"); |
There was a problem hiding this comment.
Can we use SAI_THRIFT log instead of printf ?
| attr.id = SAI_SWITCH_ATTR_TYPE; | ||
| status = switch_api->get_switch_attribute(gSwitchId, 1, &attr); | ||
| if (status != SAI_STATUS_SUCCESS) { | ||
| printf("get_switch_attribute failed!!!\n"); |
There was a problem hiding this comment.
Can we use SAI_THRIFT log instead of printf ?
| return SAI_NULL_OBJECT_ID; | ||
| } | ||
| void sai_thrift_get_system_port_attribute(sai_thrift_attribute_list_t& thrift_attr_list, const sai_thrift_object_id_t sys_port_oid) { | ||
| printf("sai_thrift_get_system_port_attribute for 0x%lx\n", sys_port_oid); |
There was a problem hiding this comment.
Can we use SAI_THRIFT log instead of printf ?
Signed-off-by: saksarav <sakthivadivu.saravanaraj@nokia.com>
…rt_id and read VOQ counters for system port (opencomputeproject#1931) For VOQ Chassis, the following two API's are added Reads all the system ports in the switch from SAI and returns the sai_object_id of the system port requested by the sonic-mgmt. Takes the sai_object_id of the system port and returns all the VOQs for that system port. Signed-off-by: saksarav <sakthivadivu.saravanaraj@nokia.com>
…rt_id and read VOQ counters for system port (#1931) For VOQ Chassis, the following two API's are added Reads all the system ports in the switch from SAI and returns the sai_object_id of the system port requested by the sonic-mgmt. Takes the sai_object_id of the system port and returns all the VOQs for that system port.
…rt_id and read VOQ counters for system port (#1931) (#1937) For VOQ Chassis, the following two API's are added Reads all the system ports in the switch from SAI and returns the sai_object_id of the system port requested by the sonic-mgmt. Takes the sai_object_id of the system port and returns all the VOQs for that system port. Signed-off-by: saksarav <sakthivadivu.saravanaraj@nokia.com>
|
@saksarav-nokia which exact test this is needed? Thanks. |
|
@rlhui , We have enhanced sonic-mgmt Qos LossyQTest to verify the Voq counters. |
For VOQ Chassis, the following two API's are added