From 03348c44ac40542d652057d119146ba2dd12da97 Mon Sep 17 00:00:00 2001 From: Sudharsan Dhamal Gopalarathnam Date: Tue, 24 Jan 2023 22:56:13 -0800 Subject: [PATCH] [yang] Added Tunnel flex counter group (#13483) - Why I did it Fixes https://github.com/sonic-net/sonic-buildimage/issues/13457 Added Tunnel flex counter group - How I did it Added relevant container in sonic-flex_counter yang model - How to verify it Added UT to verify --- src/sonic-yang-models/doc/Configuration.md | 29 ++++++++++++------- .../tests/files/sample_config_db.json | 4 +++ .../tests_config/flex_counter.json | 8 +++++ .../yang-models/sonic-flex_counter.yang | 13 +++++++++ 4 files changed, 43 insertions(+), 11 deletions(-) diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 1c25f66a61c2..0cc8ac654558 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -913,17 +913,24 @@ instance is supported in SONiC. ``` { -"FLEX_COUNTER_TABLE": { - "PFCWD": { - "FLEX_COUNTER_STATUS": "enable" - }, - "PORT": { - "FLEX_COUNTER_STATUS": "enable" - }, - "QUEUE": { - "FLEX_COUNTER_STATUS": "enable" - } - } + "FLEX_COUNTER_TABLE": { + "PFCWD": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": "10000" + }, + "PORT": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": "1000" + }, + "QUEUE": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": "10000" + }, + "TUNNEL": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": "10000" + } + } } ``` 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 2d1f672542c7..897f31e57238 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1234,6 +1234,10 @@ "FLOW_CNT_ROUTE": { "FLEX_COUNTER_STATUS": "enable", "POLL_INTERVAL": "10000" + }, + "TUNNEL": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": "10000" } }, "FLOW_COUNTER_ROUTE_PATTERN": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/flex_counter.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/flex_counter.json index 169a38ff6d7c..87ac2c6987eb 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/flex_counter.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/flex_counter.json @@ -43,6 +43,10 @@ "FLEX_COUNTER_STATUS": "enable", "POLL_INTERVAL": 10000 }, + "TUNNEL": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": 10000 + }, "FLOW_CNT_TRAP": { "FLEX_COUNTER_STATUS": "enable", "POLL_INTERVAL": 10000 @@ -98,6 +102,10 @@ "FLEX_COUNTER_STATUS": "enable", "POLL_INTERVAL": 99 }, + "TUNNEL": { + "FLEX_COUNTER_STATUS": "enable", + "POLL_INTERVAL": 99 + }, "FLOW_CNT_TRAP": { "FLEX_COUNTER_STATUS": "enable", "POLL_INTERVAL": 99 diff --git a/src/sonic-yang-models/yang-models/sonic-flex_counter.yang b/src/sonic-yang-models/yang-models/sonic-flex_counter.yang index e94aa76ccf42..96745fc5e4a6 100644 --- a/src/sonic-yang-models/yang-models/sonic-flex_counter.yang +++ b/src/sonic-yang-models/yang-models/sonic-flex_counter.yang @@ -228,6 +228,19 @@ module sonic-flex_counter { } } + container TUNNEL { + /* TUNNEL_STAT_COUNTER_FLEX_COUNTER_GROUP */ + leaf FLEX_COUNTER_STATUS { + type flex_status; + } + leaf FLEX_COUNTER_DELAY_STATUS { + type flex_delay_status; + } + leaf POLL_INTERVAL { + type poll_interval; + } + } + } /* end of container FLEX_COUNTER_TABLE */