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

[vslib]Fix check_object_default_state on objlist. #984

Open
wants to merge 3 commits into
base: master
Choose a base branch
from

Conversation

baxia-lan
Copy link

@baxia-lan baxia-lan commented Dec 7, 2021

Return error only when non SAI_NULL_OBJECT_ID present in objlist.

For issue#983

@kcudnik
Copy link
Collaborator

kcudnik commented Dec 8, 2021

i don't remember where there would be use case for a object_list to contain null object id's, could you explain more what exact issue/scenario are you addressing here ?

@baxia-lan
Copy link
Author

i don't remember where there would be use case for a object_list to contain null object id's, could you explain more what exact issue/scenario are you addressing here ?

Updated issue #983 (comment) describing the scenario.
When deleting a port object, even though a port attribute with objlist type has all SAI_NULL_OBJECT_ID, due to code here, the length of the std::vector<sai_object_id_t> objlist is not 0.

@kcudnik
Copy link
Collaborator

kcudnik commented Dec 9, 2021

Updated issue #983 (comment) describing the scenario.
When deleting a port object, even though a port attribute with objlist type has all SAI_NULL_OBJECT_ID, due to code here, the length of the std::vector<sai_object_id_t> objlist is not 0.

not sure if i follow this exactly, port attribute with objlits should not have null objects list (not null) it should be empty (in SAI vendor), code you pointes is using MAX list size since after that there is a GET api called, and objlist object should be resized to ad list.count received from SAI (which is not, which is a bug here which you are tryin to address? :P)

@kcudnik
Copy link
Collaborator

kcudnik commented Dec 9, 2021

it should be more like this:

objlist.resize(attr.value.objlist.count); // this should be correct count returned
 if (objlist.size())
...

@baxia-lan
Copy link
Author

it should be more like this:

objlist.resize(attr.value.objlist.count); // this should be correct count returned
 if (objlist.size())
...

Done

@baxia-lan baxia-lan changed the title Fix check_object_default_state on objlist. [vslib]Fix check_object_default_state on objlist. Dec 21, 2021
@baxia-lan
Copy link
Author

Hi @kcudnik I don't have write access to the repo, can you please help me merge the PR? Thanks!

@kcudnik
Copy link
Collaborator

kcudnik commented May 5, 2022

please add some unittests to cover at least 50% of the code, we have policy now to enforce that

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.

2 participants