-
Notifications
You must be signed in to change notification settings - Fork 547
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
[copporch] Add safeguard during policer attribute update #2977
Conversation
Signed-off-by: Vivek Reddy <vkarri@nvidia.com>
Signed-off-by: vkarri <vkarri@nvidia.com>
@prsunny , @StormLiangMS This change is required as a bug fix for 202305. Without this fix, lets assume we are changing some default policer field in copp_cfg.j2 (e.g. Updating CBS/CIR value as in sonic-net/sonic-buildimage#17132) which was present in previous version (202205), then coppmgr logic will do a del of policer and then set with new fields. However due to optimization in orchagent, DEL will be ignored and the SET will set all the policer fields which includes create only fields leading to crash. |
Updating the CREATE_ONLY attributes of the policer will cause a crash | ||
If modified, throw an error log and proceed with changeable attributes | ||
*/ | ||
if(policer_attr.id == SAI_POLICER_ATTR_METER_TYPE) |
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.
Why don't we just check for CREATE_ONLY attribute and skip setting that (Why to check if value is changed or not)?
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.
coppmgr pushes all the fv's down to copporch. if we don't save the old attributes that were created, we can't log an error saying user is trying to change a CREATE_ONLY attribute.
Signed-off-by: Vivek Reddy <vkarri@nvidia.com>
@StormLiangMS Tested on top of 202305 commit sonic-net/sonic-buildimage@688245a |
Cherry-pick PR to 202305: #2996 |
Add safeguard during policer attribute update in copporch when the config is trying to change CREATE_AND_UPDATE attributes by not allowing CREATE_ONLY attributes to pass to SAI
Cherry-pick PR to 202311: #3034 |
Add safeguard during policer attribute update in copporch when the config is trying to change CREATE_AND_UPDATE attributes by not allowing CREATE_ONLY attributes to pass to SAI
What I did
Add safeguard during policer attribute update in copporch when the config is trying to change CREATE_AND_UPDATE attributes by not allowing CREATE_ONLY attributes to pass.
If user tries to update a CREATE_ONLY attribute, it follows the current design of orchagent crash.
Why I did it
During fast-boot, coppmgr does a DEL folowed by SET on the diverged COPP_TABLE key, But while reading the notification, the DEL is optimized and only SET is seen and this would lead to orchagent crash even though, user is only changing CREATE_AND_UPDATE attributes.
How I verified it
Update the copp_cfg.j2 file to update the CIR and CBS, followed by a fast boot, This should simulate divergence in the copp config and the scenario explained above is hit and orchagent did not crash
Added Unit Test
Details if related