-
Notifications
You must be signed in to change notification settings - Fork 484
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
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 #1931
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. |
@@ -84,6 +85,7 @@ using namespace ::switch_sai; | |||
|
|||
extern sai_object_id_t gSwitchId; | |||
|
|||
|
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
extra line not needed
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
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. |
@@ -4214,6 +4216,119 @@ class switch_sai_rpcHandler : virtual public switch_sai_rpcIf { | |||
|
|||
return status; | |||
} | |||
// 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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use SAI_THRIFT log instead of printf ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it
|
||
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use SAI_THRIFT log instead of printf ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use SAI_THRIFT log instead of printf ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it
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.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Can we use SAI_THRIFT log instead of printf ?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
Fixed it
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