skip pfcwd if disabled in golden_config#3880
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
config/main.py
Outdated
| # If pfcwd is disabled in the golden config, skip starting pfcwd | ||
| # This is needed for platform which doesn't support lossless traffic. | ||
| device_metadata = config_to_check.get('DEVICE_METADATA', {}) | ||
| default_pfcwd_status = device_metadata.get('localhost', {}).get('default_pfcwd_status') |
There was a problem hiding this comment.
if 'default_pfcwd_status' is None, next step will still start pfcwd
There was a problem hiding this comment.
If default_pfcwd_status is not defined in golden config, it falls back to current default behavior.
Current behavior is to run 'pfcwd start_default' directly without any check. so it will be called even if default_pfcwd_status is None. Although, it's unlikely to happen. This PR prefers to keep the behavior unchanged. We can change this behavior in the future if we see some issue or use cases.
With this PR, the only behavior change is when default_pfcwd_status in 'init_cfg.json' is enable or None, but golden config is disable. In this case, old behavior was to do pfcwd start_default, new behavior is to skip it.
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
/azpw run |
|
/AzurePipelines run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
Cherry-pick PR to msft-202412: Azure/sonic-utilities.msft#178 |
<!-- Please make sure you've read and understood our contributing guidelines; https://github.com/sonic-net/SONiC/blob/gh-pages/CONTRIBUTING.md Please provide following information to help code review process a bit easier: --> ### Description of PR <!-- - Please include a summary of the change and which issue is fixed. - Please also include relevant motivation and context. Where should reviewer start? background context? - List any dependencies that are required for this change. --> Summary: Update default_pfcwd_status to disable for some platform which only have lossy traffic. Note: This PR needs the image fix sonic-net/sonic-utilities#3880 for it to work. ### Type of change <!-- - Fill x for your type of change. - e.g. - [x] Bug fix --> - [ ] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] New Test case - [ ] Skipped for non-supported platforms - [ ] Test case improvement ### Back port request - [ ] 202012 - [ ] 202205 - [ ] 202305 - [ ] 202311 - [ ] 202405 - [x] 202412 ### Approach #### What is the motivation for this PR? Update the default pfcwd status in golden_config for lossy platform #### How did you do it? Update the default pfcwd status in golden_config for lossy platform #### How did you verify/test it? Verified on physical platform. #### Any platform specific information? #### Supported testbed topology if it's a new test case? ### Documentation <!-- (If it's a new feature, new test case) Did you update documentation/Wiki relevant to your implementation? Link to the wiki page? -->
## Skip pfcwd config if it's disabled in golden config In `sudo config load_minigraph --override_config -y`, it will call `pfcwd start_default` by default. ``` Running command: /usr/local/bin/sonic-cfggen -H -m -j /etc/sonic/init_cfg.json --write-to-db ...... Running command: pfcwd start_default Running command: config override-config-table /etc/sonic/golden_config_db.json ``` When golden_config_db.json has `"default_pfcwd_status": disable`, pfcwd should not be generated in the config. However, in current code, when `pfcwd start_default` is called, the `default_pfcwd_status` is still using the value in `init_cfg.json` which is `enable`. So, pfcwd configuration is still generated even though it's not needed. #### What I did Disable default_pfcwd_status for all lossy platform. #### How I did it Check `default_pfcwd_status` in `golden_config_db.json` and skip `pfcwd start_default` if it's disabled. #### How to verify it Run deploy-mg on all lossy platform #### Previous command output (if the output of a command-line utility has changed) #### New command output (if the output of a command-line utility has changed)
Skip pfcwd config if it's disabled in golden config
In
sudo config load_minigraph --override_config -y, it will callpfcwd start_defaultby default.When golden_config_db.json has
"default_pfcwd_status": disable, pfcwd should not be generated in the config.However, in current code, when
pfcwd start_defaultis called, thedefault_pfcwd_statusis still using the value ininit_cfg.jsonwhich isenable. So, pfcwd configuration is still generated even though it's not needed.What I did
Disable default_pfcwd_status for all lossy platform.
How I did it
Check
default_pfcwd_statusingolden_config_db.jsonand skippfcwd start_defaultif it's disabled.How to verify it
Run deploy-mg on all lossy platform
Previous command output (if the output of a command-line utility has changed)
New command output (if the output of a command-line utility has changed)