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

Added saithrift support to return sai_object_id for a given system_port_id and read VOQ counters for system port #1931

Merged
merged 2 commits into from
Dec 6, 2023

Conversation

saksarav-nokia
Copy link
Contributor

For VOQ Chassis, the following two API's are added

  1. 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.
  2. 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

Signed-off-by: saksarav <sakthivadivu.saravanaraj@nokia.com>
@saksarav-nokia
Copy link
Contributor Author

@vmittal-msft , this is the saithrift PR for VOQ counters.
Anshu will create PR for sonic-mgmt

@@ -84,6 +85,7 @@ using namespace ::switch_sai;

extern sai_object_id_t gSwitchId;


Copy link
Collaborator

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

extra line not needed

Copy link
Contributor Author

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

@kcudnik
Copy link
Collaborator

kcudnik commented Dec 1, 2023

should we develop saithrift v2 instead of saithrift ?

@saksarav-nokia
Copy link
Contributor Author

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");
Copy link
Contributor

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 ?

Copy link
Contributor Author

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");
Copy link
Contributor

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 ?

Copy link
Contributor Author

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");
Copy link
Contributor

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 ?

Copy link
Contributor Author

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);
Copy link
Contributor

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 ?

Copy link
Contributor Author

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>
@vmittal-msft
Copy link
Contributor

@kcudnik @rlhui i don't have permission to merge. Can you please help ?

@kcudnik kcudnik merged commit 96143ee into opencomputeproject:master Dec 6, 2023
3 checks passed
saksarav-nokia added a commit to saksarav-nokia/SAI that referenced this pull request Dec 22, 2023
…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>
rlhui pushed a commit that referenced this pull request Jan 2, 2024
…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.
kcudnik pushed a commit that referenced this pull request Jan 3, 2024
…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>
@rlhui
Copy link
Collaborator

rlhui commented Jan 11, 2024

@saksarav-nokia which exact test this is needed? Thanks.

@saksarav-nokia
Copy link
Contributor Author

@rlhui , We have enhanced sonic-mgmt Qos LossyQTest to verify the Voq counters.
sonic-net/sonic-mgmt#11000

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