[trim]: Add Packet Trimming Drop Counters CLI#3993
[trim]: Add Packet Trimming Drop Counters CLI#3993qiluo-msft merged 2 commits intosonic-net:masterfrom
Conversation
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
e0aa175 to
604d80d
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@kperumalbfn / @r12f this is a blocker for SWSS CI. Can you please help to review & merge? |
604d80d to
9c182d8
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
9c182d8 to
6469494
Compare
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@qiluo-msft Could you please merge this PR |
There was a problem hiding this comment.
Pull Request Overview
The PR implements CLI for Packet Trimming Drop Counters feature by adding new trimming counters (trimmed sent packets and trimmed dropped packets) in addition to the existing total trimmed packets counter. It extends both interface and switch-level statistics to support the new granular trimming counters.
- Adds switch-level trimming statistics with new switchstat CLI command
- Extends interface trimming counters to include sent and dropped packet counts
- Updates all related utilities, tests, and mock data to support the new counters
Reviewed Changes
Copilot reviewed 33 out of 33 changed files in this pull request and generated 4 comments.
Show a summary per file
| File | Description |
|---|---|
| utilities_common/switchstat.py | New module implementing switch-level trimming statistics functionality |
| utilities_common/portstat.py | Extended to support new trimmed sent/dropped packet counters |
| utilities_common/netstat.py | Enhanced format functions to handle raw negative values |
| tests/switchstat_test.py | Comprehensive test suite for new switch statistics CLI |
| tests/show_test.py | Added tests for switch counter CLI integration |
| tests/portstat_test.py | Updated to handle new trimming counter fields |
| Mock data files | Updated to include new SAI counter values for testing |
Comments suppressed due to low confidence (1)
utilities_common/portstat.py:47
- The global constant BUCKET_NUM has been removed but there are still references to it in comments. Consider updating line 47 comment to reflect that the bucket count is now dynamically calculated using
len(counter_bucket_dict).
The order and count of statistics mentioned below needs to be in sync with the values in portstat script
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
6469494 to
e9f23d8
Compare
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
|
@qiluo-msft review comments are handled. Can you please help to merge? |
|
hi @nazariig , do you mind to help us with a manual cherry pick? |
|
Remove 202505 request label since packet trimming feature won't be included into 202505 branch. |
### Summary: Add packet trimming counter testcase phase1 ### Related PR - Add packet trimming drop counter test plan sonic-net/sonic-mgmt#19824 - Packet Trimming: Drop Counters HLD sonic-net/SONiC#2033 - [trim]: Add Packet Trimming Drop Counters YANG model sonic-net/sonic-buildimage#23422 - [trim]: Add Packet Trimming Drop Counters DB schema sonic-net/sonic-swss-common#1055 - [trim]: Add Packet Trimming Drop Counters to VS lib sonic-net/sonic-sairedis#1630 - [trim]: Add Packet Trimming Drop Counters to OA sonic-net/sonic-swss#3777 - [trim]: Add Packet Trimming Drop Counters CLI sonic-net/sonic-utilities#3993 ### Type of change <!-- - Fill x for your type of change. - e.g. - [x] Bug fix --> - [ ] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] New Test case - [ ] Skipped for non-supported platforms - [ ] Test case improvement ### Back port request - [ ] 202205 - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [x] 202505 ### Approach #### What is the motivation for this PR? #### How did you do it? #### How did you verify/test it? #### Any platform specific information? #### Supported testbed topology if it's a new test case? ### Documentation <!-- (If it's a new feature, new test case) Did you update documentation/Wiki relevant to your implementation? Link to the wiki page? -->
### Summary: Add packet trimming counter testcase phase1 ### Related PR - Add packet trimming drop counter test plan sonic-net/sonic-mgmt#19824 - Packet Trimming: Drop Counters HLD sonic-net/SONiC#2033 - [trim]: Add Packet Trimming Drop Counters YANG model sonic-net/sonic-buildimage#23422 - [trim]: Add Packet Trimming Drop Counters DB schema sonic-net/sonic-swss-common#1055 - [trim]: Add Packet Trimming Drop Counters to VS lib sonic-net/sonic-sairedis#1630 - [trim]: Add Packet Trimming Drop Counters to OA sonic-net/sonic-swss#3777 - [trim]: Add Packet Trimming Drop Counters CLI sonic-net/sonic-utilities#3993 ### Type of change <!-- - Fill x for your type of change. - e.g. - [x] Bug fix --> - [ ] Bug fix - [ ] Testbed and Framework(new/improvement) - [ ] New Test case - [ ] Skipped for non-supported platforms - [ ] Test case improvement ### Back port request - [ ] 202205 - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [x] 202505 ### Approach #### What is the motivation for this PR? #### How did you do it? #### How did you verify/test it? #### Any platform specific information? #### Supported testbed topology if it's a new test case? ### Documentation <!-- (If it's a new feature, new test case) Did you update documentation/Wiki relevant to your implementation? Link to the wiki page? -->
HLD: sonic-net/SONiC#2033 What I did Implemented CLI for Packet Trimming Drop Counters feature How I did it Integrated Packet Trimming Drop Counters interface into config and show CLI root How to verify it Run Packet Trimming CLI UTs Previous command output (if the output of a command-line utility has changed) admin@sonic:/home/admin# show interfaces counters trim Ethernet0 IFACE STATE TRIM_PKTS --------- ------- ----------- Ethernet0 U 100 New command output (if the output of a command-line utility has changed) admin@sonic:/home/admin# show interfaces counters trim Ethernet0 IFACE STATE TRIM_PKTS TRIM_TX_PKTS TRIM_DRP_PKTS --------- ------- ----------- -------------- --------------- Ethernet0 U 100 50 50
Signed-off-by: Nazarii Hnydyn nazariig@nvidia.com
HLD: sonic-net/SONiC#2033
What I did
How I did it
configandshowCLI rootHow to verify it
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)
A picture of a cute animal (not mandatory but encouraged)