Skip to content

Support packet trimming#1457

Open
sallylsy wants to merge 2 commits intoopenconfig:masterfrom
sallylsy:pkt_trim_0324
Open

Support packet trimming#1457
sallylsy wants to merge 2 commits intoopenconfig:masterfrom
sallylsy:pkt_trim_0324

Conversation

@sallylsy
Copy link
Copy Markdown
Contributor

@sallylsy sallylsy commented Mar 25, 2026

Change Scope

  • Add parameters to support packet trimming.
  • This change is backwards compatible.

Platform Implementations

Tree View

 module: openconfig-qos
   +--rw qos
      +--rw classifiers
      |  +--rw classifier* [name]
      |     +--rw name      -> ../config/name
      |     +--rw config
      |     |  +--rw name?   string
      |     |  +--rw type?   enumeration
      |     +--ro state
      |     |  +--ro name?   string
      |     |  +--ro type?   enumeration
      |     +--rw terms
      |        +--rw term* [id]
      |           +--rw id            -> ../config/id
      |           +--rw config
      |           |  +--rw id?   string
      |           +--ro state
      |           |  +--ro id?   string
      |           +--rw conditions
      |           |  +--rw l2
      |           |  |  +--rw config
      |           |  |  |  +--rw source-mac?             oc-yang:mac-address
      |           |  |  |  +--rw source-mac-mask?        oc-yang:mac-address
      |           |  |  |  +--rw destination-mac?        oc-yang:mac-address
      |           |  |  |  +--rw destination-mac-mask?   oc-yang:mac-address
      |           |  |  |  +--rw ethertype?              oc-pkt-match-types:ethertype-type
      |           |  |  +--ro state
      |           |  |     +--ro source-mac?             oc-yang:mac-address
      |           |  |     +--ro source-mac-mask?        oc-yang:mac-address
      |           |  |     +--ro destination-mac?        oc-yang:mac-address
      |           |  |     +--ro destination-mac-mask?   oc-yang:mac-address
      |           |  |     +--ro ethertype?              oc-pkt-match-types:ethertype-type
+     |           |  +--rw fabric
+     |           |     +--rw config
+     |           |     |  +--rw fabric-priority?   uint8
+     |           |     +--ro state
+     |           |        +--ro fabric-priority?   uint8
      |           +--rw actions
      |              +--rw config
      |              |  +--rw target-group?   -> ../../../../../../../forwarding-groups/forwarding-group/config/name
      |              +--ro state
      |              |  +--ro target-group?   -> ../../../../../../../forwarding-groups/forwarding-group/config/name
      |              +--rw remark
      |                 +--rw config
      |                 |  +--rw set-dscp?      uint8
      |                 |  +--rw set-dot1p?     uint8
      |                 |  +--rw set-mpls-tc?   uint8
      |                 +--ro state
      |                    +--ro set-dscp?      uint8
      |                    +--ro set-dot1p?     uint8
      |                    +--ro set-mpls-tc?   uint8
      +--rw buffer-allocation-profiles
      |  +--rw buffer-allocation-profile* [name]
      |     +--rw name      -> ../config/name
      |     +--rw config
      |     |  +--rw name?   string
      |     +--ro state
      |     |  +--ro name?   string
      |     +--rw queues
      |        +--rw queue* [name]
      |           +--rw name      -> ../config/name
      |           +--rw config
      |           |  +--rw name?                                  -> ../../../../../../queues/queue/config/name
      |           |  +--rw dedicated-buffer?                      uint64
      |           |  +--rw dedicated-buffer-temporal?             uint64
      |           |  +--rw use-shared-buffer?                     boolean
      |           |  +--rw shared-buffer-limit-type?              identityref
      |           |  +--rw static-shared-buffer-limit?            uint32
      |           |  +--rw static-shared-buffer-limit-temporal?   uint32
      |           |  +--rw dynamic-limit-scaling-factor?          int32
