[code sync] Merge code from sonic-net/sonic-swss:202511 to 202601#243
Merged
Conversation
mssonicbld
commented
Jun 23, 2026
Collaborator
…list + register on VOQ OIDs (#4683) ## What Two-commit change that brings working `show queue wredcounters --voq` to VOQ-chassis platforms in upstream SwSS: 1. **`5828407` — Split the WRED stat list per queue type.** Add `wred_voq_stat_ids` (only `WRED_DROPPED_*`) alongside the existing `wred_queue_stat_ids` (all 4). Pick the right list at registration time using the existing `voq` parameter on `addWredQueueFlexCountersPerPortPerQueueIndex`. 2. **`ec1a94a` — Register WRED flex counters on VOQ OIDs.** Extend `addWredQueueFlexCountersPerPort` with a `voq` flag and, from `addWredQueueFlexCounters`, additionally call it with `voq=true` when `gMySwitchType == \"voq\"`. Bypass the per-queue counter-enabled gating for VOQ (those are always on for VOQ systems). ## Why Stock upstream SwSS has two gaps that together prevent VOQ-chassis users from seeing per-VOQ WRED drop visibility: - **Gap 1: VOQ OIDs are never registered for WRED stats.** `addWredQueueFlexCounters` only iterates `port.m_queue_ids` (egress); `m_port_voq_ids` are not wired into the WRED flex counter group. So `show queue wredcounters --voq` has no data even on platforms whose SAI fully supports VOQ WRED counters. - **Gap 2: A naive VOQ-OID registration trips on `WRED_ECN_MARKED_*`.** That counter describes packets transmitted with the CE bit set — an egress-side action — and is not architecturally exposed on `SAI_QUEUE_TYPE_UNICAST_VOQ` queues. When SAI is asked for an unsupported stat as part of a bulk read it typically returns `SAI_STATUS_NOT_SUPPORTED`, which makes FlexCounter abort the entire bulk for that queue. Result: even the WRED-drop counters that *are* valid on a VOQ never reach the COUNTERS table, and rows show as N/A. This PR closes both gaps. Detail in sonic-net/sonic-swss#4544. ## How Two commits, separated for review clarity. Either could in principle land independently — but only the combination delivers working VOQ WRED counters. Splitting them keeps the defensive correctness (commit 1) reviewable in isolation from the new registration call site (commit 2). No changes to: - header signatures of `addWredQueueFlexCountersPerPortPerQueueIndex` (signature already had the `voq` param upstream) - the WRED port counter path - the egress queue WRED counter path `addWredQueueFlexCountersPerPort` gains a defaulted `bool voq = false` in the header so existing call sites are source-compatible. ## How to verify On a VOQ-chassis platform with this PR: ``` admin@<chassis-lc>:~$ show queue wredcounters --voq | head -10 Port Voq WredDrp/pkts WredDrp/bytes EcnMarked/pkts EcnMarked/bytes ------------------------- ----- -------------- --------------- ---------------- ----------------- <host>|<asic>|EthernetX VOQ0 0 0 N/A N/A <host>|<asic>|EthernetX VOQ1 0 0 N/A N/A <host>|<asic>|EthernetX VOQ2 0 0 N/A N/A <host>|<asic>|EthernetX VOQ3 0 0 N/A N/A ... ``` Drive WRED-drop traffic on a VOQ and `WredDrp/pkts` and `WredDrp/bytes` increment numerically; `EcnMarked/*` stays N/A (those are exposed on the egress queue, not the VOQ). `show queue wredcounters` (egress) is unchanged on all platforms. No new SAI errors on the bulk WRED `getStats` path for VOQ OIDs. ## Which release branch to backport/forwardport - [ ] 201811 - [ ] 201911 - [ ] 202006 - [ ] 202012 - [ ] 202106 - [ ] 202111 - [ ] 202205 - [ ] 202211 - [ ] 202305 - [ ] 202311 - [ ] 202405 - [ ] 202411 - [ ] 202505 - [ ] 202511 Signed-off-by: Sonic Build Admin <sonicbld@microsoft.com>
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.