Skip to content

Packet Trimming HLD#1898

Merged
prsunny merged 4 commits intosonic-net:masterfrom
nazariig:master-pkt-trim
May 5, 2025
Merged

Packet Trimming HLD#1898
prsunny merged 4 commits intosonic-net:masterfrom
nazariig:master-pkt-trim

Conversation

@nazariig
Copy link
Collaborator

@nazariig nazariig commented Jan 22, 2025

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

This document provides general information about Packet Trimming implementation in SONiC

In scope:

  1. Global Packet Trimming configuration with per buffer profile control
  2. Fine-grained Packet Trimming control via ACL disable trimming action
PR title state context
YANG Model GitHub issue/pull request detail GitHub pull request check contexts
DB Schema GitHub issue/pull request detail GitHub pull request check contexts
VS Library GitHub issue/pull request detail GitHub pull request check contexts
SWSS GitHub issue/pull request detail GitHub pull request check contexts
CLI GitHub issue/pull request detail GitHub pull request check contexts
Test Plan GitHub issue/pull request detail GitHub pull request check contexts
Test GitHub issue/pull request detail GitHub pull request check contexts

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@prsunny
Copy link
Contributor

prsunny commented Feb 20, 2025

@kperumalbfn to review and signoff

Copy link

@sridhartalari sridhartalari left a comment

Choose a reason for hiding this comment

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

(UEC) Ultra EThernet consortium specification on packet trimming specifies that we should check if packet is greater than certain size to be eligible for trimming. Can we add this also as a configurable parameter.

UEC also mentions that the decision to trim the packet should be based on incoming DSCP along with queue . since current proposal is based on queue alone r we imposing the limit of 1:1 mapping between DSCP and queue?

UEC also recommends 1 DSCP for trimmed and other DSCP for last hop trimmed. Please let us know if we plan to accomdate this

@nazariig
Copy link
Collaborator Author

nazariig commented Feb 27, 2025

(UEC) Ultra EThernet consortium specification on packet trimming specifies that we should check if packet is greater than certain size to be eligible for trimming. Can we add this also as a configurable parameter.

UEC also mentions that the decision to trim the packet should be based on incoming DSCP along with queue . since current proposal is based on queue alone r we imposing the limit of 1:1 mapping between DSCP and queue?

UEC also recommends 1 DSCP for trimmed and other DSCP for last hop trimmed. Please let us know if we plan to accomdate this

@sridhartalari going thru your questions one-by-one:

-> Can we add this also as a configurable parameter.
Packet trimming size is configurable - already part of design.
Packet trimming eligibility is vendor specific behavior

-> since current proposal is based on queue alone r we imposing the limit of 1:1 mapping between DSCP and queue?
User can only configure single dscp and queue which shall be applied after trimming. Current design does not assume having multiple combinations of DSCP and queue for the trimmed packets

-> Please let us know if we plan to accomdate this
Currently there is no plan to have it

@sridhartalari
Copy link

Thank you for the explanation.
Yang model is also for the final results after trimming is applied. Can we have eligible DSCP values with which packet should come to be eligible for trimming. it makes all config global. internally we can dedicated queue for eligible DSCP values and apply the rimming policy. In this way end user only need to deal with DSCP

Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

No pipelines are associated with this pull request.

@nazariig
Copy link
Collaborator Author

Thank you for the explanation. Yang model is also for the final results after trimming is applied. Can we have eligible DSCP values with which packet should come to be eligible for trimming. it makes all config global. internally we can dedicated queue for eligible DSCP values and apply the rimming policy. In this way end user only need to deal with DSCP

Can we have eligible DSCP values with which packet should come to be eligible for trimming

This concept is out of scope of current design proposal. The existing HLD is based on SAI API proposal discussed in SAI Community. I would suggest you to discuss it with the relevant forum first. Once the new SAI API is ready, we can continue discussion here

@nazariig
Copy link
Collaborator Author

nazariig commented May 5, 2025

@qiluo-msft can you please help to merge? All approvals are present

@prsunny prsunny merged commit f692eec into sonic-net:master May 5, 2025
1 check passed
qiluo-msft pushed a commit to sonic-net/sonic-utilities that referenced this pull request May 7, 2025
DEPENDS:

