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

[pfcwd] Configuring to 'stop' ports #1350

Open
wants to merge 2 commits into
base: master
Choose a base branch
from

Conversation

d-dashkov
Copy link
Contributor

@d-dashkov d-dashkov commented Jan 8, 2021

- What I did
Refactored the pfcwd stop command to look like pfcwd start.
It provides an update to stop a specific port:
config pfcwd stop Ethernet0
Or for all ports at once:
config pfcwd stop all

fixes sonic-net/sonic-buildimage#6338

- How to verify it
Create pfcwd instances for ports:
pfcwd start --action drop Ethernet0 400
pfcwd start --action drop Ethernet80 400
show pfcwd config

Remove one port
config pfcwd stop Ethernet0
show pfcwd config

Or remove all of them
config pfcwd stop all
show pfcwd config

- Previous command input
config pfcwd stop

- New command input
config pfcwd stop <port name / 'all'>

@d-dashkov
Copy link
Contributor Author

retest this please

click.echo("Ports not selected")
return

if 'all' in ports:
Copy link
Collaborator

Choose a reason for hiding this comment

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

should use 'all' == ports?

Copy link
Contributor Author

Choose a reason for hiding this comment

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

Such logic with the "in" statement should handle the case: "config pfcwd stop Ethernet0 Ethernet1 all" and remove all ports despite the first two arguments

Copy link
Collaborator

Choose a reason for hiding this comment

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

I don't think we need to support this kind of command: "config pfcwd stop Ethernet0 Ethernet1 all" seems strange to me.

@keboliu
Copy link
Collaborator

keboliu commented Feb 25, 2022

what will be the output of "config pfcwd stop --help" looks like?

@d-dashkov
Copy link
Contributor Author

what will be the output of "config pfcwd stop --help" looks like?

admin@sonic:~$ sudo config pfcwd stop --help
Usage: config pfcwd stop [OPTIONS]

  Stop PFC watchdog

Options:
  --verbose       Enable verbose output
  -h, -?, --help  Show this message and exit.

@keboliu
Copy link
Collaborator

keboliu commented Mar 2, 2022

what will be the output of "config pfcwd stop --help" looks like?

admin@sonic:~$ sudo config pfcwd stop --help
Usage: config pfcwd stop [OPTIONS]

  Stop PFC watchdog

Options:
  --verbose       Enable verbose output
  -h, -?, --help  Show this message and exit.

I would suggest adding proper hint info about supported subcommand in the output

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

Successfully merging this pull request may close these issues.

[PFCWD CLI] Configuring to 'stop' all ports command is not aligned
3 participants