From f8be2696f343eea6842e58555fff6a90cb860eac Mon Sep 17 00:00:00 2001 From: Noa Or Date: Thu, 18 Nov 2021 07:30:56 +0000 Subject: [PATCH] [CoPP] Add always_enabled field --- files/image_config/copp/copp_cfg.j2 | 14 +++++++++----- platform/vs/docker-sonic-vs/init_cfg.json.j2 | 2 +- .../yang-models/sonic-copp.yang | 17 +++++++++++------ 3 files changed, 21 insertions(+), 12 deletions(-) diff --git a/files/image_config/copp/copp_cfg.j2 b/files/image_config/copp/copp_cfg.j2 index c9b15c1279b5..46d921b82765 100755 --- a/files/image_config/copp/copp_cfg.j2 +++ b/files/image_config/copp/copp_cfg.j2 @@ -13,7 +13,7 @@ "trap_priority":"4", "queue": "4" }, - "queue4_group2": { + "queue4_group2": { "trap_action":"copy", "trap_priority":"4", "queue": "4", @@ -69,11 +69,13 @@ }, "lacp": { "trap_ids": "lacp", - "trap_group": "queue4_group1" + "trap_group": "queue4_group1", + "always_enabled": "true" }, "arp": { "trap_ids": "arp_req,arp_resp,neigh_discovery", - "trap_group": "queue4_group2" + "trap_group": "queue4_group2", + "always_enabled": "true" }, "lldp": { "trap_ids": "lldp", @@ -85,11 +87,13 @@ }, "udld": { "trap_ids": "udld", - "trap_group": "queue4_group3" + "trap_group": "queue4_group3", + "always_enabled": "true" }, "ip2me": { "trap_ids": "ip2me", - "trap_group": "queue1_group1" + "trap_group": "queue1_group1", + "always_enabled": "true" }, "macsec": { "trap_ids": "eapol", diff --git a/platform/vs/docker-sonic-vs/init_cfg.json.j2 b/platform/vs/docker-sonic-vs/init_cfg.json.j2 index 0b2ce5124215..418c9b871338 100644 --- a/platform/vs/docker-sonic-vs/init_cfg.json.j2 +++ b/platform/vs/docker-sonic-vs/init_cfg.json.j2 @@ -5,7 +5,7 @@ "buffer_model": "traditional" } }, -{% set features = ["swss", "bgp", "teamd", "nat", "database"] %} +{% set features = ["swss", "bgp", "teamd", "nat", "database", "lldp", "dhcp_relay", "macsec"] %} "FEATURE": { {% for feature in features %} "{{ feature }}": { diff --git a/src/sonic-yang-models/yang-models/sonic-copp.yang b/src/sonic-yang-models/yang-models/sonic-copp.yang index 9805b5fd0cce..c869b439faa9 100644 --- a/src/sonic-yang-models/yang-models/sonic-copp.yang +++ b/src/sonic-yang-models/yang-models/sonic-copp.yang @@ -43,13 +43,13 @@ module sonic-copp { type stypes:copp_packet_action; description "Trap action"; } - + leaf meter_type { mandatory true; type stypes:meter_type; description "Policer meter type"; } - + leaf mode { mandatory true; type enumeration { @@ -59,7 +59,7 @@ module sonic-copp { } description "Policer mode"; } - + leaf color { type enumeration { enum blind; @@ -74,7 +74,7 @@ module sonic-copp { default 0; description "Committed information rate for the dual-rate token - bucket policer. This value represents the rate at which + bucket policer. This value represents the rate at which tokens are added to the primary bucket."; } @@ -118,13 +118,13 @@ module sonic-copp { "Excess burst size for the dual-rate token bucket policer. This value represents the depth of the secondary bucket."; } - + leaf green_action { type stypes:copp_packet_action; default "forward"; description "Green action"; } - + leaf yellow_action { when "((current()/../mode = 'sr_tcm') or (current()/../mode = 'tr_tcm'))"; type stypes:copp_packet_action; @@ -163,6 +163,11 @@ module sonic-copp { } description "reference to CoPP group"; } + + leaf always_enabled { + type boolean; + description "field that indicates whether the trap should be always installed"; + } } /* end of list COPP_TRAP_LIST */ }