-
Notifications
You must be signed in to change notification settings - Fork 274
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
base: master
Are you sure you want to change the base?
Inspur feature fix dynamic attr #1053
Conversation
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) |
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.
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++) |
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.
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."); |
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.
bot ? sai should be capital SAI,
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.
this else is not needed, if you want to iterate through all attributes and then add/not add TYPE
what is motivation for this change ? |
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]; |
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.
count possibly can be greater than local array, please use std::vector<sai_attribute_t>
Retest this please. |
7 similar comments
Retest this please. |
Retest this please. |
Retest this please. |
Retest this please. |
Retest this please. |
Retest this please. |
Retest this please. |
No description provided.