sonic-net / SONiC

Landing page for Software for Open Networking in the Cloud (SONiC) - https://sonic-net.github.io/SONiC/
2.27k stars 1.14k forks source link

[COPP:Yang-changes] Fix for config replace issues seen with COPP configurations #1773

Open Verma-Anukul opened 3 months ago

Verma-Anukul commented 3 months ago

==> 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": {

"trap_action":"trap", <<< this node needs to be added "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 : https://github.com/sonic-net/sonic-buildimage/pull/19817 Sonic-utilities : https://github.com/sonic-net/sonic-utilities/pull/3473 SONiC (docs) : https://github.com/sonic-net/SONiC/pull/1773

Signed-off-by: Anukul Verma anukverm@cisco.com