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

clear: Fix clear queuecounters to also clear VOQ counters #2878

Merged

Conversation

patrickmacarthur
Copy link
Contributor

What I did

Fix a bug where the CLI command sonic-clear queuecounters would not clear the VOQ counters.

fixes sonic-net/sonic-buildimage#15198

How I did it

Added the command to clear the VOQ counters.

How to verify it

  1. Start traffic on an interface on a specific queue.
  2. Use show queue counters and show queue counters --voq to verify that the counters are non-zero.
  3. Stop traffic on the interface.
  4. Run sonic-clear queuecounters.
  5. Repeat the show commands and ensure that the counters have been reset.

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)

@kenneth-arista
Copy link
Contributor

@wenyiz2021 @arlakshm

Copy link
Contributor

@arlakshm arlakshm left a comment

Choose a reason for hiding this comment

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

@patrickmacarthur , can you add a unit test for this command

@patrickmacarthur patrickmacarthur force-pushed the master-fix-clear-queue-counters branch from 7fa8d13 to bace4a1 Compare June 15, 2023 22:02
@patrickmacarthur
Copy link
Contributor Author

/azpw run Semgrep

@mssonicbld
Copy link
Collaborator

/AzurePipelines run Semgrep

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@maipbui
Copy link
Contributor

maipbui commented Jun 29, 2023

@patrickmacarthur Please merge latest master code to trigger Semgrep.

@patrickmacarthur patrickmacarthur force-pushed the master-fix-clear-queue-counters branch from bace4a1 to 7e2c286 Compare June 29, 2023 18:55
wenyiz2021
wenyiz2021 previously approved these changes Jun 29, 2023
Copy link
Contributor

@wenyiz2021 wenyiz2021 left a comment

Choose a reason for hiding this comment

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

LGTM

@patrickmacarthur patrickmacarthur force-pushed the master-fix-clear-queue-counters branch from 7e2c286 to 92cffdf Compare July 11, 2023 16:52
@patrickmacarthur patrickmacarthur force-pushed the master-fix-clear-queue-counters branch 4 times, most recently from 1083622 to 92646d7 Compare July 17, 2023 17:10
@patrickmacarthur
Copy link
Contributor Author

@maipbui @arlakshm The Semgrep task is still not running. I have rebased to the latest code since I was requested to.

@patrickmacarthur
Copy link
Contributor Author

Looks like Semgrep succeeded so this is ready for review

@arlakshm
Copy link
Contributor

arlakshm commented Aug 9, 2023

can you resolve the conflict.

The `sonic-clear queuecounters` command does not currently clear VOQ
counters. Fix it and add a unit test to verify that the VOQ counters
were actually cleared.

The unit test changes required some updates to the VOQ counters tests,
because on an actual DUT the VOQ counter uses fully-qualified
interface names (dut|asic|port) whereas the queue counters just use
the port name. The unit tests had kept the names the same but this
meant that the saved counters for VOQ and non-VOQ counters would
overwrite each other when the counters were cleared during the unit
tests. Qualify the interface names used in the VOQ unit tests to avoid
this.
@patrickmacarthur patrickmacarthur force-pushed the master-fix-clear-queue-counters branch from 92646d7 to a8b5b5e Compare August 9, 2023 17:37
@rlhui rlhui added the p0 label Aug 9, 2023
@arlakshm arlakshm merged commit 5b492d5 into sonic-net:master Aug 11, 2023
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
Projects
Archived in project
Development

Successfully merging this pull request may close these issues.

"sonic-clear queuecounters" doesn't clear the VOQ counters
7 participants