Skip to content

Commit

Permalink
YANG model for enabling fabric monitor attribute (#19767)
Browse files Browse the repository at this point in the history
### Why I did it
The new added attributes related fabric link monitoring are missing YANG model. Adding them in this change. 

For fabric monitor table: 
> monCapacityThreshWarn
> monState

For fabric port:
> forceUnisolateStatus
  • Loading branch information
jfeng-arista authored and mssonicbld committed Sep 20, 2024
1 parent 35c51eb commit 1f070d2
Show file tree
Hide file tree
Showing 8 changed files with 59 additions and 14 deletions.
7 changes: 5 additions & 2 deletions src/sonic-config-engine/tests/test_cfggen_from_yang.py
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
})

Expand All @@ -283,6 +285,7 @@ def test_fabric_port_table(self):
"Fabric0": {
"alias": "Fabric0",
"isolateStatus": "False",
"lanes": "0"
"lanes": "0",
"forceUnisolateStatus": "0"
}
})
7 changes: 5 additions & 2 deletions src/sonic-config-engine/tests/test_yang_data.json
Original file line number Diff line number Diff line change
Expand Up @@ -378,7 +378,9 @@
"monErrThreshCrcCells": "1",
"monErrThreshRxCells": "61035156",
"monPollThreshIsolation": "1",
"monPollThreshRecovery": "8"
"monPollThreshRecovery": "8",
"monCapacityThreshWarn": "10",
"monState": "enable"
}
}
},
Expand All @@ -389,7 +391,8 @@
"name": "Fabric0",
"alias": "Fabric0",
"isolateStatus": "False",
"lanes": "0"
"lanes": "0",
"forceUnisolateStatus": "0"
}
]
}
Expand Down
10 changes: 7 additions & 3 deletions src/sonic-yang-models/doc/Configuration.md
Original file line number Diff line number Diff line change
Expand Up @@ -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"
}
}
}
Expand All @@ -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"
}
}
}
Expand Down
10 changes: 7 additions & 3 deletions src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -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": {
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -6,7 +6,9 @@
"monErrThreshCrcCells": "1",
"monErrThreshRxCells": "61035156",
"monPollThreshIsolation": "1",
"monPollThreshRecovery": "8"
"monPollThreshRecovery": "8",
"monCapacityThreshWarn": "10",
"monState": "enable"
}
}
}
Expand Down
Original file line number Diff line number Diff line change
Expand Up @@ -7,7 +7,8 @@
"name": "Fabric0",
"alias": "Fabric0",
"isolateStatus": "False",
"lanes": "0"
"lanes": "0",
"forceUnisolateStatus": "0"
}
]
}
Expand Down
26 changes: 24 additions & 2 deletions src/sonic-yang-models/yang-models/sonic-fabric-monitor.yang
Original file line number Diff line number Diff line change
Expand Up @@ -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 {
Expand Down Expand Up @@ -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 */
Expand Down
6 changes: 6 additions & 0 deletions src/sonic-yang-models/yang-models/sonic-fabric-port.yang
Original file line number Diff line number Diff line change
Expand Up @@ -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 */
Expand Down

0 comments on commit 1f070d2

Please sign in to comment.