Skip to content

Switch Capability support #728

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

Merged
merged 1 commit into from
Dec 13, 2020

Conversation

PrabhuSreenivasan
Copy link
Contributor

Signed-off-by: Prabhu Sreenivasan [email protected]

Adds SAI_SWITCH_ATTR_SUPPORTED_OBJECT_TYPE_LIST to switch attributes.

Related PRs:
sonic-net/sonic-swss#1525

SAI_OBJECT_TYPE_TAM_TRANSPORT,
SAI_OBJECT_TYPE_TAM_TELEMETRY,
SAI_OBJECT_TYPE_TAM_EVENT_THRESHOLD
};
Copy link
Collaborator

Choose a reason for hiding this comment

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

actually all objects are supported, you can create any objects, but not all read only attributes will work, they need to be refreshed manually

Copy link
Collaborator

Choose a reason for hiding this comment

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

also NULL object should not be on that list ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

use std::vector<sai_object_type_t> maybe ?

Copy link
Collaborator

Choose a reason for hiding this comment

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

also move that closes to the first use

CHECK_STATUS(set(SAI_OBJECT_TYPE_SWITCH, m_switch_id, &attr));

attr.id = SAI_SWITCH_ATTR_SUPPORTED_OBJECT_TYPE_LIST;
attr.value.s32list.count = sizeof(supported_obj_list);
Copy link
Collaborator

Choose a reason for hiding this comment

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

sizeof(supported_obj_list)/sizeof(int32_t) ??

Copy link
Collaborator

@kcudnik kcudnik left a comment

Choose a reason for hiding this comment

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

address comments

@kcudnik
Copy link
Collaborator

kcudnik commented Dec 7, 2020

can you also add here unittests for this ? you can add them in vslib/src/tests.cpp

CHECK_STATUS(set(SAI_OBJECT_TYPE_SWITCH, m_switch_id, &attr));

// Fill this with supported SAI_OBJECT_TYPEs
int32_t supported_obj_list[] = {
Copy link
Collaborator

Choose a reason for hiding this comment

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

change to sai_object_type_t instead of int32_t

@PrabhuSreenivasan
Copy link
Contributor Author

can you also add here unittests for this ? you can add them in vslib/src/tests.cpp

sure. I will add the same.

Signed-off-by: Prabhu Sreenivasan <[email protected]>
@kcudnik
Copy link
Collaborator

kcudnik commented Dec 8, 2020

retest vs please

@lguohan lguohan merged commit 9209a07 into sonic-net:master Dec 13, 2020
@PrabhuSreenivasan PrabhuSreenivasan deleted the switch_capability branch December 15, 2020 07:07
kktheballer pushed a commit to kktheballer/sonic-sairedis that referenced this pull request Mar 10, 2021
Adds SAI_SWITCH_ATTR_SUPPORTED_OBJECT_TYPE_LIST to switch attributes.

Signed-off-by: Prabhu Sreenivasan <[email protected]>
pettershao-ragilenetworks pushed a commit to pettershao-ragilenetworks/sonic-sairedis that referenced this pull request Nov 18, 2022
Adds SAI_SWITCH_ATTR_SUPPORTED_OBJECT_TYPE_LIST to switch attributes.

Signed-off-by: Prabhu Sreenivasan <[email protected]>
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

3 participants