Skip to content

[HLD][QoS] WRED and ECN statistics: VOQ-chassis support#2428

Merged
vmittal-msft merged 3 commits into
sonic-net:masterfrom
nexthop-ai:arawat/wred-voq-hld-upstream
Jul 9, 2026
Merged

[HLD][QoS] WRED and ECN statistics: VOQ-chassis support#2428
vmittal-msft merged 3 commits into
sonic-net:masterfrom
nexthop-ai:arawat/wred-voq-hld-upstream

Conversation

@arawat-nexthop

Copy link
Copy Markdown
Contributor

What

Update doc/qos/ECN_and_WRED_statistics_HLD.md to describe how the
WRED and ECN statistics feature behaves on VOQ-chassis platforms.

Why

The original HLD (0.1, Feb 2023) predates broad VOQ-chassis support
and describes a single 4-stat WRED queue stat list registered
uniformly against every queue OID. On VOQ-chassis platforms this
causes two problems:

  1. WRED drops are exposed only at the ingress VOQ object
    (SAI_QUEUE_TYPE_UNICAST_VOQ), not the egress queue object.
    Without per-VOQ registration, WRED drop counters never reach
    COUNTERS_DB and show queue wredcounters --voq returns nothing
    useful.
  2. SAI_QUEUE_STAT_WRED_ECN_MARKED_* describes packets transmitted
    with the CE bit set — an egress-side action — and is not
    architecturally exposed on a VOQ object. Registering the ECN-
    marked stat IDs against a VOQ object causes the SAI bulk
    getStats call to return SAI_STATUS_NOT_SUPPORTED and
    FlexCounter aborts the whole bulk, so even the WRED-drop stats
    that are valid on a VOQ never reach COUNTERS_DB.

The code change to close both gaps landed in
sonic-net/sonic-swss#4545 (issue
sonic-net/sonic-swss#4544). This HLD
update brings the design document into line with the code.

Changes in this PR

  • Revision row 0.2 added.
  • FLEX_COUNTER_DB: register a per-queue-type WRED stat list —
    egress queues get all 4 stats; VOQ objects get only
    WRED_DROPPED_*.
  • COUNTERS_DB: document additional per-VOQ counter entries on
    VOQ-chassis platforms.
  • Orchagent: describe the additional VOQ registration when
    switch_type == voq, and note that VOQ-object counters are
    always enabled on VOQ-chassis platforms.
  • CLI: mention show queue wredcounters --voq [interface-name]
    in the list of new commands and add a "CLI output on a VOQ-
    chassis platform" subsection with example output.

Diff

+46 / -7 in doc/qos/ECN_and_WRED_statistics_HLD.md.

Refs

Update the WRED/ECN statistics HLD to describe VOQ-chassis handling.
The corresponding code change landed in sonic-net/sonic-swss#4545.

- Revision row 0.2 added.
- FLEX_COUNTER_DB: register a per-queue-type WRED stat list. Egress
  queues (SAI_QUEUE_TYPE_UNICAST/MULTICAST/ALL) register all 4
  stats (drops + ECN-marked). VOQ objects (UNICAST_VOQ) register
  only WRED_DROPPED_*, since WRED_ECN_MARKED_* describes an
  egress-side action and is not exposed on the ingress VOQ.
- COUNTERS_DB: document the additional per-VOQ entries on VOQ-
  chassis platforms.
- Orchagent: describe the additional VOQ registration when the
  switch type is `voq`, and note that VOQ-object counters are
  always enabled on VOQ-chassis (no per-queue counter-enabled
  gating).
- CLI: add `show queue wredcounters --voq [interface-name]` to the
  list of new commands and add a "CLI output on a VOQ-chassis
  platform" example showing WRED-drop rows and N/A in the EcnMarked
  columns.

Refs: sonic-net/sonic-swss#4544,
      sonic-net/sonic-swss#4545
Signed-off-by: arawat <arawat@nexthop.ai>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@pinky-nexthop

Copy link
Copy Markdown

@vmittal-msft @abdosi @prsunny Kindly review this updated HLD for wred stats for VOQ systems.

Copilot AI left a comment

Copy link
Copy Markdown

Choose a reason for hiding this comment

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

Pull request overview

Updates the existing QoS HLD (doc/qos/ECN_and_WRED_statistics_HLD.md) to accurately describe WRED/ECN statistics behavior on VOQ-chassis platforms, aligning the design document with the already-merged implementation behavior.

Changes:

  • Adds a new revision entry and documents VOQ-chassis-specific behavior/constraints for ECN-marked vs WRED-dropped queue stats.
  • Clarifies FLEX_COUNTER_DB registration to be queue-type specific (egress queues vs VOQ objects).
  • Expands COUNTERS_DB and CLI sections with VOQ-object counters and an example show queue wredcounters --voq output section.

Comment thread doc/qos/ECN_and_WRED_statistics_HLD.md Outdated
Comment thread doc/qos/ECN_and_WRED_statistics_HLD.md
vmittal-msft
vmittal-msft previously approved these changes Jul 1, 2026
Comment thread doc/qos/ECN_and_WRED_statistics_HLD.md
- Fix Table of Contents anchor case for the "WRED and ECN queue
  statistics supported platform" section. GitHub-generated heading
  IDs are all-lowercase; the fragment used an uppercase `-ECN-`
  which did not resolve. (Copilot review comment.)
- Extend the "CLI output on a VOQ-chassis platform" subsection with
  a `show queue wredcounters` (no --voq) example. On VOQ-chassis
  the two views are complementary: the egress-queue view shows
  ECN-marked packets, and the --voq view shows WRED drops. Show
  both. (vmittal-msft review comment.)
- Document `sonic-clear queue wredcounters --voq` alongside the
  new `--voq` show variant. This is the counterpart clear command
  landed in sonic-net/sonic-utilities#4662. (venky-nexthop review
  comment.)

Signed-off-by: arawat <arawat@nexthop.ai>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

Follow-up to the review round: add a "Clear CLI output on a
VOQ-chassis platform" subsection under CLI Changes that shows
example output from both `sonic-clear queue wredcounters` and its
`--voq` variant. Matches the pattern of the existing "CLI output
on ..." subsections (which so far only covered show commands) and
mirrors the two show forms already documented for VOQ chassis.

The `--voq` variant of `sonic-clear queue wredcounters` is added
in sonic-net/sonic-utilities#4662.

Also add the matching Table-of-Contents entry.

Signed-off-by: arawat <arawat@nexthop.ai>
@mssonicbld

Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines

Copy link
Copy Markdown
No pipelines are associated with this pull request.

@vmittal-msft

Copy link
Copy Markdown
Contributor

@vmittal-msft
vmittal-msft merged commit db2dd4e into sonic-net:master Jul 9, 2026
2 checks passed
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Labels

None yet

Projects

None yet

Development

Successfully merging this pull request may close these issues.

6 participants