[CoPP] Add always_enabled field (#9302)

*Add the "always_enabled" field to copp_cfg.j2 file, in order to allow traps without an entry in features table, to be installed automatically.
This commit is contained in:
noaOrMlnx 2021-11-30 21:04:15 +02:00 committed by Arvindsrinivasan Lakshmi Narasimhan
parent 87d18eb6c3
commit be7f31e6d2
3 changed files with 21 additions and 12 deletions

View File

@ -13,7 +13,7 @@
"trap_priority":"4", "trap_priority":"4",
"queue": "4" "queue": "4"
}, },
"queue4_group2": { "queue4_group2": {
"trap_action":"copy", "trap_action":"copy",
"trap_priority":"4", "trap_priority":"4",
"queue": "4", "queue": "4",
@ -69,11 +69,13 @@
}, },
"lacp": { "lacp": {
"trap_ids": "lacp", "trap_ids": "lacp",
"trap_group": "queue4_group1" "trap_group": "queue4_group1",
"always_enabled": "true"
}, },
"arp": { "arp": {
"trap_ids": "arp_req,arp_resp,neigh_discovery", "trap_ids": "arp_req,arp_resp,neigh_discovery",
"trap_group": "queue4_group2" "trap_group": "queue4_group2",
"always_enabled": "true"
}, },
"lldp": { "lldp": {
"trap_ids": "lldp", "trap_ids": "lldp",
@ -85,11 +87,13 @@
}, },
"udld": { "udld": {
"trap_ids": "udld", "trap_ids": "udld",
"trap_group": "queue4_group3" "trap_group": "queue4_group3",
"always_enabled": "true"
}, },
"ip2me": { "ip2me": {
"trap_ids": "ip2me", "trap_ids": "ip2me",
"trap_group": "queue1_group1" "trap_group": "queue1_group1",
"always_enabled": "true"
}, },
"nat": { "nat": {
"trap_ids": "src_nat_miss,dest_nat_miss", "trap_ids": "src_nat_miss,dest_nat_miss",

View File

@ -5,7 +5,7 @@
"buffer_model": "traditional" "buffer_model": "traditional"
} }
}, },
{% set features = ["swss", "bgp", "teamd", "nat", "database"] %} {% set features = ["swss", "bgp", "teamd", "nat", "database", "lldp", "dhcp_relay", "macsec"] %}
"FEATURE": { "FEATURE": {
{% for feature in features %} {% for feature in features %}
"{{ feature }}": { "{{ feature }}": {

View File

@ -43,13 +43,13 @@ module sonic-copp {
type stypes:copp_packet_action; type stypes:copp_packet_action;
description "Trap action"; description "Trap action";
} }
leaf meter_type { leaf meter_type {
mandatory true; mandatory true;
type stypes:meter_type; type stypes:meter_type;
description "Policer meter type"; description "Policer meter type";
} }
leaf mode { leaf mode {
mandatory true; mandatory true;
type enumeration { type enumeration {
@ -59,7 +59,7 @@ module sonic-copp {
} }
description "Policer mode"; description "Policer mode";
} }
leaf color { leaf color {
type enumeration { type enumeration {
enum blind; enum blind;
@ -74,7 +74,7 @@ module sonic-copp {
default 0; default 0;
description description
"Committed information rate for the dual-rate token "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."; tokens are added to the primary bucket.";
} }
@ -118,13 +118,13 @@ module sonic-copp {
"Excess burst size for the dual-rate token bucket policer. "Excess burst size for the dual-rate token bucket policer.
This value represents the depth of the secondary bucket."; This value represents the depth of the secondary bucket.";
} }
leaf green_action { leaf green_action {
type stypes:copp_packet_action; type stypes:copp_packet_action;
default "forward"; default "forward";
description "Green action"; description "Green action";
} }
leaf yellow_action { leaf yellow_action {
when "((current()/../mode = 'sr_tcm') or (current()/../mode = 'tr_tcm'))"; when "((current()/../mode = 'sr_tcm') or (current()/../mode = 'tr_tcm'))";
type stypes:copp_packet_action; type stypes:copp_packet_action;
@ -163,6 +163,11 @@ module sonic-copp {
} }
description "reference to CoPP group"; 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 */ /* end of list COPP_TRAP_LIST */
} }