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

Packet Trimming HLD #1898

Open
wants to merge 2 commits into
base: master
Choose a base branch
from
Open

Conversation

nazariig
Copy link
Collaborator

Signed-off-by: Nazarii Hnydyn [email protected]

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 <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

doc/packet_trimming/packet-trimming-design.md Outdated Show resolved Hide resolved
doc/packet_trimming/packet-trimming-design.md Show resolved Hide resolved
doc/packet_trimming/packet-trimming-design.md Show resolved Hide resolved
doc/packet_trimming/packet-trimming-design.md Outdated Show resolved Hide resolved
| Switch trimming update: error | ERROR |
| Buffer profile trimming update: success | NOTICE |
| Buffer profile trimming update: error | ERROR |

Copy link
Collaborator

@adyeung adyeung Feb 5, 2025

Choose a reason for hiding this comment

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

Can you define the scope of the support and/or notable constraints? Eg,

  1. Is trimming support expected for both IPv4 and IPv6?

  2. Does it support IP multicast frames? Would trimmed pkts be replicated and reach all receivers for retransmission request?

  3. What if the pkt to trim is destined for local tunnel decapsulation? Would it trim from the original frame or decapsulated frame?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@adyeung the quick answer: all these things are vendor specific behavior. The current plan is not to extend the scope section. It has nothing to do with a trimming configuration. For the first question the answer is yes. Both IPv4/IPv6 supports trimming.

key = SWITCH_TRIMMING|GLOBAL ; switch trimming global. Must be unique

; field = value
size = 1*10DIGIT ; size (in bytes) to trim eligible packet
Copy link
Contributor

Choose a reason for hiding this comment

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

Should size be restricted to 4DIGIT similar to mtu?

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@pavannaregundi the YANG model implementation is according to SAI API.
We do not want explicitly to add any limitations here.

https://github.com/opencomputeproject/SAI/blob/master/inc/saiswitch.h#L3158
SAI API:

    /**
     * @brief Trim packets to this size to reduce bandwidth
     *
     * @type sai_uint32_t
     * @flags CREATE_AND_SET
     * @default 128
     */
    SAI_SWITCH_ATTR_PACKET_TRIM_SIZE,

doc/packet_trimming/packet-trimming-design.md Outdated Show resolved Hide resolved

leaf size {
description "Size (in bytes) to trim eligible packet";
type uint32;
Copy link
Contributor

Choose a reason for hiding this comment

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

Should size be same as MTU?
type uint16 {
range 68..9216;
}

Copy link
Collaborator Author

Choose a reason for hiding this comment

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

@pavannaregundi the YANG model implementation is according to SAI API.
We do not want explicitly to add any limitations here.

https://github.com/opencomputeproject/SAI/blob/master/inc/saiswitch.h#L3158
SAI API:

    /**
     * @brief Trim packets to this size to reduce bandwidth
     *
     * @type sai_uint32_t
     * @flags CREATE_AND_SET
     * @default 128
     */
    SAI_SWITCH_ATTR_PACKET_TRIM_SIZE,

Signed-off-by: Nazarii Hnydyn <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

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