diff --git a/src/sonic-config-engine/tests/test_cfggen_from_yang.py b/src/sonic-config-engine/tests/test_cfggen_from_yang.py index 48b970df8204..7caf1425e1ad 100644 --- a/src/sonic-config-engine/tests/test_cfggen_from_yang.py +++ b/src/sonic-config-engine/tests/test_cfggen_from_yang.py @@ -272,7 +272,9 @@ def test_fabric_monitor_data_table(self): "monErrThreshCrcCells": "1", "monErrThreshRxCells": "61035156", "monPollThreshIsolation": "1", - "monPollThreshRecovery": "8" + "monPollThreshRecovery": "8", + "monCapacityThreshWarn": "10", + "monState": "enable" } }) @@ -283,6 +285,7 @@ def test_fabric_port_table(self): "Fabric0": { "alias": "Fabric0", "isolateStatus": "False", - "lanes": "0" + "lanes": "0", + "forceUnisolateStatus": "0" } }) diff --git a/src/sonic-config-engine/tests/test_yang_data.json b/src/sonic-config-engine/tests/test_yang_data.json index 8126e7bc264a..b5cd43c717f5 100644 --- a/src/sonic-config-engine/tests/test_yang_data.json +++ b/src/sonic-config-engine/tests/test_yang_data.json @@ -378,7 +378,9 @@ "monErrThreshCrcCells": "1", "monErrThreshRxCells": "61035156", "monPollThreshIsolation": "1", - "monPollThreshRecovery": "8" + "monPollThreshRecovery": "8", + "monCapacityThreshWarn": "10", + "monState": "enable" } } }, @@ -389,7 +391,8 @@ "name": "Fabric0", "alias": "Fabric0", "isolateStatus": "False", - "lanes": "0" + "lanes": "0", + "forceUnisolateStatus": "0" } ] } diff --git a/src/sonic-yang-models/doc/Configuration.md b/src/sonic-yang-models/doc/Configuration.md index 855efd64c1ba..7ded546af7ca 100644 --- a/src/sonic-yang-models/doc/Configuration.md +++ b/src/sonic-yang-models/doc/Configuration.md @@ -1174,7 +1174,9 @@ The FG_NHG_PREFIX table provides the FG_NHG_PREFIX for which FG behavior is desi "monErrThreshCrcCells": "1", "monErrThreshRxCells": "61035156", "monPollThreshIsolation": "1", - "monPollThreshRecovery": "8" + "monPollThreshRecovery": "8", + "monCapacityThreshWarn": "10", + "monState": "enable" } } } @@ -1188,12 +1190,14 @@ The FG_NHG_PREFIX table provides the FG_NHG_PREFIX for which FG behavior is desi "Fabric0": { "alias": "Fabric0", "isolateStatus": "False", - "lanes": "0" + "lanes": "0", + "forceUnisolateStatus": "0" }, "Fabric1": { "alias": "Fabric1", "isolateStatus": "False", - "lanes": "1" + "lanes": "1", + "forceUnisolateStatus": "0" } } } 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 cb46047db08f..03ece49efc5d 100644 --- a/src/sonic-yang-models/tests/files/sample_config_db.json +++ b/src/sonic-yang-models/tests/files/sample_config_db.json @@ -1378,19 +1378,23 @@ "monErrThreshCrcCells": "1", "monErrThreshRxCells": "61035156", "monPollThreshIsolation": "1", - "monPollThreshRecovery": "8" + "monPollThreshRecovery": "8", + "monCapacityThreshWarn": "10", + "monState": "enable" } }, "FABRIC_PORT": { "Fabric0": { "alias": "Fabric0", "isolateStatus": "False", - "lanes": "0" + "lanes": "0", + "forceUnisolateStatus": "0" }, "Fabric1": { "alias": "Fabric1", "isolateStatus": "False", - "lanes": "1" + "lanes": "1", + "forceUnisolateStatus": "0" } }, "FLEX_COUNTER_TABLE": { diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_monitor_data.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_monitor_data.json index ad71aabd9c4c..a7452bf326e4 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_monitor_data.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_monitor_data.json @@ -6,7 +6,9 @@ "monErrThreshCrcCells": "1", "monErrThreshRxCells": "61035156", "monPollThreshIsolation": "1", - "monPollThreshRecovery": "8" + "monPollThreshRecovery": "8", + "monCapacityThreshWarn": "10", + "monState": "enable" } } } diff --git a/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_port.json b/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_port.json index 278834826120..401607c92894 100644 --- a/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_port.json +++ b/src/sonic-yang-models/tests/yang_model_tests/tests_config/fabric_port.json @@ -7,7 +7,8 @@ "name": "Fabric0", "alias": "Fabric0", "isolateStatus": "False", - "lanes": "0" + "lanes": "0", + "forceUnisolateStatus": "0" } ] } diff --git a/src/sonic-yang-models/yang-models/sonic-fabric-monitor.yang b/src/sonic-yang-models/yang-models/sonic-fabric-monitor.yang index 0c0464ab965d..e9730496738b 100644 --- a/src/sonic-yang-models/yang-models/sonic-fabric-monitor.yang +++ b/src/sonic-yang-models/yang-models/sonic-fabric-monitor.yang @@ -5,6 +5,10 @@ module sonic-fabric-monitor{ namespace "http://github.com/sonic-net/sonic-fabric-monitor"; prefix fabric-monitor; + import sonic-types { + prefix stypes; + } + description "FABRIC_MONITOR yang Module for SONiC OS"; revision 2023-03-14 { @@ -32,17 +36,35 @@ module sonic-fabric-monitor{ } leaf monPollThreshIsolation { - type uint32; + type uint8 { + range 1..10; + } default 1; description "Consecutive polls with higher error rate for isolation."; } leaf monPollThreshRecovery { - type uint32; + type uint8 { + range 1..10; + } default 8; description "Consecutive polls with lesser error rate for inclusion."; } + leaf monCapacityThreshWarn { + type uint8 { + range 5..100; + } + default 10; + description "Percentage of up fabric links."; + } + + leaf monState { + description "Configuration to set fabric link monitoring state: enable/disable"; + type stypes:mode-status; + default disable; + } + } /* end of container FABRIC_MONITOR_DATA */ } /* end of container FABRIC_MONITOR */ diff --git a/src/sonic-yang-models/yang-models/sonic-fabric-port.yang b/src/sonic-yang-models/yang-models/sonic-fabric-port.yang index f2266507deef..92b384ab7a98 100644 --- a/src/sonic-yang-models/yang-models/sonic-fabric-port.yang +++ b/src/sonic-yang-models/yang-models/sonic-fabric-port.yang @@ -52,6 +52,12 @@ module sonic-fabric-port{ } } + leaf forceUnisolateStatus { + description "Force unisolate status of a fabric port"; + type uint32; + default 0; + } + } /* end of list FABRIC_PORT_LIST */ } /* end of container FABRIC_PORT */