Skip to content

[portsorch] fix crash when number of PGs returned 0#3966

Merged
prsunny merged 2 commits intosonic-net:masterfrom
stepanblyschak:fix-no-pgs
Nov 17, 2025
Merged

[portsorch] fix crash when number of PGs returned 0#3966
prsunny merged 2 commits intosonic-net:masterfrom
stepanblyschak:fix-no-pgs

Conversation

@stepanblyschak
Copy link
Copy Markdown
Contributor

What I did

Fix issue reported in #3961.
Regression happened after move to bulk implementation. The error handling of no PGs, queues was incorrect.

Bulk array preparation and reading should use a consistent approach. For example, if a port is skipped in the input array, it should also be skipped when reading from the output array.

Why I did it

Fix issue reported in #3961.

How I verified it

Implemented a UT to ensure no crash happens when number of PGs, queues or scheudler group is 0.

Details if related

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@stepanblyschak
Copy link
Copy Markdown
Contributor Author

/azpw run

@mssonicbld
Copy link
Copy Markdown
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@linux-foundation-easycla
Copy link
Copy Markdown

linux-foundation-easycla bot commented Oct 31, 2025

CLA Signed

The committers listed above are authorized under a signed CLA.

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Copy Markdown
Collaborator

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

@stepanblyschak
Copy link
Copy Markdown
Contributor Author

@sreeiyer-1 Could you please check ?

@sreeiyer-1
Copy link
Copy Markdown

I raised #3961 . Can confirm that after including the diff from this PR to my private view, the crash is not happening anymore.

@stepanblyschak
Copy link
Copy Markdown
Contributor Author

@prsunny @bingwang-ms @prgeor Could you please have a look?

Copy link
Copy Markdown
Contributor

@kperumalbfn kperumalbfn left a comment

Choose a reason for hiding this comment

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

LGTM

@prsunny prsunny merged commit ffea522 into sonic-net:master Nov 17, 2025
15 checks passed
YairRaviv pushed a commit to YairRaviv/sonic-swss that referenced this pull request Nov 22, 2025
What I did

Fix issue reported in sonic-net#3961.
Regression happened after move to bulk implementation. The error handling of no PGs, queues was incorrect.

Bulk array preparation and reading should use a consistent approach. For example, if a port is skipped in the input array, it should also be skipped when reading from the output array.

Why I did it

Fix issue reported in sonic-net#3961.
yijingyan2 added a commit to yijingyan2/sonic-swss that referenced this pull request Dec 2, 2025
@zhixzhu
Copy link
Copy Markdown
Contributor

zhixzhu commented Dec 18, 2025

@stepanblyschak @prsunny Same crash observed in 202511 image, can you add label to do double commit to 202511?

@mssonicbld
Copy link
Copy Markdown
Collaborator

Cherry-pick PR to 202511: #4106

Pterosaur pushed a commit to Janetxxx/sonic-swss that referenced this pull request Jan 6, 2026
What I did

Fix issue reported in sonic-net#3961.
Regression happened after move to bulk implementation. The error handling of no PGs, queues was incorrect.

Bulk array preparation and reading should use a consistent approach. For example, if a port is skipped in the input array, it should also be skipped when reading from the output array.

Why I did it

Fix issue reported in sonic-net#3961.
yehjunying pushed a commit to yehjunying/sonic-swss that referenced this pull request Jan 16, 2026
What I did

Fix issue reported in sonic-net#3961.
Regression happened after move to bulk implementation. The error handling of no PGs, queues was incorrect.

Bulk array preparation and reading should use a consistent approach. For example, if a port is skipped in the input array, it should also be skipped when reading from the output array.

Why I did it

Fix issue reported in sonic-net#3961.
theasianpianist pushed a commit to theasianpianist/sonic-swss that referenced this pull request Feb 4, 2026
What I did

Fix issue reported in sonic-net#3961.
Regression happened after move to bulk implementation. The error handling of no PGs, queues was incorrect.

Bulk array preparation and reading should use a consistent approach. For example, if a port is skipped in the input array, it should also be skipped when reading from the output array.

Why I did it

Fix issue reported in sonic-net#3961.

Signed-off-by: Lawrence Lee <[email protected]>
baorliu pushed a commit to baorliu/sonic-swss that referenced this pull request Feb 23, 2026
What I did

Fix issue reported in sonic-net#3961.
Regression happened after move to bulk implementation. The error handling of no PGs, queues was incorrect.

Bulk array preparation and reading should use a consistent approach. For example, if a port is skipped in the input array, it should also be skipped when reading from the output array.

Why I did it

Fix issue reported in sonic-net#3961.

Signed-off-by: Baorong Liu <[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.

7 participants