+     |           |  +--rw ro trim-enable?                        boolean
      |           +--ro state
      |              +--ro name?                                  -> ../../../../../../queues/queue/config/name
      |              +--ro dedicated-buffer?                      uint64
      |              +--ro dedicated-buffer-temporal?             uint64
      |              +--ro use-shared-buffer?                     boolean
      |              +--ro shared-buffer-limit-type?              identityref
      |              +--ro static-shared-buffer-limit?            uint32
      |              +--ro static-shared-buffer-limit-temporal?   uint32
      |              +--ro dynamic-limit-scaling-factor?          int32
+     |              +--ro ro trim-enable?                        boolean
+     +--rw packet-trim
+        |  +--rw symmetric-dscp?   uint8
+        |  +--rw fabric-priority?  uint8
+        +--rw state
+           +--rw symmetric-dscp?   uint8
+           +--rw fabric-priority?  uint8

@gemini-code-assist
Copy link
Copy Markdown

Summary of Changes

Hello, I'm Gemini Code Assist1! I'm currently reviewing this pull request and will post my feedback shortly. In the meantime, here's a summary to help you and other reviewers quickly get up to speed!

This pull request enhances the QoS YANG model by introducing comprehensive support for packet trimming and fabric priority configuration. The primary goal is to provide network operators with more flexible and nuanced control over packet handling, particularly in congestion scenarios, by allowing packets to be trimmed rather than fully dropped. This also includes the ability to define internal fabric priorities for traffic management.

Highlights

  • Packet Trimming Support: Added new YANG parameters to support packet trimming functionality, allowing network devices to truncate packet payloads while preserving headers for diagnostic purposes instead of a full drop.
  • Fabric Priority Configuration: Introduced new configuration options for defining fabric priority within QoS classifier terms, enabling more granular control over internal switching fabric traffic.
  • Backwards Compatibility: The changes are designed to be backwards compatible, ensuring existing configurations and systems will continue to function without disruption.
Using Gemini Code Assist

The full guide for Gemini Code Assist can be found on our documentation page, here are some quick tips.

Invoking Gemini

You can request assistance from Gemini at any point by creating a comment using either /gemini <command> or @gemini-code-assist <command>. Below is a summary of the supported commands on the current page.

Feature Command Description
Code Review /gemini review Performs a code review for the current pull request in its current state.
Pull Request Summary /gemini summary Provides a summary of the current pull request in its current state.
Comment @gemini-code-assist Responds in comments when explicitly tagged, both in pull request comments and review comments.
Help /gemini help Displays a list of available commands.

Customization

To customize Gemini Code Assist for GitHub experience, repository maintainers can create a configuration file and/or provide a custom code review style guide (such as PEP-8 for Python) by creating and adding files to a .gemini/ folder in the base of the repository. Detailed instructions can be found here.

Limitations & Feedback

Gemini Code Assist may make mistakes. Please leave feedback on any instances where its feedback is incorrect or counter productive. You can react with 👍 and 👎 on @gemini-code-assist comments. If you're interested in giving your feedback about your experience with Gemini Code Assist for GitHub and other Google products, sign up here.

Footnotes

  1. Review the Privacy Notices, Generative AI Prohibited Use Policy, Terms of Service, and learn how to configure Gemini Code Assist in GitHub here. Gemini can make mistakes, so double check it and use code with caution.

Copy link
Copy Markdown

@gemini-code-assist gemini-code-assist bot left a comment

Choose a reason for hiding this comment

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

Code Review

This pull request introduces new YANG models for configuring fabric parameters, packet discard actions (DROP/TRIM), and switch-level packet trimming. Specifically, it adds fabric-params-top and fabric-params-config to define fabric priority, integrates these into QoS match fields, and introduces packet-discard-action in QoS memory management. Additionally, qos-packet-trim-top and packet-trim-config are added to define symmetric DSCP and traffic class for trimmed packets, which are then integrated into the main QoS model. The review comments point out minor typos in the descriptions for fabric parameters and suggest clarifying the definition of 'symmetric packet' for better understanding.

