-
Notifications
You must be signed in to change notification settings - Fork 1.4k
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
Conversation
Hi @neethajohn - could you please take a look, thanks. |
78d3f58
to
2e8e561
Compare
|
||
leaf scheduler { | ||
type leafref { | ||
path "/sch:sonic-scheduler/sch:SCHEDULER/sch:SCHEDULER_LIST/sch:name"; //Reference to SCHEDULER table |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@AshokDaparthi how do you expect to handle key reference notation from swss-schema.md?
It seems that current YANG model won't be able to handle existing config_db.json
:
Example:
"QUEUE": {
"Ethernet4|0": {
"scheduler": "[SCHEDULER|scheduler.0]"
},
"Ethernet4|1": {
"scheduler": "[SCHEDULER|scheduler.0]"
},
"Ethernet4|2": {
"scheduler": "[SCHEDULER|scheduler.0]"
},
"Ethernet4|3": {
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]",
"scheduler": "[SCHEDULER|scheduler.1]"
}
}
"SCHEDULER": {
"scheduler.0": {
"type": "DWRR",
"weight": "14"
},
"scheduler.1": {
"type": "DWRR",
"weight": "15"
}
}
"WRED_PROFILE": {
"AZURE_LOSSLESS": {
"red_max_threshold": "2097152",
"wred_green_enable": "true",
"ecn": "ecn_all",
"green_min_threshold": "1048576",
"red_min_threshold": "1048576",
"wred_yellow_enable": "true",
"yellow_min_threshold": "1048576",
"green_max_threshold": "2097152",
"green_drop_probability": "5",
"yellow_max_threshold": "2097152",
"wred_red_enable": "true",
"yellow_drop_probability": "5",
"red_drop_probability": "5"
}
}
root@sonic:/home/admin# redis-cli -n 4 HGETALL 'QUEUE|Ethernet4|3'
1) "scheduler"
2) "[SCHEDULER|scheduler.1]"
3) "wred_profile"
4) "[WRED_PROFILE|AZURE_LOSSLESS]"
Which means that for scheduler/wred we expect to match:
- scheduler -> scheduler.0
- wred -> AZURE_LOSSLESS
and not:
- scheduler -> SCHEDULER|scheduler.0
- wred -> WRED_PROFILE|AZURE_LOSSLESS
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@praveen-li can you please elaborate what should be the appropriate YANG model for SONiC ABNF key reference?
How do we expect to handle this one?
"BUFFER_PORT_EGRESS_PROFILE_LIST": {
"Ethernet8": {
"profile_list": "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]"
},
root@sonic:/home/admin# redis-cli -n 4 HGETALL 'BUFFER_PORT_EGRESS_PROFILE_LIST|Ethernet8'
1) "profile_list"
2) "[BUFFER_PROFILE|egress_lossless_profile],[BUFFER_PROFILE|egress_lossy_profile]"
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nazariig, @praveen-li - We can discuss this over review call, i am not sure pyang will take care leafref validation even if we give ABNF format. Else we should convert to leafref to pattern. But we will miss in this case leafref check's in YANG. As of now i am not sure is there anyway to resent in YANG.
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
@nazariig - Back end changes to remove table ABNF format (example "[BUFFER_PROFILE|" )from field value is merged in latest master.
@@ -114,4 +114,15 @@ module sonic-types { | |||
pattern "percentage|used|free|PERCENTAGE|USED|FREE"; | |||
} | |||
} | |||
|
|||
container operation { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
this is being discussed in another pr
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed operation
leaf yellow_max_threshold { | ||
type uint64; | ||
units bytes; | ||
must "(/stypes:operation/stypes:operation = 'DELETE') or (current() >= current()/../yellow_min_threshold)" { |
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
is the operation check needed?
There was a problem hiding this comment.
Choose a reason for hiding this comment
The reason will be displayed to describe this comment to others. Learn more.
removed operation based checks
16c5886
to
b41fb20
Compare
Qos tables in config db and app db used ABNF format i.e "[TABLE_NAME|name] to refer fieldvalue other qos tables. Example: Config DB: "Ethernet92|3": { "scheduler": "[SCHEDULER|scheduler.1]", "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" }, "Ethernet0|0": { "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" }, "Ethernet0": { "dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE]", "pfc_enable": "3,4", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", "tc_to_pg_map": "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "tc_to_queue_map": "[TC_TO_QUEUE_MAP|AZURE]" }, AppDB: "BUFFER_QUEUE_TABLE:Ethernet88:3-4": { "profile": "[BUFFER_PROFILE_TABLE:egress_lossless_profile]" }, 1#This format is not consistent with other DB schema followed in sonic. 2# Added db_migrator.py case to change from old format in config_db and appl_db to new format. 3#Modified the test case Dependent pull requests: sonic-net/sonic-buildimage#7752 - To modify platfrom files sonic-net/sonic-buildimage#7281 - Yang model sonic-net/sonic-swss#1754 - swss change to remove ABNF format
Depends on sonic-net/sonic-utilities#1626 |
Dependency sonic-net/sonic-utilities#1626 is merged |
@AshokDaparthi Can you update the PR with suggestions. I see couple of open items, do they still need to get resolved? Are you waiting for inputs from the community? |
@smaheshm - Main issues blocking this PR is comments in sonic-queue.yang, Which needs DB format change. Below are PR raised sonic-net/sonic-utilities#1626 |
b41fb20
to
dca5b23
Compare
Depends on sonic-net/sonic-utilities#1626 Depends on sonic-net/sonic-swss#1754 QOS tables in config db used ABNF format i.e "[TABLE_NAME|name] to refer fieldvalue to other qos tables. Example: Config DB: "Ethernet92|3": { "scheduler": "[SCHEDULER|scheduler.1]", "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" }, "Ethernet0|0": { "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" }, "Ethernet0": { "dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE]", "pfc_enable": "3,4", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", "tc_to_pg_map": "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "tc_to_queue_map": "[TC_TO_QUEUE_MAP|AZURE]" }, This format is not consistent with other DB schema followed in sonic. And also this reference in DB is not required, This is taken care by YANG "leafref". Removed this format from all platform files to consistent with other sonic db schema. Example: "Ethernet92|3": { "scheduler": "scheduler.1", "wred_profile": "AZURE_LOSSLESS" }, Dependent pull requests: #7752 - To modify platfrom files #7281 - Yang model sonic-net/sonic-utilities#1626 - DB migration sonic-net/sonic-swss#1754 - swss change to remove ABNF format
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@smaheshm - Could you please help to see why it failing, i ran sonic-yang-models, and sonic-yang-mgmt python wheels. it success for me. |
looks like some process crashed, seen in other tests as well. I don't know if anyone's working on it. For I'd suggest update your branch and re-trigger the pipeline. |
Build failure need some help from people who can check the logs, looks like impacted by warmreboot test. Rajesh will re-push today |
6b07b16
to
ef1ff94
Compare
/azp run |
Azure Pipelines successfully started running 1 pipeline(s). |
@smaheshm - How man times i restart i see same error kvmtest fails. Could you please help to see why it fails. |
ef1ff94
to
a9f69e4
Compare
…onic-net#7281)"" This reverts commit f0b2122.
…ernal branch Related work items: sonic-net#525, sonic-net#534, sonic-net#909, sonic-net#927, sonic-net#930, sonic-net#934, sonic-net#935, sonic-net#937, sonic-net#938, sonic-net#939, sonic-net#940, sonic-net#943, sonic-net#944, sonic-net#945, sonic-net#946, sonic-net#948, sonic-net#1702, sonic-net#1923, sonic-net#1936, sonic-net#1942, sonic-net#2315, sonic-net#7281, sonic-net#7375, sonic-net#8659, sonic-net#8799, sonic-net#8868, sonic-net#8875, sonic-net#8935, sonic-net#8942, sonic-net#8956, sonic-net#8961, sonic-net#8966, sonic-net#8969, sonic-net#8971, sonic-net#8978, sonic-net#8991, sonic-net#8996, sonic-net#9001, sonic-net#9008, #3146150
Qos tables in config db and app db used ABNF format i.e "[TABLE_NAME|name] to refer fieldvalue other qos tables. Example: Config DB: "Ethernet92|3": { "scheduler": "[SCHEDULER|scheduler.1]", "wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]" }, "Ethernet0|0": { "profile": "[BUFFER_PROFILE|ingress_lossy_profile]" }, "Ethernet0": { "dscp_to_tc_map": "[DSCP_TO_TC_MAP|AZURE]", "pfc_enable": "3,4", "pfc_to_queue_map": "[MAP_PFC_PRIORITY_TO_QUEUE|AZURE]", "tc_to_pg_map": "[TC_TO_PRIORITY_GROUP_MAP|AZURE]", "tc_to_queue_map": "[TC_TO_QUEUE_MAP|AZURE]" }, AppDB: "BUFFER_QUEUE_TABLE:Ethernet88:3-4": { "profile": "[BUFFER_PROFILE_TABLE:egress_lossless_profile]" }, 1#This format is not consistent with other DB schema followed in sonic. 2# Added db_migrator.py case to change from old format in config_db and appl_db to new format. 3#Modified the test case Dependent pull requests: sonic-net/sonic-buildimage#7752 - To modify platfrom files sonic-net/sonic-buildimage#7281 - Yang model sonic-net/sonic-swss#1754 - swss change to remove ABNF format
Why I did it
Created SONiC Yang model for QOS
Tables: SCHEDULER, WRED_PROFILE, QUEUE table.
How I did it
Defined Yang models for QOS based on Guideline doc:
https://github.com/Azure/SONiC/blob/master/doc/mgmt/SONiC_YANG_Model_Guidelines.md
and
https://github.com/Azure/sonic-utilities/blob/master/doc/Command-Reference.md
How to verify it
sonic_yang_models package build
Dependent pull requests:
#7752 - To modify platfrom files
sonic-net/sonic-utilities#1626 - DB migration
sonic-net/sonic-swss#1754 - swss change to remove ABNF format