Skip to content

Add meter_type packets when creating blocking scheduler#21436

Merged
StormLiangMS merged 1 commit intosonic-net:masterfrom
rgarofano-arista:fix-shaper-packet-trimming
Jan 19, 2026
Merged

Add meter_type packets when creating blocking scheduler#21436
StormLiangMS merged 1 commit intosonic-net:masterfrom
rgarofano-arista:fix-shaper-packet-trimming

Conversation

@rgarofano-arista
Copy link
Copy Markdown
Contributor

Description of PR

Summary:
Fixes # (issue)

Type of change

  • Bug fix
  • Testbed and Framework(new/improvement)
  • New Test case
    • Skipped for non-supported platforms
  • Test case improvement

Back port request

  • 202205
  • 202305
  • 202311
  • 202405
  • 202411
  • 202412
  • 202505

Approach

What is the motivation for this PR?

Packet trimming tests rely on simulating congestion on an egress queue. For this, the tests are trying to apply a shaper that significantly slows down the amount of packets sent out of the target egress queue per second. We found that this shaper doesn't work on th5 with the current config.

How did you do it?

The solution to this is to add "meter_type" packets when creating the blocking scheduler (shaper).

How did you verify/test it?

Verified via tcpdump that packet transmission rate was slowed down as expected on th5.

Any platform specific information?

This issue was discovered when testing on th5

Supported testbed topology if it's a new test case?

Documentation

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@davidm-arista davidm-arista added Request for msft-202412 Branch Request for 202511 branch Request to backport a change to 202511 branch labels Nov 26, 2025
@rgarofano-arista rgarofano-arista force-pushed the fix-shaper-packet-trimming branch from d840c81 to 96bbcc8 Compare November 26, 2025 21:37
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

Copy link
Copy Markdown
Collaborator

@r12f r12f left a comment

Choose a reason for hiding this comment

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

straight forward fix. lgtm.

@dgsudharsan dgsudharsan requested a review from nazariig December 11, 2025 05:49
@weiguo-nvidia
Copy link
Copy Markdown
Contributor

Hi @rgarofano-arista

I verify this PR on x86_64-nvidia_sn5640-r0 platform, we do not the support the new parameter meter_type with error message "enum value SAI_METER_TYPE_PACKETS is not supported"

Test cmd

sonic-db-cli CONFIG_DB hset "SCHEDULER|SCHEDULER_BLOCK_DATA_PLANE" "type" DWRR "weight" 15 "pir" 1 "meter_type" packets

Error info in syslog

2025 Dec 11 09:31:27.772100 DUT ERR syncd#SDK: [SAI_UTILS.ERR] ./src/mlnx_sai_utils.c[1272]- sai_atribute_value_type_enum_validate: Failed to validate SAI_SCHEDULER_ATTR_METER_TYPE value - enum value SAI_METER_TYPE_PACKETS is not supported
2025 Dec 11 09:31:27.772100 DUT ERR syncd#SDK: [SAI_UTILS.ERR] ./src/mlnx_sai_utils.c[1798]- check_attribs_on_create_without_oid: Failed attributes check
2025 Dec 11 09:31:27.772100 DUT WARNING syncd#SDK: :- sai_serialize_enum: enum value -131069 not found in enum sai_status_t
2025 Dec 11 09:31:27.772100 DUT ERR syncd#SDK: :- sendApiResponse: api SAI_COMMON_API_CREATE failed in syncd mode: -131069
2025 Dec 11 09:31:27.772100 DUT WARNING syncd#SDK: :- sai_serialize_enum: enum value -131069 not found in enum sai_status_t
2025 Dec 11 09:31:27.772135 DUT ERR syncd#SDK: :- processQuadEvent: attr: SAI_SCHEDULER_ATTR_SCHEDULING_TYPE: SAI_SCHEDULING_TYPE_DWRR
2025 Dec 11 09:31:27.772135 DUT ERR syncd#SDK: :- processQuadEvent: attr: SAI_SCHEDULER_ATTR_SCHEDULING_WEIGHT: 15
2025 Dec 11 09:31:27.772144 DUT ERR syncd#SDK: :- processQuadEvent: attr: SAI_SCHEDULER_ATTR_MAX_BANDWIDTH_RATE: 1
2025 Dec 11 09:31:27.772150 DUT ERR syncd#SDK: :- processQuadEvent: attr: SAI_SCHEDULER_ATTR_METER_TYPE: SAI_METER_TYPE_PACKETS

@nazariig
Copy link
Copy Markdown
Contributor

@rgarofano-arista please make this configuration vendor specific in case it is required for your platform

Copy link
Copy Markdown
Collaborator

@r12f r12f left a comment

Choose a reason for hiding this comment

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

looks like meter type is vendor specific.

@sdszhang
Copy link
Copy Markdown
Contributor

@rgarofano-arista can you resolve the conflict?

