[code sync] Merge code from sonic-net/sonic-utilities:202511 to 202601#369
Merged
Conversation
mssonicbld
commented
Jun 16, 2026
Collaborator
#### What I did
if PFC is not enabled on a port, unable to configure PFC via CLI. it generates the error as shown in the ticket.
#### How I did it
SImilar to "show pfc prio", if there is no entry for "pfc_enable" under PORT_QOS_MAP for that part, just treat as empty and add the new PFC prio instead out erroring out.
#### How to verify it
```
Before the fix:
admin@humm223:~$ show pfc prio
Interface Lossless priorities
----------- ---------------------
Ethernet32 N/A
Ethernet36 3,4
Ethernet40 3,4
Ethernet44 3,4
Ethernet160 3,4
Ethernet164 3,4
admin@humm223:~$ sudo config interface pfc priority Ethernet32 3 on
Traceback (most recent call last):
File "/usr/local/bin/pfc", line 8, in <module>
sys.exit(cli())
~~~^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1161, in __call__
return self.main(*args, **kwargs)
~~~~~~~~~^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1082, in main
rv = self.invoke(ctx)
File "/usr/lib/python3/dist-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1697, in invoke
return _process_result(sub_ctx.command.invoke(sub_ctx))
~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 1443, in invoke
return ctx.invoke(self.callback, **ctx.params)
~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/lib/python3/dist-packages/click/core.py", line 788, in invoke
return __callback(*args, **kwargs)
File "/usr/local/lib/python3.13/dist-packages/pfc/main.py", line 177, in configPrio
Pfc(namespace).configPfcPrio(status, interface, priority)
~~~~~~~~~~~~~~~~~~~~~~~~~~~~^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/dist-packages/utilities_common/multi_asic.py", line 153, in wrapped_run_on_all_asics
func(self, *args, **kwargs)
~~~~^^^^^^^^^^^^^^^^^^^^^^^^
File "/usr/local/lib/python3.13/dist-packages/pfc/main.py", line 87, in configPfcPrio
enable_prio = entry.get('pfc_enable').split(',')
^^^^^^^^^^^^^^^^^^^^^^^^^^^^^
AttributeError: 'NoneType' object has no attribute 'split'
admin@humm223:~$
WITH THE FIX:
admin@humm223:~$ sudo config interface pfc priority Ethernet32 3 on
admin@humm223:~$ show pfc pri
Interface Lossless priorities
----------- ---------------------
Ethernet32 3
Ethernet36 3,4
Ethernet40 3,4
Ethernet44 3,4
Ethernet160 3,4
Ethernet164 3,4
admin@humm223:~$
```
Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
#### 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)
What I did I implemented a fix to stop timers upon reload/load_minigraph. If "config reload" or "config load_minigraph" is executed soon after system has started a timer may expire in the middle of the command causing subsequent failures. Here's what is observed: 2025 Aug 6 18:29:35.532425 sonic INFO python[36429]: ansible-command Invoked with _uses_shell=True _raw_params=config load_minigraph --override_config -y warn=True stdin_add_newline=True strip_empty_ends=True argv=None chdir=None execut able=None creates=None removes=None stdin=None 2025 Aug 6 18:29:35.754152 sonic NOTICE switch_trimming: 'load_minigraph' executing with command: config load_minigraph --override_config -y 2025 Aug 6 18:30:30.306602 sonic INFO systemd[1]: Stopped target sonic.target - SONiC services target.. 2025 Aug 6 18:30:31.333507 sonic DEBUG systemd[1]: tacacs-config.timer: Timer elapsed. 2025 Aug 6 18:30:31.334003 sonic DEBUG systemd[1]: sonic.target: Installed new job sonic.target/start as 2793 2025 Aug 6 18:30:32.371292 sonic DEBUG systemd[1]: sonic.target changed dead -> active How I did it Stop timers associated with sonic.target How to verify it I put a breakpoint after stopping sonic.target. Soon after reboot I execute "config reload" command. I then wait for ~5-6 min, no services start. Without this fix, services would start. Signed-off-by: Hemanth Kumar Tirupati <htirupati@nvidia.com> Co-authored-by: Stepan Blyshchak <38952541+stepanblyschak@users.noreply.github.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
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.