Comment thread release/models/acl/openconfig-packet-match.yang Outdated
Comment thread release/models/acl/openconfig-packet-match.yang Outdated
Comment thread release/models/qos/openconfig-qos.yang Outdated
@dplore
Copy link
Copy Markdown
Member

dplore commented Mar 25, 2026

/gcbrun

@OpenConfigBot
Copy link
Copy Markdown

OpenConfigBot commented Mar 25, 2026

No major YANG version changes in commit b3cc3ed

@dplore dplore moved this to Ready to discuss in OC Operator Review Mar 25, 2026
@dplore
Copy link
Copy Markdown
Member

dplore commented Mar 25, 2026

Will review in March 31, 2026 OC Operator meeting

Comment thread release/models/qos/openconfig-qos-mem-mgmt.yang Outdated
@ElodinLaarz
Copy link
Copy Markdown
Contributor

/gcbrun

@ElodinLaarz
Copy link
Copy Markdown
Contributor

Reviewed at OC Operators Meeting March 31, 2026:

We discussed whether it made sense to use the ENUM or whether it makes sense to enable / disable packet trimming as a boolean.

If we have an expectation of adding more ENUM values for discard actions, perhaps it makes sense to use one, but for now simplifying it to use a boolean seems preferred.

Implementation references seem good; so, no objections to adding it to the model in some way.

Comment thread release/models/qos/openconfig-qos.yang Outdated
@sallylsy
Copy link
Copy Markdown
Contributor Author

sallylsy commented Apr 1, 2026

packet-discard-action type is changed to boolean as discussed

Comment thread release/models/qos/openconfig-qos-mem-mgmt.yang Outdated
@ElodinLaarz
Copy link
Copy Markdown
Contributor

/gcbrun

1 similar comment
@ElodinLaarz
Copy link
Copy Markdown
Contributor

/gcbrun

Comment thread release/models/qos/openconfig-qos-mem-mgmt.yang Outdated
@ElodinLaarz
Copy link
Copy Markdown
Contributor

Reviewed at the OC Operators Meeting April 14th, 2026:

One other thing we could consider adding from reading the implementations is a leaf for configuring the size of the trimmed packet in bytes, but if you don't have a use case for it to start with, it's not necessary.

Seems good-- we should get a SME to approve the request, but the OC seems fine.

@ElodinLaarz
Copy link
Copy Markdown
Contributor

/gcbrun

@sallylsy
Copy link
Copy Markdown
Contributor Author

Reviewed at the OC Operators Meeting April 14th, 2026:

One other thing we could consider adding from reading the implementations is a leaf for configuring the size of the trimmed packet in bytes, but if you don't have a use case for it to start with, it's not necessary.

Seems good-- we should get a SME to approve the request, but the OC seems fine.

Thanks for the review. Currently we do not have use case for trimming size use case.

@dplore
Copy link
Copy Markdown
Member

dplore commented Apr 15, 2026

/gcbrun

@earies
Copy link
Copy Markdown
Contributor

earies commented Apr 15, 2026

We're in the midst of compilng a few comments on our end and will revert back shortly - possibly worth discussion in the next OC community call

Copy link
Copy Markdown
Member

@dplore dplore left a comment

Choose a reason for hiding this comment

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

minor comment on submodule version reference

Comment thread release/models/qos/openconfig-qos-interfaces.yang
@dplore
Copy link
Copy Markdown
Member

dplore commented Apr 16, 2026

/gcbrun

Copy link
Copy Markdown
Member

@dplore dplore left a comment

Choose a reason for hiding this comment

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

LGTM, setting last call for April 29, 2026.

@dplore dplore moved this from Ready to discuss to last-call in OC Operator Review Apr 16, 2026
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: last-call

Development

Successfully merging this pull request may close these issues.

7 participants