Skip to content

[trim]: Add Packet Trimming Drop Counters to OA#3777

Merged
dgsudharsan merged 2 commits intosonic-net:masterfrom
nazariig:master-trim-counter
Aug 18, 2025
Merged

[trim]: Add Packet Trimming Drop Counters to OA#3777
dgsudharsan merged 2 commits intosonic-net:masterfrom
nazariig:master-trim-counter

Conversation

@nazariig
Copy link
Collaborator

@nazariig nazariig commented Jul 22, 2025

Signed-off-by: Nazarii Hnydyn nazariig@nvidia.com

DEPENDS:

  1. [trim]: Add Packet Trimming Drop Counters DB schema sonic-swss-common#1055
  2. [trim]: Add Packet Trimming Drop Counters CLI sonic-utilities#3993

HLD: sonic-net/SONiC#2033

What I did

  • Implemented Packet Trimming Drop Counters feature

Why I did it

  • Implementation is done according to the Packet Trimming Drop Counters HLD

How I verified it

  1. Run Packet Trimming VS UTs

Details if related

  • N/A

A picture of a cute animal (not mandatory but encouraged)

      .---.        .-----------
     /     \  __  /    ------
    / /     \(  )/    -----
   //////   ' \/ `   ---
  //// / // :    : ---
 // /   /  /`    '--
//          //..\\
       ====UU====UU====
           '//||\\`
             ''``

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nazariig nazariig force-pushed the master-trim-counter branch from eaf3f9a to 9027799 Compare July 28, 2025 09:35
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nazariig nazariig marked this pull request as ready for review July 28, 2025 09:36
@nazariig nazariig requested a review from prsunny as a code owner July 28, 2025 09:36
@nazariig nazariig force-pushed the master-trim-counter branch from 9027799 to 9549228 Compare August 4, 2025 11:33
@nazariig nazariig force-pushed the master-trim-counter branch from 94742e7 to 09f8827 Compare August 18, 2025 19:46
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@nazariig
Copy link
Collaborator Author

@kperumalbfn / @r12f all checks are passed. Please help to merge

@dgsudharsan dgsudharsan merged commit d5babb4 into sonic-net:master Aug 18, 2025
15 checks passed
@r12f
Copy link

r12f commented Aug 19, 2025

hi @nazariig , do you mind to help pick this change to 202412?

@kperumalbfn
Copy link
Contributor

@r12f 202412 PR - Azure/sonic-swss.msft#130 please merge

SAI_QUEUE_STAT_DROPPED_PACKETS,
SAI_QUEUE_STAT_DROPPED_BYTES,
SAI_QUEUE_STAT_TRIM_PACKETS
SAI_QUEUE_STAT_TRIM_PACKETS,
Copy link
Contributor

@dhanasekar-arista dhanasekar-arista Aug 20, 2025

Choose a reason for hiding this comment

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

@nazariig TRIM specific stats are introducing more new SAI errors on non TH5 platforms, do you have plan to address this? @lolyu @aaronpayment @pandurangan-arista FYI.


2025 Aug 19 06:08:38.448632 gd231 ERR syncd#syncd: [none] SAI_API_SWITCH:_brcm_sai_xgs_pkt_trim_get_mapped_counter:102 Packet trim feature is not supported
2025 Aug 19 06:08:38.448632 gd231 ERR syncd#syncd: [none] SAI_API_QUEUE:_brcm_sai_xgs_queue_pkt_trim_get_clear_ctr:164 Get Trim mapped counter failed with error -2.
2025 Aug 19 06:08:38.448632 gd231 ERR syncd#syncd: [none] SAI_API_QUEUE:_brcm_sai_cosq_stat_get:1970 Get Trim stats packets failed with error -2.

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@dhanasekar-arista since feature is not supported, please make sure SAI returns the relevant stats capabilities. Then counter polling won't take place. The capabilities check is already part of the flex counter infra

@keboliu
Copy link
Collaborator

keboliu commented Aug 25, 2025

@nazariig would you please create a backport PR for 202505 as there is a conflict?

@yejianquan
Copy link

Remove 202505 request label since packet trimming feature won't be included into 202505 branch.

a114j0y pushed a commit to a114j0y/sonic-swss that referenced this pull request Aug 29, 2025
* [trim]: Add Packet Trimming Drop Counters to OA

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

* [trim]: Handle review comments

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

---------

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
divyagayathri-hcl pushed a commit to divyagayathri-hcl/sonic-swss that referenced this pull request Aug 29, 2025
* [trim]: Add Packet Trimming Drop Counters to OA

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

* [trim]: Handle review comments

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

---------

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
arfeigin pushed a commit to arfeigin/sonic-swss that referenced this pull request Oct 9, 2025
* [trim]: Add Packet Trimming Drop Counters to OA

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

* [trim]: Handle review comments

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

---------

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
arfeigin pushed a commit to arfeigin/sonic-swss that referenced this pull request Oct 9, 2025
mssonicbld added a commit to mssonicbld/sonic-mgmt.msft that referenced this pull request Oct 23, 2025
### 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?
-->
mssonicbld added a commit to Azure/sonic-mgmt.msft that referenced this pull request Oct 23, 2025
### 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?
-->
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
* [trim]: Add Packet Trimming Drop Counters to OA

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

* [trim]: Handle review comments

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

---------

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
balanokia pushed a commit to balanokia/sonic-swss that referenced this pull request Nov 17, 2025
* [trim]: Add Packet Trimming Drop Counters to OA

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

* [trim]: Handle review comments

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

---------

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
theasianpianist pushed a commit to theasianpianist/sonic-swss that referenced this pull request Feb 4, 2026
* [trim]: Add Packet Trimming Drop Counters to OA

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

* [trim]: Handle review comments

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

---------

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
Signed-off-by: Lawrence Lee <lawlee@microsoft.com>
baorliu pushed a commit to baorliu/sonic-swss that referenced this pull request Feb 23, 2026
* [trim]: Add Packet Trimming Drop Counters to OA

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

* [trim]: Handle review comments

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

---------

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
Signed-off-by: Baorong Liu <96146196+baorliu@users.noreply.github.com>
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.