[clear_qos] Fix the order of QOS_TABLE_NAMES to unbind QUEUE config using 'config qos clear' #694
Add this suggestion to a batch that can be applied as a single commit.
This suggestion is invalid because no changes were made to the code.
Suggestions cannot be applied while the pull request is closed.
Suggestions cannot be applied while viewing a subset of changes.
Only one suggestion per line can be applied in a batch.
Add this suggestion to a batch that can be applied as a single commit.
Applying suggestions on deleted lines is not supported.
You must change the existing code in this line in order to create a valid suggestion.
Outdated suggestions cannot be applied.
This suggestion has been applied or marked resolved.
Suggestions cannot be applied from pending reviews.
Suggestions cannot be applied on multi-line comments.
Suggestions cannot be applied while the pull request is queued to merge.
Suggestion cannot be applied right now. Please check back later.
- What I did
(a)Unbind SCHEDULER config from QUEUE before removing SCHEDULER profile
(b)Unbind WRED config from QUEUE before removing WRED profile
- Why I did it
SCHEDULER, WRED and QUEUE configurations are not cleanedup by using the command "config qos clear".
- How I did it
Changed the order of QOS_TABLE_NAMES to be unconfigured with 'config qos clear' so that
SCHEDULER and WRED configurations are unbound from QUEUE, and then SCHEDULER and WRED profiles are removed.
- How to verify it
Test 1 Setup:
TgenPort1---Ethernet120--+DUT1+-- Ethernet0
TgenPort2---Ethernet121--+DUT1+
Test 1 Steps:
1a. Send line rate traffic from Ethernet120(Queue4) and Ethernet121(Queue3) towards Ethernet0 and Congestion occurs at the port Ethernet0 and packets dropped as per the default scheduler and queue config.
1b. Apply SCHEDULER config as below:
root@sonic:/home/admin# cat sched.json
{
"SCHEDULER": {
"scheduler.2": {
"type": "DWRR",
"weight": "20"
},
"scheduler.1": {
"type": "DWRR",
"weight": "50"
}
},
"QUEUE": {
"Ethernet0|3": {
"scheduler": "[SCHEDULER|scheduler.2]"
},
"Ethernet0|4": {
"scheduler": "[SCHEDULER|scheduler.1]"
}
}
}
root@sonic:/home/admin# config load sched.json
Load config from the file sched.json? [y/N]: y
Running command: /usr/local/bin/sonic-cfggen -j sched.json --write-to-db
1c. Verify that packets dropped as per the SCHEDULER and QUEUE config of sched.json
1d. Execute the command "config qos clear" to cleanup the config. Ensure that "show runningconfiguration all" doesn't show up any scheduler and queue config.
1e. Verify that packets are dropped as per the default config (as in Step 1a)
Test 2 Setup:
TgenPort1 -------------- Ethernet120 [DUT] Ethernet121 ------------ TgenPort2
Test 2 Steps:
2a. Send line rate traffic from Ethernet120(Queue3) towards Ethernet121. Check there are no WRED drops with default config.
2b. Apply the WRED config as below:
root@sonic:/home/admin# cat wred.json
{
"WRED_PROFILE": {
"AZURE_LOSSLESS" : {
"wred_green_enable" : "true",
"wred_yellow_enable" : "true",
"wred_red_enable" : "true",
"ecn" : "ecn_all",
"green_max_threshold" : "1000",
"green_min_threshold" : "100",
"yellow_max_threshold" : "2097152",
"yellow_min_threshold" : "1048576",
"red_max_threshold" : "2097152",
"red_min_threshold" : "1048576",
"green_drop_probability" : "100",
"yellow_drop_probability": "5",
"red_drop_probability" : "5"
}
},
"QUEUE": {
"Ethernet121|3": {
"wred_profile": "[WRED_PROFILE|AZURE_LOSSLESS]"
}
}
}
root@sonic:/home/admin# config load wred.json
Load config from the file wred.json? [y/N]: y
Running command: /usr/local/bin/sonic-cfggen -j wred.json --write-to-db
2c. Packet drops will be there due to WRED. Verify using 'show queue counters Ethernet121'
2d. Stop the traffic and execute "config qos clear"
2e. Ensure WRED_PROFILE configs are removed from "show runnningconfiguration all"
2f. Repeat the same traffic started in step 2b
2g. Check there are no WRED drops with default config.
-->