Skip to content

[qosorch] Support independent WRED ECN marking thresholds (mark before drop) #4718

Description

@AnantKishorSharma

Gap

A WRED_PROFILE exposes only the WRED drop thresholds per color; ECN marking reuses those same thresholds. There is no way to ECN-mark at a lower queue depth than where WRED starts dropping — i.e. no "mark before drop" knee, a common ECN/DCQCN tuning need.

Current behaviour

WRED_PROFILE has ecn, {green,yellow,red}_{min,max}_threshold, {green,yellow,red}_drop_probability, wred_*_enable. ECN marking follows the drop thresholds; the marking knee cannot be set independently.

SAI support

  • SAI_WRED_ATTR_ECN_{GREEN,YELLOW,RED}_{MIN,MAX}_THRESHOLD
  • SAI_WRED_ATTR_ECN_{GREEN,YELLOW,RED}_MARK_PROBABILITY
  • SAI_SWITCH_ATTR_ECN_ECT_THRESHOLD_ENABLE (gates whether ECT traffic honours the independent ECN thresholds vs the WRED drop thresholds)

Proposed solution

Add optional WRED_PROFILE fields ecn_{green,yellow,red}_{min,max}_threshold and ecn_{green,yellow,red}_mark_probability, program the matching SAI_WRED_ATTR_ECN_* attributes in qosorch, and enable SAI_SWITCH_ATTR_ECN_ECT_THRESHOLD_ENABLE when configured. Fields are optional → existing profiles unaffected (backward compatible); programming is capability-driven and best-effort → unsupported platforms keep current behaviour.

Components

  • sonic-net/sonic-swss — qosorch (WredMapHandler)
  • sonic-net/sonic-buildimagesonic-wred-profile YANG + tests

Validated on a Broadcom Tomahawk5 (TH5) testbed (ECN marking curve programmed below the WRED drop curve in the ASIC).

Metadata

Metadata

Assignees

No one assigned

    Labels

    No labels
    No labels

    Type

    No type

    Projects

    No projects

    Milestone

    No milestone

    Relationships

    None yet

    Development

    No branches or pull requests

    Issue actions