[trim]: Add Packet Trimming DB schema sonic-swss-common#1001
HLD: sonic-net/SONiC#1898

What I did
Implemented CLI for Packet Trimming feature
How I did it
Integrated Packet Trimming interface into config and show CLI root
How to verify it
Run Packet Trimming CLI UTs
mssonicbld added a commit to mssonicbld/sonic-swss-common.msft that referenced this pull request May 9, 2025
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

**HLD:** sonic-net/SONiC#1898

#### A picture of a cute animal (not mandatory but encouraged)
```
      .---.        .-----------
     /     \  __  /    ------
    / /     \(  )/    -----
   //////   ' \/ `   ---
  //// / // :    : ---
 // /   /  /`    '--
//          //..\\
       ====UU====UU====
           '//||\\`
             ''``
```
mssonicbld added a commit to mssonicbld/sonic-sairedis.msft that referenced this pull request May 9, 2025
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

**HLD:** sonic-net/SONiC#1898

Requires SAI API v1.15.7

#### A picture of a cute animal (not mandatory but encouraged)
```
      .---.        .-----------
     /     \  __  /    ------
    / /     \(  )/    -----
   //////   ' \/ `   ---
  //// / // :    : ---
 // /   /  /`    '--
//          //..\\
       ====UU====UU====
           '//||\\`
             ''``
```
mssonicbld added a commit to mssonicbld/sonic-utilities.msft that referenced this pull request May 9, 2025
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

<!--
    Please make sure you've read and understood our contributing guidelines:
    https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

    ** Make sure all your commits include a signature generated with `git commit -s` **

    If this is a bug fix, make sure your description includes "closes #xxxx",
    "fixes #xxxx" or "resolves #xxxx" so that GitHub automatically closes the related
    issue when the PR is merged.

    If you are adding/modifying/removing any command or utility script, please also
    make sure to add/modify/remove any unit tests from the tests
    directory as appropriate.

    If you are modifying or removing an existing 'show', 'config' or 'sonic-clear'
    subcommand, or you are adding a new subcommand, please make sure you also
    update the Command Line Reference Guide (doc/Command-Reference.md) to reflect
    your changes.

    Please provide the following information:
-->

**DEPENDS:**
1. sonic-net/sonic-swss-common#1001

**HLD:** sonic-net/SONiC#1898

#### What I did
* Implemented CLI for Packet Trimming feature

#### How I did it
* Integrated Packet Trimming interface into `config` and `show` CLI root

#### How to verify it
1. Run Packet Trimming CLI UTs

#### 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)
* N/A

#### A picture of a cute animal (not mandatory but encouraged)
```
      .---.        .-----------
     /     \  __  /    ------
    / /     \(  )/    -----
   //////   ' \/ `   ---
  //// / // :    : ---
 // /   /  /`    '--
//          //..\\
       ====UU====UU====
           '//||\\`
             ''``
```
mssonicbld added a commit to Azure/sonic-sairedis.msft that referenced this pull request May 9, 2025
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

**HLD:** sonic-net/SONiC#1898

Requires SAI API v1.15.7

#### A picture of a cute animal (not mandatory but encouraged)
```
 .---. .-----------
 / \ __ / ------
 / / \( )/ -----
 ////// ' \/ ` ---
 //// / // : : ---
 // / / /` '--
// //..\\
 ====UU====UU====
 '//||\\`
 ''``
```
mssonicbld added a commit to Azure/sonic-utilities.msft that referenced this pull request May 9, 2025
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

<!--
 Please make sure you've read and understood our contributing guidelines:
 https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

 failure_prs.log skip_prs.log Make sure all your commits include a signature generated with `git commit -s` **

 If this is a bug fix, make sure your description includes "closes #xxxx",
 "fixes #xxxx" or "resolves #xxxx" so that GitHub automatically closes the related
 issue when the PR is merged.

 If you are adding/modifying/removing any command or utility script, please also
 make sure to add/modify/remove any unit tests from the tests
 directory as appropriate.

 If you are modifying or removing an existing 'show', 'config' or 'sonic-clear'
 subcommand, or you are adding a new subcommand, please make sure you also
 update the Command Line Reference Guide (doc/Command-Reference.md) to reflect
 your changes.

 Please provide the following information:
-->

**DEPENDS:**
1. sonic-net/sonic-swss-common#1001

**HLD:** sonic-net/SONiC#1898

#### What I did
* Implemented CLI for Packet Trimming feature

#### How I did it
* Integrated Packet Trimming interface into `config` and `show` CLI root

#### How to verify it
1. Run Packet Trimming CLI UTs

#### 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)
* N/A

#### A picture of a cute animal (not mandatory but encouraged)
```
 .---. .-----------
 / \ __ / ------
 / / \( )/ -----
 ////// ' \/ ` ---
 //// / // : : ---
 // / / /` '--
