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

Enable PFCWD only on ports where PFC is enabled #1508

Merged

Conversation

ayurkiv-nvda
Copy link
Contributor

@ayurkiv-nvda ayurkiv-nvda commented Mar 16, 2021

What I did

Prevent errors in the log when PFCWD starts on ports that PFC was not previously enabled.

Example of such errors in the log:

Nov 13 17:27:22.878468 arc-switch1038 ERR swss#orchagent: :- createEntry: Failed to start PFC Watchdog on port Ethernet100
Nov 13 17:27:23.878620 arc-switch1038 NOTICE swss#orchagent: :- registerInWdDb: No lossless TC found on port Ethernet100

Add unit test to cover the new flow.

How I did it

Before enabling PFCWD on a port, verify if PFC was previously enabled. If not, reply with an error to the user and as a warning in the log.
In the case where the command to enable PFCWD is done for all ports, the configuration will be applied for only those that has PCF enabled and for the rest the configuration will be skipped. In this case the output of the requested command will be only with a list of skipped ports.

How to verify it

run:
pfcwd start EthernetX 600 where EthernetX is a port that has not configured PFC (usually admin state 'down' by default)

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)

SKIPPED: PFC is not enabled on port: Ethernet0
SKIPPED: PFC is not enabled on port: Ethernet66

@lgtm-com
Copy link

lgtm-com bot commented Mar 16, 2021

This pull request introduces 1 alert when merging 46392e4 into 0de99c3 - view on LGTM.com

new alerts:

  • 1 for Testing equality to None

tests/pfcwd_test.py Outdated Show resolved Hide resolved
@smaheshm
Copy link
Contributor

You should also update the "start_default()", and add a unit test for "config pfcwd start_default"

@smaheshm
Copy link
Contributor

Thanks for adding the unit tests. For completeness, please also add a unit test for 'multi ASIC' platform. You already updated the multi ASIC config DBs, just need to add test case.

@ayurkiv-nvda ayurkiv-nvda force-pushed the pfcwd_run_if_pfc_enabled_external branch from 46392e4 to f5be9ee Compare March 16, 2021 17:46
@lgtm-com
Copy link

lgtm-com bot commented Mar 16, 2021

This pull request introduces 1 alert when merging f5be9ee into fbad274 - view on LGTM.com

new alerts:

  • 1 for Testing equality to None

@ayurkiv-nvda
Copy link
Contributor Author

Thanks for adding the unit tests. For completeness, please also add a unit test for 'multi ASIC' platform. You already updated the multi ASIC config DBs, just need to add test case.

Done

@ayurkiv-nvda
Copy link
Contributor Author

You should also update the "start_default()", and add a unit test for "config pfcwd start_default"

Done

@smaheshm
Copy link
Contributor

retest this please

@smaheshm
Copy link
Contributor

Nice!! Wish there was a command to show which ports has PFCWD enabled. Lets wait for tests to pass.

@smaheshm
Copy link
Contributor

retest this please

Copy link
Contributor

@smaheshm smaheshm left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

:shipit:

@liat-grozovik liat-grozovik changed the title Run pfcwd only on ports where pfc is enabled Enable PFCWD only on ports where PFC is enabled Mar 24, 2021
@liat-grozovik
Copy link
Collaborator

@abdosi i am not sure if this is cleanly can be cherry picked or not but I suggest to consider the fix for 201911 as well.
If you would like to take it we can check or create new PR.
@daall appreciate if you can take to 202012 with high prio.

yxieca pushed a commit that referenced this pull request Mar 26, 2021
- What I did
Prevent errors in the log when PFCWD starts on ports that PFC was not previously enabled.

Example of such errors in the log:
Nov 13 17:27:22.878468 arc-switch1038 ERR swss#orchagent: :- createEntry: Failed to start PFC Watchdog on port Ethernet100
Nov 13 17:27:23.878620 arc-switch1038 NOTICE swss#orchagent: :- registerInWdDb: No lossless TC found on port Ethernet100
Add unit test to cover the new flow.

- How I did it
Before enabling PFCWD on a port, verify if PFC was previously enabled. If not, reply with an error to the user and as a warning in the log.
In the case where the command to enable PFCWD is done for all ports, the configuration will be applied for only those that has PCF enabled and for the rest the configuration will be skipped. In this case the output of the requested command will be only with a list of skipped ports.

- How to verify it
'pfcwd start EthernetX 600' where EthernetX is a port that has not configured PFC (usually admin state 'down' by default)
neethajohn added a commit that referenced this pull request Nov 24, 2021
…dered (#1937)

Signed-off-by: Neetha John <nejo@microsoft.com>

Fixes sonic-net/sonic-buildimage#9292

What I did
Pfcwd was not getting started after executing load_minigraph after the changes done in #1508. This was because the PORT_QOS_MAP table is not yet present in config db (this gets populated only after the buffer templates are rendered) at the time we try to start pfcwd and hence the 'pfc_enable' field will always be empty and we skip writing PFC_WD table entries to config db.

How I did it
Delay pfcwd start until the buffer templates are rendered

How to verify it
Issue "config load_minigraph" with the changes and ensure that pfcwd is started on all active ports
qiluo-msft pushed a commit that referenced this pull request Nov 30, 2021
…dered (#1937)

Signed-off-by: Neetha John <nejo@microsoft.com>

Fixes sonic-net/sonic-buildimage#9292

What I did
Pfcwd was not getting started after executing load_minigraph after the changes done in #1508. This was because the PORT_QOS_MAP table is not yet present in config db (this gets populated only after the buffer templates are rendered) at the time we try to start pfcwd and hence the 'pfc_enable' field will always be empty and we skip writing PFC_WD table entries to config db.

How I did it
Delay pfcwd start until the buffer templates are rendered

How to verify it
Issue "config load_minigraph" with the changes and ensure that pfcwd is started on all active ports
abdosi pushed a commit that referenced this pull request Dec 8, 2021
…dered (#1937)

Signed-off-by: Neetha John <nejo@microsoft.com>

Fixes sonic-net/sonic-buildimage#9292

What I did
Pfcwd was not getting started after executing load_minigraph after the changes done in #1508. This was because the PORT_QOS_MAP table is not yet present in config db (this gets populated only after the buffer templates are rendered) at the time we try to start pfcwd and hence the 'pfc_enable' field will always be empty and we skip writing PFC_WD table entries to config db.

How I did it
Delay pfcwd start until the buffer templates are rendered

How to verify it
Issue "config load_minigraph" with the changes and ensure that pfcwd is started on all active ports
@ayurkiv-nvda ayurkiv-nvda deleted the pfcwd_run_if_pfc_enabled_external branch May 30, 2023 21:49
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Projects
None yet
Development

Successfully merging this pull request may close these issues.

4 participants