Skip to content

Commit a9f69e4

Browse files
committed
SONiC QOS Scheduler, WRED, Queue Yangs
1 parent c374705 commit a9f69e4

File tree

7 files changed

+1028
-1
lines changed

7 files changed

+1028
-1
lines changed

src/sonic-yang-models/setup.py

+3
Original file line numberDiff line numberDiff line change
@@ -76,6 +76,9 @@
7676
'./yang-models/sonic-vrf.yang',
7777
'./yang-models/sonic-warm-restart.yang',
7878
'./yang-models/sonic-lldp.yang',
79+
'./yang-models/sonic-scheduler.yang',
80+
'./yang-models/sonic-wred-profile.yang',
81+
'./yang-models/sonic-queue.yang',
7982
'./yang-models/sonic_yang_tree']),
8083
],
8184
zip_safe=False,

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

+50-1
Original file line numberDiff line numberDiff line change
@@ -1138,6 +1138,56 @@
11381138
"high_mem_alert": "disabled",
11391139
"state": "enabled"
11401140
}
1141+
},
1142+
1143+
"SCHEDULER": {
1144+
"TEST@0": {
1145+
"cbs": "256",
1146+
"cir": "1250000",
1147+
"meter_type": "bytes",
1148+
"pbs": "1024",
1149+
"pir": "25000000",
1150+
"type": "DWRR",
1151+
"weight": "20"
1152+
},
1153+
1154+
"TEST@1": {
1155+
"cbs": "1024",
1156+
"cir": "1280000",
1157+
"meter_type": "bytes",
1158+
"pbs": "2048",
1159+
"pir": "2560000",
1160+
"type": "STRICT"
1161+
}
1162+
},
1163+
1164+
"WRED_PROFILE": {
1165+
"Wred1": {
1166+
"ecn": "ecn_all",
1167+
"green_drop_probability": "50",
1168+
"green_max_threshold": "2048000",
1169+
"green_min_threshold": "1024000",
1170+
"wred_green_enable": "true",
1171+
"yellow_drop_probability": "50",
1172+
"yellow_max_threshold": "2048000",
1173+
"yellow_min_threshold": "1024000",
1174+
"wred_yellow_enable": "true",
1175+
"red_drop_probability": "50",
1176+
"red_max_threshold": "2048000",
1177+
"red_min_threshold": "1024000",
1178+
"wred_red_enable": "true"
1179+
}
1180+
},
1181+
1182+
"QUEUE": {
1183+
"Ethernet0|0": {
1184+
"scheduler": "TEST@0",
1185+
"wred_profile": "Wred1"
1186+
},
1187+
"Ethernet0|1": {
1188+
"scheduler": "TEST@1",
1189+
"wred_profile": "Wred1"
1190+
}
11411191
}
11421192
},
11431193

@@ -1146,5 +1196,4 @@
11461196
"Error": "This Table is for testing, This Table does not have YANG models."
11471197
}
11481198
}
1149-
11501199
}
Original file line numberDiff line numberDiff line change
@@ -0,0 +1,85 @@
1+
{
2+
"SCHEDULER_VALID": {
3+
"desc": "Configure SCHEDULER table."
4+
},
5+
6+
"SCHEDULER_UNDEFINED_TYPE": {
7+
"desc": "Configure undefined type in SCHEDULER table.",
8+
"eStrKey" : "InvalidValue",
9+
"eStr": ["type"]
10+
},
11+
12+
"SCHEDULER_INVALID_WEIGHT": {
13+
"desc": "Configure outof range weight in SCHEDULER table.",
14+
"eStrKey" : "Pattern"
15+
},
16+
17+
"SCHEDULER_INVALID_METER_TYPE": {
18+
"desc": "Configure unsuported meter type in SCHEDULER table.",
19+
"eStrKey": "InvalidValue",
20+
"eStr": ["meter_type"]
21+
},
22+
23+
"SCHEDULER_CBS_NO_CIR": {
24+
"desc": "Configure CBS without CIR.",
25+
"eStr": ["cbs can't be configured without cir"]
26+
},
27+
28+
"SCHEDULER_PIR_NO_CIR": {
29+
"desc": "Configure PIR without CIR.",
30+
"eStr": ["pir can't be configured without cir"]
31+
},
32+
33+
"SCHEDULER_PIR_VS_CIR": {
34+
"desc": "Configure PIR vs CIR.",
35+
"eStr": ["pir must be greater than or equal to cir"]
36+
},
37+
38+
"WRED_PROFILE_EMPTY": {
39+
"desc": "Configure Empty WRED profile."
40+
},
41+
42+
"WRED_PROFILE_VALID": {
43+
"desc": "Configure WRED profile."
44+
},
45+
46+
"WRED_PROFILE_INVALID_DROP_PROBABILITY": {
47+
"desc": "Configure invalid drop probability in WRED profile.",
48+
"eStrKey" : "Pattern"
49+
},
50+
51+
"WRED_PROFILE_INVALID_GREEN_THRESHOLD": {
52+
"desc": "Configure green maximum threshold less than min threshold in WRED profile.",
53+
"eStr": ["Green max threshold must be greater than or equal to min threshold"]
54+
},
55+
56+
"WRED_PROFILE_INVALID_YELLOW_THRESHOLD": {
57+
"desc": "Configure yellow maximum threshold less than min threshold in WRED profile.",
58+
"eStr": ["Yellow max threshold must be greater than or equal to min threshold"]
59+
},
60+
61+
"WRED_PROFILE_INVALID_RED_THRESHOLD": {
62+
"desc": "Configure red maximum threshold less than min threshold in WRED profile.",
63+
"eStr": ["Red max threshold must be greater than or equal to min threshold"]
64+
},
65+
66+
67+
"QUEUE_VALID": {
68+
"desc": "Attach scheduler and wred profiles to QUEUE."
69+
},
70+
71+
"QUEUE_PORT_NOT_EXIST": {
72+
"desc": "Referring non-existing PORT table.",
73+
"eStrKey": "InvalidValue"
74+
},
75+
76+
"QUEUE_SCHEDULER_NOT_EXIST": {
77+
"desc": "Referring non-existing SCHEDULER table.",
78+
"eStrKey" : "LeafRef"
79+
},
80+
81+
"QUEUE_WRED_NOT_EXIST": {
82+
"desc": "Referring non-existing WRED table.",
83+
"eStrKey" : "LeafRef"
84+
}
85+
}

0 commit comments

Comments
 (0)