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

Add 'show' and 'clear' command for PG drop #1461

Merged
merged 2 commits into from
Mar 16, 2021

Conversation

ayurkiv-nvda
Copy link
Contributor

@ayurkiv-nvda ayurkiv-nvda commented Feb 24, 2021

- What I did

Added new CLI commands to view and clear PG dropped packet statistics.
Added the new CLI commands to the command reference guide.

- How I did it

I have added script which can generate table that shows current PG dropped packet statistic and also can clean it
Clean and Show is implemented with using serialized stats from previous execution.
To calculate current stats we do next step:

  • take old serialized data (if no 'clear' executed all serialized data is 0)
  • take current stat
  • show diff between current and old

How to verify it

run
show priority-group drop counters - show current stat
sonic-clear priority-group drop counters - clear current stat

Previous command output (if the output of a command-line utility has changed)

N/A

New command output (if the output of a command-line utility has changed)

  1. show priority-group drop counters
Ingress PG dropped packets:
     Port    PG0    PG1    PG2    PG3    PG4    PG5    PG6    PG7
---------  -----  -----  -----  -----  -----  -----  -----  -----
Ethernet0    800    801    802    803    804    805    806    807
Ethernet4    400    401    402    403    404    405    406    407
Ethernet8    100    101    102    103    104    105    106    107
...
  1. sonic-clear priority-group drop counters
    Cleared PG drop counters

@lgtm-com
Copy link

lgtm-com bot commented Feb 24, 2021

This pull request introduces 2 alerts when merging 7ec47e2 into 4e27ad7 - view on LGTM.com

new alerts:

  • 2 for Unused import

@neethajohn
Copy link
Contributor

Please add unit tests

@liat-grozovik liat-grozovik changed the title Add 'show' and 'clear' command for PG drop, add appropriate Command-Refference Add 'show' and 'clear' command for PG drop Feb 28, 2021
@liat-grozovik
Copy link
Collaborator

@ayurkiv-nvda please add to the PR description the output of the show command as part of
'#### New command output (if the output of a command-line utility has changed)'

doc/Command-Reference.md Outdated Show resolved Hide resolved
scripts/pg-drop Show resolved Hide resolved
scripts/pg-drop Show resolved Hide resolved
@ayurkiv-nvda
Copy link
Contributor Author

This pull request introduces 2 alerts when merging 7ec47e2 into 4e27ad7 - view on LGTM.com

new alerts:

  • 2 for Unused import

fixed

@ayurkiv-nvda
Copy link
Contributor Author

@ayurkiv-nvda please add to the PR description the output of the show command as part of
'#### New command output (if the output of a command-line utility has changed)'

added

@ayurkiv-nvda
Copy link
Contributor Author

Please add unit tests

Done

@lgtm-com
Copy link

lgtm-com bot commented Mar 2, 2021

This pull request introduces 1 alert when merging a2483a30c5c301e0f3799470431a969b7d9a441d into 8b3bc18 - view on LGTM.com

new alerts:

  • 1 for Unused import

@lgtm-com
Copy link

lgtm-com bot commented Mar 10, 2021

This pull request introduces 1 alert when merging d007fbe into 13ce4b6 - view on LGTM.com

new alerts:

  • 1 for Unused import

@neethajohn neethajohn merged commit fbad274 into sonic-net:master Mar 16, 2021
daall pushed a commit that referenced this pull request Mar 19, 2021
* What I did
Added new CLI commands to view and clear PG dropped packet statistics.
Added the new CLI commands to the command reference guide.

* How I did it
I have added script which can generate table that shows current PG dropped packet statistic and also can clean it
Clean and Show is implemented with using serialized stats from previous execution.
To calculate current stats we do next step:
- take old serialized data (if no 'clear' executed all serialized data is 0)
- take current stat
- show diff between current and old

* How to verify it
run
show priority-group drop counters - show current stat
sonic-clear priority-group drop counters - clear current stat

* New command output (if the output of a command-line utility has changed)
show priority-group drop counters
Ingress PG dropped packets:
     Port    PG0    PG1    PG2    PG3    PG4    PG5    PG6    PG7
---------  -----  -----  -----  -----  -----  -----  -----  -----
Ethernet0    800    801    802    803    804    805    806    807
Ethernet4    400    401    402    403    404    405    406    407
Ethernet8    100    101    102    103    104    105    106    107
...
sonic-clear priority-group drop counters
Cleared PG drop counters

Co-authored-by: ayurkiv <ayurkiv@contoso.com>
@stephenxs
Copy link
Collaborator

Need to put the newly added scripts/pg-drop to setup.py as well. Fixed in #1586

neethajohn pushed a commit that referenced this pull request Jun 22, 2022
…rpoll, show/clear counters) (#2155)

Signed-off-by: Andriy Yurkiv <ayurkiv@nvidia.com>

Should be merged after sonic-net/sonic-swss#2263

Appropriate PR in master:#1355, #1461, #1583

What I did
Added new option for "counterpoll" utility
Added new CLI commands to view and clear PG dropped packet statistics.
Added the new CLI commands to the command reference guide.

How I did it
Need to merge PG drop functionality to 201911

How to verify it
admin@arc-switch1041:~$ counterpoll pg-drop enable  --> to enable the new counter
admin@arc-switch1041:~$ counterpoll show  --> check new INGRESS_PG_STAT_DROP counter status
Check counters

admin@arc-switch1041:~$ redis-cli -n 2
127.0.0.1:6379[2]> HGETALL COUNTERS:oid:0x1a000000000062
1) "SAI_INGRESS_PRIORITY_GROUP_STAT_XOFF_ROOM_WATERMARK_BYTES"
2) "0"
3) "SAI_INGRESS_PRIORITY_GROUP_STAT_SHARED_WATERMARK_BYTES"
4) "0"
5) "SAI_INGRESS_PRIORITY_GROUP_STAT_DROPPED_PACKETS"
6) "0"
show priority-group drop counters

Ingress PG dropped packets:
     Port    PG0    PG1    PG2    PG3    PG4    PG5    PG6    PG7
---------  -----  -----  -----  -----  -----  -----  -----  -----
Ethernet0    800    801    802    803    804    805    806    807
Ethernet4    400    401    402    403    404    405    406    407
Ethernet8    100    101    102    103    104    105    106    107
...
sonic-clear priority-group drop counters
Cleared PG drop counters
@ayurkiv-nvda ayurkiv-nvda deleted the pg_drop_show_clear branch May 30, 2023 21:48
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.

5 participants