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

Conversation

arista-hpandya
Copy link

@arista-hpandya arista-hpandya commented Feb 10, 2025

This PR adds the YANG model definition for the DEBUG_DROP_MONITOR table to the SONiC yang models repository. The new YANG model defines the schema for configuring and monitoring persistent drop counters in SONiC.

Changes:

  • Added YANG model definition sonic-debug-drop-monitor.yang to sonic-yang-models/yang/.
  • Added test cases in tests/ to cover the new YANG model, including validation of configuration data and schema.
  • Updated documentation in docs/ to describe the new DEBUG_DROP_MONITOR table and its attributes.

Why I did it

To provide a standardized and programmatic way to configure and monitor persistent drop counters in SONiC. This enhances the manageability and observability of network traffic.

Work item tracking - Microsoft ADO (number only):

Fixes #21675
HLD: sonic-net/SONiC#1912

How I did it

Created a new YANG model file, implemented test cases for validation, and updated the relevant documentation.

How to verify it

  • Verify the presence of the sonic-debug-drop-monitor.yang file in the sonic-yang-models/yang/ directory.
  • Run the test cases in tests/ and ensure they pass.
  • Check the updated documentation in docs/ for accuracy and completeness.
  • Deploy the changes to a SONiC device and verify the configuration and monitoring functionality using CLI commands.

Which release branch to backport (provide reason below if selected)

This is a feature related PR, no need to backport

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111
  • 202205
  • 202211
  • 202305

Tested branch (Please provide the tested image version)

  • 202405
  • 202411

Description for the changelog

Added YANG model definition for the DEBUG_DROP_MONITOR table, enabling standardized configuration and monitoring of persistent drop counters.

Link to config_db schema for YANG module changes

https://github.com/sonic-net/sonic-buildimage/pull/21694/files#diff-7202f7348dad4b5be36f441f7ff0a5d6468395cbf89a9b75aa87399cef07292d

A picture of a cute animal (not mandatory but encouraged)

image

- Add yang model definition
- Add testcases covering new yang model
- Update documentation to describe the new table
@mssonicbld
Copy link
Collaborator

/azp run Azure.sonic-buildimage

Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@arista-hpandya arista-hpandya changed the title [FEATURE] Add yang model for DEBUG_DROP_MONITOR table [arista][feature] Add yang model for DEBUG_DROP_MONITOR table Feb 10, 2025
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.


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?


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.


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.

@@ -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?

}

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

@arista-hpandya arista-hpandya marked this pull request as draft February 18, 2025 17:42
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[Feature] Add YANG Model for DEBUG_DROP_MONITOR
5 participants