[COPP:Yang-changes] Fix for config replace issues seen with COPP configurations #3473
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
==> Issue:
config replace/yang-validation fails for COPP configurations.
==> Root cause:
• COPP's device initial config copp_cfg.json has missing yang mandatory leaf "trap_action" for "default" COPP_GROUP.
• "genetlink_name" & "genetlink_mcgrp_name" nodes are not added in sonic-copp.yang, which are used for "queue2_group1" in copp_cfg.json
==> Fix:
• In copp_cfg.json, mandatory leaf "trap_action" is added for "default" COPP_GROUP.
"COPP_GROUP": {
"default": {
"queue": "0",
"meter_type":"packets",
• "genetlink_name" and "genetlink_mcgrp_name" leaves are added in sonic-copp.yang.
• DB Migration script is updated to upgrade the DB config automatically.
==> Tests :
Config replace ->
i. Config load copp_cfg.json
ii. Config save
iii. Config replace -> Ensure no error seen
Upgrade ->
i. Save config in build without the fix
ii. upgrade to build with changes and ensure configurations are reflected in new config_db.json
==> PRs :
Sonic-buildimage : sonic-net/sonic-buildimage#19817
Sonic-utilities : #3473
SONiC (docs) : sonic-net/SONiC#1773
Signed-off-by: Anukul Verma [email protected]