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

Inspur feature fix dynamic attr #1053

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

Conversation

inspurSDN
Copy link

No description provided.

meta/Meta.cpp Outdated
if (count == 1)
//Add an attr of type if possible.
sai_attribute_t local[SAI_FDB_ENTRY_ATTR_END]; // 2 for port id and type
if (count <= SAI_FDB_ENTRY_ATTR_END)
Copy link
Collaborator

Choose a reason for hiding this comment

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

count in number of actual attributes, this comparison here with SAI_FDB_ENTRY_ATTR_END is invalid

meta/Meta.cpp Outdated
list = local;
count = 2; // now we added type
bool hasType = false;
for(uint32_t i=0; i<count; i++)
Copy link
Collaborator

Choose a reason for hiding this comment

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

please add spaces to make code more readable, please take a look how other loops are crafted

meta/Meta.cpp Outdated
}
else
{
SWSS_LOG_ERROR("This can bot happen, make sure your sai is running correctly.");
Copy link
Collaborator

Choose a reason for hiding this comment

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

bot ? sai should be capital SAI,

Copy link
Collaborator

Choose a reason for hiding this comment

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

this else is not needed, if you want to iterate through all attributes and then add/not add TYPE

@kcudnik
Copy link
Collaborator

kcudnik commented May 31, 2022

what is motivation for this change ?

@inspurSDN
Copy link
Author

When count is greater than 1, TYPE should also be added, because in the VXLAN environment, the attributes passed by SAI include END_POINT_IP and BRIDGE_PORT_ID but no TYPE.

meta/Meta.cpp Outdated
/* Add an attr of type if there is no SAI_FDB_ENTRY_ATTR_TYPE in data.
* There are two attributes but no SAI_FDB_ENTRY_ATTR_TYPE in VXLAN environment.
*/
sai_attribute_t local[SAI_FDB_ENTRY_ATTR_END];
Copy link
Collaborator

Choose a reason for hiding this comment

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

count possibly can be greater than local array, please use std::vector<sai_attribute_t>

@inspurSDN
Copy link
Author

Retest this please.

7 similar comments
@ryan44guo
Copy link
Contributor

Retest this please.

@ryan44guo
Copy link
Contributor

Retest this please.

@zhouglgh
Copy link

Retest this please.

@ryan44guo
Copy link
Contributor

Retest this please.

@ryan44guo
Copy link
Contributor

Retest this please.

@inspurSDN
Copy link
Author

Retest this please.

@zhouglgh
Copy link

Retest this please.

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