Skip to content

[code sync] Merge code from sonic-net/sonic-swss:202511 to 202601#243

Merged
mssonicbld merged 2 commits into
Azure:202601from
mssonicbld:sonicbld/202601-merge
Jun 23, 2026
Merged

[code sync] Merge code from sonic-net/sonic-swss:202511 to 202601#243
mssonicbld merged 2 commits into
Azure:202601from
mssonicbld:sonicbld/202601-merge

Conversation

@mssonicbld

Copy link
Copy Markdown
Collaborator
* f2320615 - (origin/202511) [orchagent] WRED queue counters on VOQ-chassis platforms: split stat list + register on VOQ OIDs (#4683) (2026-06-23) [mssonicbld]<br>```

mssonicbld and others added 2 commits June 23, 2026 05:13
…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>
@mssonicbld mssonicbld requested a review from abdosi as a code owner June 23, 2026 03:03
@mssonicbld mssonicbld merged commit 23f1b6d into Azure:202601 Jun 23, 2026
5 checks passed
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.

1 participant