Skip to content

Commit 873c721

Browse files
committed
Fixing rootguard timeout issue for mst
1 parent c4a339f commit 873c721

File tree

7 files changed

+18
-2043
lines changed

7 files changed

+18
-2043
lines changed

MSTP.md

-1,272
This file was deleted.

SONiC_PVST_HLD.md

-746
This file was deleted.

src/sonic-yang-mgmt/sonic_yang_ext.py

+1-1
Original file line numberDiff line numberDiff line change
@@ -19,7 +19,7 @@
1919
'EXP_TO_FC_MAP_LIST',
2020
'CABLE_LENGTH_LIST',
2121
'MPLS_TC_TO_TC_MAP_LIST',
22-
'TC_TO_DSCP_MAP_LIST'
22+
'TC_TO_DSCP_MAP_LIST',
2323
]
2424

2525
# Workaround for those fields who is defined as leaf-list in YANG model but have string value in config DB.

src/sonic-yang-models/tests/files/sample_config_db.json

+2
Original file line numberDiff line numberDiff line change
@@ -2365,6 +2365,7 @@
23652365

23662366
"STP": {
23672367
"GLOBAL": {
2368+
"global-stp-mode": "GLOBAL",
23682369
"mode": "pvst",
23692370
"rootguard_timeout": "30",
23702371
"forward_delay": "15",
@@ -2438,6 +2439,7 @@
24382439

24392440
"STP_MST": {
24402441
"GLOBAL": {
2442+
"global-stp-mode": "GLOBAL",
24412443
"name": "region1",
24422444
"revision": "0",
24432445
"max_hops": "20",

src/sonic-yang-models/tests/yang_model_tests/test_yang_model.py

+2-4
Original file line numberDiff line numberDiff line change
@@ -263,12 +263,10 @@ def test_run_tests(self):
263263
for test in self.tests:
264264
test = test.strip()
265265
if test in self.ExceptionTests:
266-
ret = ret + self.runExceptionTest(test);
266+
ret = ret + self.runExceptionTest(test)
267267
elif test in self.SpecialTests:
268-
ret = ret + self.runSpecialTest(test);
268+
ret = ret + self.runSpecialTest(test)
269269
else:
270-
#log.error("Unexpected Test: {}".format(test))
271-
#ret = ret + 1
272270
raise Exception("Unexpected Test")
273271
except Exception as e:
274272
ret = FAIL * len(self.tests)

src/sonic-yang-models/tests/yang_model_tests/tests_config/stp.json

+3-7
Original file line numberDiff line numberDiff line change
@@ -22,23 +22,19 @@
2222
"GLOBAL": [
2323
{
2424
"global-stp-mode": "GLOBAL",
25-
"mode": "mst",
26-
"forward_delay": 15,
27-
"hello_time": 2,
28-
"max_age": 20,
29-
"priority": 32768
25+
"mode": "mst"
3026
}
3127
]
3228
},
3329
"sonic-spanning-tree:STP_MST": {
34-
"MST_GLOBAL": [
30+
"GLOBAL": [
3531
{
3632
"global-stp-mode": "GLOBAL",
3733
"name": "region1",
3834
"revision": 0,
3935
"max_hops": 20,
40-
"hello_time": 2,
4136
"max_age": 20,
37+
"hello_time": 2,
4238
"forward_delay": 15
4339
}
4440
]

src/sonic-yang-models/yang-models/sonic-spanning-tree.yang

+10-13
Original file line numberDiff line numberDiff line change
@@ -151,10 +151,7 @@ module sonic-spanning-tree {
151151
}
152152
units "seconds";
153153
default 30;
154-
must "../mode != 'mst'" {
155-
error-message "Root guard timeout is not allowed in MST mode.";
156-
error-app-tag stp-invalid;
157-
}
154+
when "../mode = 'pvst'"; // Only apply the default when mode is pvst
158155
description
159156
"Time before re-enabling a port in root-guard mode.";
160157
}
@@ -320,7 +317,7 @@ module sonic-spanning-tree {
320317
description
321318
"MST specific configuration container, maps to STP_MST_TABLE";
322319

323-
list MST_GLOBAL {
320+
list GLOBAL {
324321
description
325322
"List of MST global configurations";
326323
max-elements 1;
@@ -375,30 +372,30 @@ module sonic-spanning-tree {
375372
"MST Max hops";
376373
}
377374

378-
leaf hello_time {
375+
leaf max_age {
379376
type uint8 {
380-
range "1..10";
377+
range "6..40";
381378
}
382-
default 2;
379+
default 20;
383380
must "../../../STP/GLOBAL[global-stp-mode='GLOBAL']/mode='mst'" {
384381
error-message "Configuration allowed in MST mode";
385382
error-app-tag stp-invalid;
386383
}
387384
description
388-
"MST hello time in seconds";
385+
"MST max age in seconds";
389386
}
390387

391-
leaf max_age {
388+
leaf hello_time {
392389
type uint8 {
393-
range "6..40";
390+
range "1..10";
394391
}
395-
default 20;
392+
default 2;
396393
must "../../../STP/GLOBAL[global-stp-mode='GLOBAL']/mode='mst'" {
397394
error-message "Configuration allowed in MST mode";
398395
error-app-tag stp-invalid;
399396
}
400397
description
401-
"MST max age in seconds";
398+
"MST hello time in seconds";
402399
}
403400

404401
leaf forward_delay {

0 commit comments

Comments
 (0)