Skip to content

[orchagent] WRED queue counters not exposed on UNICAST_VOQ — VOQ OIDs not registered, and ECN_MARKED stats abort the bulk read on VOQ #4544

@arawat-nexthop

Description

@arawat-nexthop

Description (updated after upstream code analysis)

show queue wredcounters --voq returns no useful data on
VOQ-chassis platforms. Two distinct gaps in upstream SwSS combine
to cause this:

Gap 1: VOQ OIDs are never registered for WRED stats

PortsOrch::addWredQueueFlexCounters only iterates
port.m_queue_ids (egress queue OIDs) and never registers
per-port VOQ OIDs (m_port_voq_ids) with the WRED flex counter
group. So VOQ rows have nothing to display, even on platforms
whose SAI fully supports WRED counters at the VOQ object.

Gap 2: A naive VOQ-OID registration trips on ECN_MARKED stats

The shared 4-stat list registered today contains both:

  • SAI_QUEUE_STAT_WRED_DROPPED_PACKETS / _BYTES
  • SAI_QUEUE_STAT_WRED_ECN_MARKED_PACKETS / _BYTES

SAI_QUEUE_STAT_WRED_ECN_MARKED_* describes packets transmitted
with the CE bit set — an egress-side action. On a queue of type
SAI_QUEUE_TYPE_UNICAST_VOQ this counter is not architecturally
exposed; ECN marking on VOQ-chassis platforms is reported at the
egress queue object, not at the ingress VOQ.

When a SAI implementation 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. Any
fix for Gap 1 that re-uses the existing 4-stat list will therefore
result in N/A across all four columns instead of working
WRED-drop counters.

So fixing Gap 1 alone is not enough — the registration must also
be split per queue type so that VOQ OIDs only get the
WRED_DROPPED_* stats.

Steps to reproduce

  1. Bring up SONiC on a VOQ-chassis platform (linecard).
  2. Apply a WRED profile to a queue (e.g. lossless egress queue).
  3. Run show queue wredcounters --voq.
  4. Observe: VOQ rows print blanks/N/A because no WRED stats are
    ever registered against the VOQ OIDs.

If a downstream branch adds VOQ OID registration on top of the
existing single 4-stat list, step 4 instead shows N/A in all
four columns due to Gap 2.

Expected after fix

  • show queue wredcounters --voq shows numeric values (initially
    0) for WredDrp/pkts and WredDrp/bytes on each VOQ row.
  • EcnMarked/* columns show N/A for VOQ rows (the counter is
    not valid on a VOQ object).
  • show queue wredcounters (egress) is unchanged on all
    platforms.

Possible fix shapes

  1. Register VOQ OIDs + split the stat list per queue type.

    • Wire m_port_voq_ids into the WRED flex counter group when
      gMySwitchType == \"voq\".
    • Maintain two stat lists in PortsOrch — one for egress queues
      (all 4) and one for VOQ queues (only WRED_DROPPED_*) — and
      pick the right one based on the existing voq flag in
      addWredQueueFlexCountersPerPortPerQueueIndex.

    Smallest change; matches current SAI semantics.
    PR [orchagent] WRED queue counters on VOQ-chassis platforms: split stat list + register on VOQ OIDs #4545 implements this.

Affected releases

  • Gap 1 (no VOQ registration): present since the WRED flex counter
    group was added.
  • Gap 2 (ECN_MARKED on VOQ aborts the bulk): present since
    WRED_ECN_MARKED_* was added to wred_queue_stat_ids
    (202405 onwards).

Metadata

Metadata

Type

No type
No fields configured for issues without a type.

Projects

No projects

Milestone

No milestone

Relationships

None yet

Development

No branches or pull requests

Issue actions