Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

[arista][feature] Add yang model for DEBUG_DROP_MONITOR table #21694

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from
Draft
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
18 changes: 18 additions & 0 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -26,6 +26,7 @@
* [CRM](#crm)
* [CRM DASH](#crm-dash)
* [Data Plane L3 Interfaces](#data-plane-l3-interfaces)
* [Debug Drop Monitor](#debug-drop-monitor)
* [DEFAULT_LOSSLESS_BUFFER_PARAMETER](#DEFAULT_LOSSLESS_BUFFER_PARAMETER)
* [Device Metadata](#device-metadata)
* [Device neighbor metada](#device-neighbor-metada)
Expand Down Expand Up @@ -968,6 +969,23 @@ and value is a list of field-values representing the interface attributes, e.g.
}
```

### 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",
"window": "800",
"incident_count_threshold": "3",
"drop_count_threshold": "3"
}
}
}
```

### DEFAULT_LOSSLESS_BUFFER_PARAMETER

Expand Down
2 changes: 2 additions & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -207,6 +207,7 @@ def run(self):
'./yang-models/sonic-bgp-sentinel.yang',
'./yang-models/sonic-asic-sensors.yang',
'./yang-models/sonic-bmp.yang',
'./yang-models/sonic-configurable-drop-monitor.yang',
'./yang-models/sonic-xcvrd-log.yang',
'./yang-models/sonic-grpcclient.yang',
'./yang-models/sonic-serial-console.yang',
Expand Down Expand Up @@ -290,6 +291,7 @@ def run(self):
'./cvlyang-models/sonic-system-port.yang',
'./cvlyang-models/sonic-macsec.yang',
'./cvlyang-models/sonic-bmp.yang',
'./cvlyang-models/sonic-configurable-drop-monitor.yang',
'./cvlyang-models/sonic-serial-console.yang',
'./cvlyang-models/sonic-bgp-sentinel.yang']),
],
Expand Down
9 changes: 9 additions & 0 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -2185,6 +2185,15 @@
}
},

"DEBUG_DROP_MONITOR": {
"CONFIG": {
"status": "disabled",
"window": "800",
"incident_count_threshold": "3",
"drop_count_threshold": "3"
}
},

"QUEUE": {
"Ethernet0|0": {
"scheduler": "TEST@0",
Expand Down
Original file line number Diff line number Diff line change
@@ -0,0 +1,9 @@
{
"DEBUG_DROP_MONITOR_POSITIVE_CONFIG": {
"desc": "Configure DEBUG_DROP_MONITOR positive config."
},
"DEBUG_DROP_MONITOR_INVALID_TYPE": {
"desc": "Configure invalid status in DEBUG_DROP_MONITOR.",
"eStr": "Invalid status for debug drop monitor."
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,26 @@
{
"DEBUG_DROP_MONITOR_POSITIVE_CONFIG": {
"sonic-configurable-drop-monitor:sonic-configurable-drop-monitor": {
"sonic-configurable-drop-monitor:DEBUG_DROP_MONITOR": {
"CONFIG": {
"status": "enabled",
"window": 600,
"incident_count_threshold": 2,
"drop_count_threshold": 2
}
}
}
},
"DEBUG_DROP_MONITOR_INVALID_TYPE": {
"sonic-configurable-drop-monitor:sonic-configurable-drop-monitor": {
"sonic-configurable-drop-monitor:DEBUG_DROP_MONITOR": {
"CONFIG": {
"status": "down",
"window": 600,
"incident_count_threshold": 2,
"drop_count_threshold": 2
}
}
}
}
}
Original file line number Diff line number Diff line change
@@ -0,0 +1,51 @@
module sonic-configurable-drop-monitor {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

What's the reason to choose sonic-configurable-drop-monitor instead of sonic-debug-drop-monitor?

yang-version 1.1;

namespace "http://github.com/sonic-net/sonic-configurable-drop-monitor";

prefix configurable-drop-monitor;

description "DEBUG_DROP_MONITOR YANG Module for SONiC OS";

revision 2025-01-10 {
description
"First revision";
}

container sonic-configurable-drop-monitor {
container DEBUG_DROP_MONITOR {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Hi @theasianpianist , please check if DEBUG_COUNTER and DEBUG_COUNTER_DROP_REASONhas dependency on this for github issue missing YANG: #21505

container CONFIG {
description "Stores configuration for debug drop monitor in CONFIG_DB";

leaf status {
type string {
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

string

Using a string type for a boolean-like status might not be ideal. Consider using a boolean type instead for clarity and validation.

Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

pattern "enabled|disabled" {
error-message "Invalid status for debug drop monitor.";
error-app-tag debug-drop-monitor-invalid-status;
}
}
description "Status of the feature";
}

leaf window {
type uint64;
default 900;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

900

How do we get this default value 900 seconds as 15 minutes?

units seconds;
description "The length of the time window in seconds";
}

leaf incident_count_threshold {
type uint64;
default 3;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

3

It might be useful to define an upper limit.

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;
Copy link
Contributor

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

100

same, better have a range to restraint unintentional value.

description "The number of packet drops required for being classified as an incident";
}
} /* end of container CONFIG */
} /* end of container DEBUG_DROP_MONITOR */
} /* end of container sonic-configurable-drop-monitor */
} /* end of module sonic-configurable-drop-monitor */
Loading