// //..\\
 ====UU====UU====
 '//||\\`
 ''``
```
mssonicbld added a commit to Azure/sonic-swss-common.msft that referenced this pull request May 9, 2025
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

**HLD:** sonic-net/SONiC#1898

#### A picture of a cute animal (not mandatory but encouraged)
```
 .---. .-----------
 / \ __ / ------
 / / \( )/ -----
 ////// ' \/ ` ---
 //// / // : : ---
 // / / /` '--
// //..\\
 ====UU====UU====
 '//||\\`
 ''``
```
r12f pushed a commit to Azure/sonic-sairedis.msft that referenced this pull request May 12, 2025
* Updated SAI version to 1.16.1.

Signed-off-by: Mahdi Ramezani <mramezani@microsoft.com>

* [trim]: Add Packet Trimming to VS lib (#55)

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

**HLD:** sonic-net/SONiC#1898

Requires SAI API v1.15.7

#### A picture of a cute animal (not mandatory but encouraged)
```
 .---. .-----------
 / \ __ / ------
 / / \( )/ -----
 ////// ' \/ ` ---
 //// / // : : ---
 // / / /` '--
// //..\\
 ====UU====UU====
 '//||\\`
 ''``
```

* Update codeql runs-on ubuntu version to 22.04 (#56)

Update the CodeQL runner Ubuntu version. This is to address the following:
```
This is a scheduled Ubuntu 20.04 retirement. Ubuntu 20.04 LTS runner will be removed on 2025-04-15. For more details, see actions/runner-images#11101
```

* Updated SAI version to 1.16.1.

Signed-off-by: Mahdi Ramezani <mramezani@microsoft.com>

---------

Signed-off-by: Mahdi Ramezani <mramezani@microsoft.com>
Co-authored-by: mssonicbld <79238446+mssonicbld@users.noreply.github.com>
mssonicbld added a commit to mssonicbld/sonic-sairedis that referenced this pull request Jun 4, 2025
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

**DEPENDS:**
1. sonic-net#1575

**HLD:** sonic-net/SONiC#1898

#### A picture of a cute animal (not mandatory but encouraged)
```
      .---.        .-----------
     /     \  __  /    ------
    / /     \(  )/    -----
   //////   ' \/ `   ---
  //// / // :    : ---
 // /   /  /`    '--
//          //..\\
       ====UU====UU====
           '//||\\`
             ''``
```
mssonicbld added a commit to sonic-net/sonic-sairedis that referenced this pull request Jun 5, 2025
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

**DEPENDS:**
1. #1575

**HLD:** sonic-net/SONiC#1898

#### A picture of a cute animal (not mandatory but encouraged)
```
 .---. .-----------
 / \ __ / ------
 / / \( )/ -----
 ////// ' \/ ` ---
 //// / // : : ---
 // / / /` '--
// //..\\
 ====UU====UU====
 '//||\\`
 ''``