@rgarofano-arista rgarofano-arista force-pushed the fix-shaper-packet-trimming branch from 96bbcc8 to cb8dad5 Compare December 30, 2025 19:38
@github-actions github-actions bot requested a review from developfast December 30, 2025 19:38
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@rgarofano-arista rgarofano-arista force-pushed the fix-shaper-packet-trimming branch from cb8dad5 to afc14e6 Compare December 30, 2025 19:39
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@rgarofano-arista rgarofano-arista force-pushed the fix-shaper-packet-trimming branch from afc14e6 to 4a7fe24 Compare December 30, 2025 21:47
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

@rgarofano-arista
Copy link
Copy Markdown
Contributor Author

looks like meter type is vendor specific.

I have changed it so that meter_type is only added to the scheduler command for the th5 asic.

@rgarofano-arista rgarofano-arista force-pushed the fix-shaper-packet-trimming branch from 4a7fe24 to 71059ec Compare December 30, 2025 21:53
@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines will not run the associated pipelines, because the pull request was updated after the run command was issued. Review the pull request again and issue a new run command.

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
@prsunny prsunny requested a review from kperumalbfn January 16, 2026 23:04
Copy link
Copy Markdown
Collaborator

@StormLiangMS StormLiangMS left a comment

Choose a reason for hiding this comment

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

LGTM

@StormLiangMS StormLiangMS merged commit cf90103 into sonic-net:master Jan 19, 2026
17 checks passed
@mssonicbld
Copy link
Copy Markdown
Collaborator

@rgarofano-arista PR conflicts with 202511 branch

@rgarofano-arista
Copy link
Copy Markdown
Contributor Author

Manual cherry-pick to 202511 #22071

PriyanshTratiya pushed a commit to PriyanshTratiya/sonic-mgmt that referenced this pull request Jan 21, 2026
)

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
Signed-off-by: Priyansh Tratiya <[email protected]>
saravanan-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Jan 22, 2026
)

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
Signed-off-by: Saravanan Sellappa <[email protected]>
justin-oliver pushed a commit to justin-oliver/sonic-mgmt that referenced this pull request Jan 26, 2026
)

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
@Pterosaur
Copy link
Copy Markdown
Contributor

Hi @r12f , could you please approve the PR request to 202412?

@StormLiangMS
Copy link
Copy Markdown
Collaborator

@rgarofano-arista could you to submit PR to 202511 and 202412 since cherrypick conflict?

@rgarofano-arista
Copy link
Copy Markdown
Contributor Author

Manual cherry-pick to 202511 #22071

I already have a PR for 202511 (linked in quoted reply)
I created one for 202412: Azure/sonic-mgmt.msft#980

ytzur1 pushed a commit to ytzur1/sonic-mgmt that referenced this pull request Feb 2, 2026
)

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
Signed-off-by: Yael Tzur <[email protected]>
abhishek-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Feb 6, 2026
)

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
Anirudh-nokia pushed a commit to Anirudh-nokia/sonic-mgmt-fork that referenced this pull request Feb 6, 2026
)

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
Signed-off-by: ayya <[email protected]>
nnelluri-cisco pushed a commit to nnelluri-cisco/sonic-mgmt that referenced this pull request Feb 12, 2026
)

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
Signed-off-by: nnelluri-cisco <[email protected]>
rraghav-cisco pushed a commit to rraghav-cisco/sonic-mgmt that referenced this pull request Feb 13, 2026
)

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
Signed-off-by: Raghavendran Ramanathan <[email protected]>
anilal-amd pushed a commit to anilal-amd/anilal-forked-sonic-mgmt that referenced this pull request Feb 19, 2026
)

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
Signed-off-by: Zhuohui Tan <[email protected]>
kazinator-arista pushed a commit to kazinator-arista/sonic-mgmt that referenced this pull request Mar 4, 2026
…atically (sonic-net#21436)

[submodule] Update submodule sonic-utilities to the latest HEAD automatically
abhishek-nexthop pushed a commit to nexthop-ai/sonic-mgmt that referenced this pull request Mar 17, 2026
)

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
Signed-off-by: Abhishek <[email protected]>
Pterosaur pushed a commit to Pterosaur/sonic-mgmt that referenced this pull request Mar 26, 2026
)

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
Pterosaur added a commit to Pterosaur/sonic-mgmt that referenced this pull request Mar 26, 2026
Pterosaur pushed a commit to Pterosaur/sonic-mgmt that referenced this pull request Mar 26, 2026
)

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
Signed-off-by: Ze Gan <[email protected]>
venu-nexthop pushed a commit to venu-nexthop/sonic-mgmt that referenced this pull request Mar 27, 2026
)

meter_type is platform specific, so the inclusion of it is only
implemented for Broadcom TH5 chip right now. Other chips in the future
that require it will need to modify the code.

Signed-off-by: Ryan Garofano <[email protected]>
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.