Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

SONiC QOS Scheduler, WRED, Queue Yangs #7281

Merged
merged 1 commit into from
Oct 18, 2021
Merged
Show file tree
Hide file tree
Changes from all commits
Commits
File filter

Filter by extension

Filter by extension


Conversations
Failed to load comments.
Loading
Jump to
Jump to file
Failed to load files.
Loading
Diff view
Diff view
3 changes: 3 additions & 0 deletions src/sonic-yang-models/setup.py
Original file line number Diff line number Diff line change
Expand Up @@ -76,6 +76,9 @@
'./yang-models/sonic-vrf.yang',
'./yang-models/sonic-warm-restart.yang',
'./yang-models/sonic-lldp.yang',
'./yang-models/sonic-scheduler.yang',
'./yang-models/sonic-wred-profile.yang',
'./yang-models/sonic-queue.yang',
'./yang-models/sonic_yang_tree']),
],
zip_safe=False,
Expand Down
51 changes: 50 additions & 1 deletion src/sonic-yang-models/tests/files/sample_config_db.json
Original file line number Diff line number Diff line change
Expand Up @@ -1138,6 +1138,56 @@
"high_mem_alert": "disabled",
"state": "enabled"
}
},

"SCHEDULER": {
"TEST@0": {
"cbs": "256",
"cir": "1250000",
"meter_type": "bytes",
"pbs": "1024",
"pir": "25000000",
"type": "DWRR",
"weight": "20"
},

"TEST@1": {
"cbs": "1024",
"cir": "1280000",
"meter_type": "bytes",
"pbs": "2048",
"pir": "2560000",
"type": "STRICT"
}
},

"WRED_PROFILE": {
"Wred1": {
"ecn": "ecn_all",
"green_drop_probability": "50",
"green_max_threshold": "2048000",
"green_min_threshold": "1024000",
"wred_green_enable": "true",
"yellow_drop_probability": "50",
"yellow_max_threshold": "2048000",
"yellow_min_threshold": "1024000",
"wred_yellow_enable": "true",
"red_drop_probability": "50",
"red_max_threshold": "2048000",
"red_min_threshold": "1024000",
"wred_red_enable": "true"
}
},

"QUEUE": {
"Ethernet0|0": {
"scheduler": "TEST@0",
"wred_profile": "Wred1"
},
"Ethernet0|1": {
"scheduler": "TEST@1",
"wred_profile": "Wred1"
}
}
},

Expand All @@ -1146,5 +1196,4 @@
"Error": "This Table is for testing, This Table does not have YANG models."
}
}

}
85 changes: 85 additions & 0 deletions src/sonic-yang-models/tests/yang_model_tests/tests/qos.json
Original file line number Diff line number Diff line change
@@ -0,0 +1,85 @@
{
"SCHEDULER_VALID": {
"desc": "Configure SCHEDULER table."
},

"SCHEDULER_UNDEFINED_TYPE": {
"desc": "Configure undefined type in SCHEDULER table.",
"eStrKey" : "InvalidValue",
"eStr": ["type"]
},

"SCHEDULER_INVALID_WEIGHT": {
"desc": "Configure outof range weight in SCHEDULER table.",
"eStrKey" : "Pattern"
},

"SCHEDULER_INVALID_METER_TYPE": {
"desc": "Configure unsuported meter type in SCHEDULER table.",
"eStrKey": "InvalidValue",
"eStr": ["meter_type"]
},

"SCHEDULER_CBS_NO_CIR": {
"desc": "Configure CBS without CIR.",
"eStr": ["cbs can't be configured without cir"]
},

"SCHEDULER_PIR_NO_CIR": {
"desc": "Configure PIR without CIR.",
"eStr": ["pir can't be configured without cir"]
},

"SCHEDULER_PIR_VS_CIR": {
"desc": "Configure PIR vs CIR.",
"eStr": ["pir must be greater than or equal to cir"]
},

"WRED_PROFILE_EMPTY": {
"desc": "Configure Empty WRED profile."
},

"WRED_PROFILE_VALID": {
"desc": "Configure WRED profile."
},

"WRED_PROFILE_INVALID_DROP_PROBABILITY": {
"desc": "Configure invalid drop probability in WRED profile.",
"eStrKey" : "Pattern"
},

"WRED_PROFILE_INVALID_GREEN_THRESHOLD": {
"desc": "Configure green maximum threshold less than min threshold in WRED profile.",
"eStr": ["Green max threshold must be greater than or equal to min threshold"]
},

"WRED_PROFILE_INVALID_YELLOW_THRESHOLD": {
"desc": "Configure yellow maximum threshold less than min threshold in WRED profile.",
"eStr": ["Yellow max threshold must be greater than or equal to min threshold"]
},

"WRED_PROFILE_INVALID_RED_THRESHOLD": {
"desc": "Configure red maximum threshold less than min threshold in WRED profile.",
"eStr": ["Red max threshold must be greater than or equal to min threshold"]
},


"QUEUE_VALID": {
"desc": "Attach scheduler and wred profiles to QUEUE."
},

"QUEUE_PORT_NOT_EXIST": {
"desc": "Referring non-existing PORT table.",
"eStrKey": "InvalidValue"
},

"QUEUE_SCHEDULER_NOT_EXIST": {
"desc": "Referring non-existing SCHEDULER table.",
"eStrKey" : "LeafRef"
},

"QUEUE_WRED_NOT_EXIST": {
"desc": "Referring non-existing WRED table.",
"eStrKey" : "LeafRef"
}
}
Loading