diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 5059c050c3d..758787f5c17 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -26,6 +26,7 @@ * [CRM](#crm) * [CRM DASH](#crm-dash) * [DEBUG_COUNTER and DEBUG_COUNTER_DROP_REASON](#debug_counter-and-debug_counter_drop_reason) + * [DEBUG_DROP_MONITOR](#debug_drop_monitor) * [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER) * [Device Metadata](#device-metadata) * [Device neighbor metada](#device-neighbor-metada) @@ -987,19 +988,27 @@ DEBUG_COUNTER: ``` ; DEBUG_COUNTER table -key = DEBUG_COUNTER_TABLE:name -name = string -type = (SWITCH_INGRESS_DROPS|PORT_INGRESS_DROPS|SWITCH_EGRESS_DROPS|PORT_EGRESS_DROPS) -alias = string (optional) -description = string (optional) -group = string (optional) +key = DEBUG_COUNTER_TABLE:name +name = string +type = (SWITCH_INGRESS_DROPS|PORT_INGRESS_DROPS|SWITCH_EGRESS_DROPS|PORT_EGRESS_DROPS) +alias = string (optional) +description = string (optional) +group = string (optional) +drop_monitor_status = admin_mode (enabled/disabled, default disabled) +drop_count_threshold = uint64 (optional) +incident_count_threshold = uint64 (optional) +window = uint64 (optional) "DEBUG_COUNTER": { "DEBUG_4": { "alias": "BAD_DROPS", "desc": "More port ingress drops", "group": "BAD", - "type": "SWITCH_INGRESS_DROPS" + "type": "SWITCH_INGRESS_DROPS", + "drop_monitor_status": "disabled", + "drop_count_threshold": "10", + "incident_count_threshold": "2", + "window": "300" } } ``` @@ -1016,6 +1025,21 @@ reason = a valid drop reason without the 'SAI_IN/OUT_DROP_REASON_' prefix (http } ``` +### DEBUG_DROP_MONITOR +Ingress and eggress port debug counter flows can be monitored for persistent drops using +debug drop monitor feature. This table shows the status and configurations of the feature which can +be modified via the CLI. + +``` +{ + "DEBUG_DROP_MONITOR": { + "CONFIG": { + "status": "disabled", + } + } +} +``` + ### DEFAULT_LOSSLESS_BUFFER_PARAMETER This table stores the default lossless buffer parameters for dynamic buffer calculation. diff --git a/src/sonic-yang-models/tests/files/sample_config_db.json b/src/sonic-yang-models/tests/files/sample_config_db.json index d59a083c8be..ec60ce0bfd1 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -2225,6 +2225,12 @@ } }, + "DEBUG_DROP_MONITOR": { + "CONFIG": { + "status": "disabled" + } + }, + "QUEUE": { "Ethernet0|0": { "scheduler": "TEST@0", @@ -2936,7 +2942,11 @@ "alias": "BAD_DROPS", "desc": "More port ingress drops", "group": "BAD", - "type": "SWITCH_INGRESS_DROPS" + "type": "SWITCH_INGRESS_DROPS", + "drop_monitor_status": "disabled", + "drop_count_threshold": "10", + "incident_count_threshold": "2", + "window": "300" } }, "DEBUG_COUNTER_DROP_REASON": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests/debug_counter.json b/src/sonic-yang-models/tests/yang_model_tests/tests/debug_counter.json index 17332ecbc43..1361f7ee338 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests/debug_counter.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests/debug_counter.json @@ -20,5 +20,13 @@ "INVALID_DROP_REASON": { "desc": "Add an invalid drop reason to a counter", "eStrKey": "InvalidValue" + }, + + "VALID_DEBUG_DROP_MONITOR_STATUS": { + "desc": "Configure status to be enabled/disabled." + }, + "INVALID_DEBUG_DROP_MONITOR_STATUS": { + "desc": "Configure invalid value for status.", + "eStrKey": "InvalidValue" } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/debug_counter.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/debug_counter.json index 52d856a3c3f..fa3cbecf41a 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/debug_counter.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/debug_counter.json @@ -161,5 +161,23 @@ ] } } + }, + "VALID_DEBUG_DROP_MONITOR_STATUS": { + "sonic-debug-counter:sonic-debug-counter": { + "sonic-debug-counter:DEBUG_DROP_MONITOR": { + "CONFIG": { + "status": "enabled" + } + } + } + }, + "INVALID_DEBUG_DROP_MONITOR_STATUS": { + "sonic-debug-counter:sonic-debug-counter": { + "sonic-debug-counter:DEBUG_DROP_MONITOR": { + "CONFIG": { + "status": "invalid" + } + } + } } } diff --git a/src/sonic-yang-models/yang-models/sonic-debug-counter.yang b/src/sonic-yang-models/yang-models/sonic-debug-counter.yang index 368d689cee3..4660e28505f 100644 --- a/src/sonic-yang-models/yang-models/sonic-debug-counter.yang +++ b/src/sonic-yang-models/yang-models/sonic-debug-counter.yang @@ -45,6 +45,31 @@ module sonic-debug-counter { description "Group name to organize counters"; } + leaf drop_monitor_status { + type stypes:admin_mode; + default "disabled"; + description "Indicates whether the feature is enabled or disabled."; + } + + leaf window { + type uint64; + default 900; + units seconds; + description "The length of the time window in seconds"; + } + + leaf incident_count_threshold { + type uint64; + default 3; + description "The number of incidents that have to occur per window for it to be registered as a syslog"; + } + + leaf drop_count_threshold { + type uint64; + default 100; + description "The number of packet drops required for being classified as an incident"; + } + leaf type { type stypes:debug_counter_type; mandatory true; @@ -71,5 +96,17 @@ module sonic-debug-counter { } } } + + container DEBUG_DROP_MONITOR { + container CONFIG { + description "Stores configuration for debug drop monitor in CONFIG_DB"; + + leaf status { + type stypes:admin_mode; + default "disabled"; + description "Indicates whether the feature is enabled or disabled."; + } + } + } } }