Skip to content

Support packet trimming#1457

Open
sallylsy wants to merge 1 commit intoopenconfig:masterfrom
sallylsy:pkt_trim_0324
Open

Support packet trimming#1457
sallylsy wants to merge 1 commit 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 packet-discard-action?                 enumeration
      |           +--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 packet-discard-action?                 enumeration
+     +--rw packet-trim
+        |  +--rw symmetric-dscp?   uint8
+        |  +--rw traffic-class?    uint8
+        +--rw state
+           +--rw symmetric-dscp?   uint8
+           +--rw traffic-class?    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.

@dplore
Copy link
Copy Markdown
Member

dplore commented Mar 25, 2026

/gcbrun

@OpenConfigBot
Copy link
Copy Markdown

No major YANG version changes in commit 9e05571

@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

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

Status: Ready to discuss

Development

Successfully merging this pull request may close these issues.

3 participants