```
nmoray pushed a commit to nmoray/sonic-utilities that referenced this pull request Jun 25, 2025
DEPENDS:

[trim]: Add Packet Trimming DB schema sonic-swss-common#1001
HLD: sonic-net/SONiC#1898

What I did
Implemented CLI for Packet Trimming feature
How I did it
Integrated Packet Trimming interface into config and show CLI root
How to verify it
Run Packet Trimming CLI UTs
prsunny pushed a commit to sonic-net/sonic-swss that referenced this pull request Jun 27, 2025
* [trim]: Add Packet Trimming to OA
DEPENDS:

[trim]: Add Packet Trimming DB schema sonic-swss-common#1001
[trim]: Add Packet Trimming to VS lib sonic-sairedis#1575
[trim]: Add Packet Trimming Port/Queue stats to VS lib sonic-sairedis#1598
HLD: sonic-net/SONiC#1898

What I did

Implemented Packet Trimming feature
Why I did it

Implementation is done according to the Packet Trimming HLD
mssonicbld added a commit to mssonicbld/sonic-swss that referenced this pull request Jun 28, 2025
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

<!--
Please make sure you have read and understood the contribution guildlines:
https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

1. Make sure your commit includes a signature generted with `git commit -s`
2. Make sure your commit title follows the correct format: [component]: description
3. Make sure your commit message contains enough details about the change and related tests
4. Make sure your pull request adds related reviewers, asignees, labels

Please also provide the following information in this pull request:
-->

**DEPENDS:**
1. sonic-net/sonic-swss-common#1001
2. sonic-net/sonic-sairedis#1575
3. sonic-net/sonic-sairedis#1598

**HLD:** sonic-net/SONiC#1898

**What I did**
* Implemented Packet Trimming feature

**Why I did it**
* Implementation is done according to the Packet Trimming 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 added a commit to sonic-net/sonic-swss that referenced this pull request Jun 28, 2025
Signed-off-by: Nazarii Hnydyn <nazariig@nvidia.com>

<!--
Please make sure you have read and understood the contribution guildlines:
https://github.com/Azure/SONiC/blob/gh-pages/CONTRIBUTING.md

1. Make sure your commit includes a signature generted with `git commit -s`
2. Make sure your commit title follows the correct format: [component]: description
3. Make sure your commit message contains enough details about the change and related tests
4. Make sure your pull request adds related reviewers, asignees, labels

Please also provide the following information in this pull request:
-->

**DEPENDS:**
1. sonic-net/sonic-swss-common#1001
2. sonic-net/sonic-sairedis#1575
3. sonic-net/sonic-sairedis#1598

**HLD:** sonic-net/SONiC#1898

**What I did**
* Implemented Packet Trimming feature

**Why I did it**
* Implementation is done according to the Packet Trimming 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====
 '//||\\`
 ''``
```
Janetxxx pushed a commit to Janetxxx/sonic-swss that referenced this pull request Nov 10, 2025
* [trim]: Add Packet Trimming to OA
DEPENDS:

[trim]: Add Packet Trimming DB schema sonic-swss-common#1001
[trim]: Add Packet Trimming to VS lib sonic-sairedis#1575
[trim]: Add Packet Trimming Port/Queue stats to VS lib sonic-sairedis#1598
HLD: sonic-net/SONiC#1898

What I did

Implemented Packet Trimming feature
Why I did it

Implementation is done according to the Packet Trimming HLD
balanokia pushed a commit to balanokia/sonic-swss that referenced this pull request Nov 17, 2025
* [trim]: Add Packet Trimming to OA
DEPENDS:

[trim]: Add Packet Trimming DB schema sonic-swss-common#1001
[trim]: Add Packet Trimming to VS lib sonic-sairedis#1575
[trim]: Add Packet Trimming Port/Queue stats to VS lib sonic-sairedis#1598
HLD: sonic-net/SONiC#1898

What I did

Implemented Packet Trimming feature
Why I did it

Implementation is done according to the Packet Trimming HLD
theasianpianist pushed a commit to theasianpianist/sonic-swss that referenced this pull request Feb 4, 2026
* [trim]: Add Packet Trimming to OA
DEPENDS:

[trim]: Add Packet Trimming DB schema sonic-swss-common#1001
[trim]: Add Packet Trimming to VS lib sonic-sairedis#1575
[trim]: Add Packet Trimming Port/Queue stats to VS lib sonic-sairedis#1598
HLD: sonic-net/SONiC#1898

What I did

Implemented Packet Trimming feature
Why I did it

Implementation is done according to the Packet Trimming HLD

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 to OA
DEPENDS:

[trim]: Add Packet Trimming DB schema sonic-swss-common#1001
[trim]: Add Packet Trimming to VS lib sonic-sairedis#1575
[trim]: Add Packet Trimming Port/Queue stats to VS lib sonic-sairedis#1598
HLD: sonic-net/SONiC#1898

What I did

Implemented Packet Trimming feature
Why I did it

Implementation is done according to the Packet Trimming HLD

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.