sonic-swss: Fix orchagent crash in generateQueueMapPerPort.#2552
Merged
prsunny merged 1 commit intosonic-net:masterfrom Dec 6, 2022
skbarista:voq-counter-fix
Merged
sonic-swss: Fix orchagent crash in generateQueueMapPerPort.#2552prsunny merged 1 commit intosonic-net:masterfrom skbarista:voq-counter-fix
prsunny merged 1 commit intosonic-net:masterfrom
skbarista:voq-counter-fix
Conversation
* generateQueueMap uses m_portList[port].m_queue_ids.size to allocate m_queueStates in FlexCounterQueueStates. But m_portList[port].m_queue_ids.size is zero for system ports which results in isQueueCounterEnabled crash for system ports. Since we do not have support disable voq counters yet, do not check isQueueCounterEnabled for voqs.
vmittal-msft
requested changes
Dec 1, 2022
Contributor
vmittal-msft
left a comment
There was a problem hiding this comment.
Please verify queue counters on voq system as requested. Changes looks fine though.
Contributor
Author
|
@vmittal-msft I have attached a counter.txt file with output from queuestat -V. This system just has the inband control traffic and front panel control traffic running. |
vmittal-msft
approved these changes
Dec 5, 2022
yxieca
pushed a commit
that referenced
this pull request
Dec 7, 2022
* generateQueueMap uses m_portList[port].m_queue_ids.size to allocate m_queueStates in FlexCounterQueueStates. But m_portList[port].m_queue_ids.size is zero for system ports which results in isQueueCounterEnabled crash for system ports. Since we do not have support disable voq counters yet, do not check isQueueCounterEnabled for voqs.
Contributor
|
@skbarista this PR causes build failures after included in sonic-swss submodule. Please address the build failure. It is possible that voq dependency is not cherry-picked. |
Contributor
|
Build failure log: https://dev.azure.com/mssonic/build/_build/results?buildId=185460&view=logs&j=d37bc48d-29a0-534f-a1dc-3d699deb17a6&t=933dfdc6-d074-504d-ee66-71743fd9ae4e |
yxieca
pushed a commit
that referenced
this pull request
Jan 4, 2023
* generateQueueMap uses m_portList[port].m_queue_ids.size to allocate m_queueStates in FlexCounterQueueStates. But m_portList[port].m_queue_ids.size is zero for system ports which results in isQueueCounterEnabled crash for system ports. Since we do not have support disable voq counters yet, do not check isQueueCounterEnabled for voqs.
Janetxxx
pushed a commit
to Janetxxx/sonic-swss
that referenced
this pull request
Nov 10, 2025
…t#2552) * generateQueueMap uses m_portList[port].m_queue_ids.size to allocate m_queueStates in FlexCounterQueueStates. But m_portList[port].m_queue_ids.size is zero for system ports which results in isQueueCounterEnabled crash for system ports. Since we do not have support disable voq counters yet, do not check isQueueCounterEnabled for voqs.
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
What I did
Fix orchagent crash in voq systems with the following backtrace.
gdb) bt
#0 0x000055cbe38f7d2d in std::_Bit_reference::operator bool (this=) at /usr/include/c++/10/bits/stl_bvector.h:87
#1 std::_Bit_const_iterator::operator* (this=) at /usr/include/c++/10/bits/stl_bvector.h:348
#2 std::vector<bool, std::allocator >::operator[] (__n=0, this=0x55cbe53688f0) at /usr/include/c++/10/bits/stl_bvector.h:918
#3 FlexCounterQueueStates::isQueueCounterEnabled (this=this@entry=0x55cbe53688f0, index=0) at flexcounterorch.cpp:422
#4 0x000055cbe37692ad in PortsOrch::generateQueueMapPerPort (this=0x55cbe5081360, port=..., queuesState=..., voq=true) at portsorch.cpp:6093
#5 0x000055cbe3769c9a in PortsOrch::generateQueueMap (this=this@entry=0x55cbe5081360, queuesStateVector=std::map with 39 elements = {...}) at portsorch.cpp:6048
#6 0x000055cbe38fb2c8 in FlexCounterOrch::doTask (this=0x55cbe50e9a30, consumer=...) at flexcounterorch.cpp:163
#7 0x000055cbe36dd66e in Consumer::drain (this=0x55cbe51bbe40) at orch.cpp:241
#8 Consumer::drain (this=0x55cbe51bbe40) at orch.cpp:238
#9 Consumer::execute (this=0x55cbe51bbe40) at orch.cpp:235
#10 0x000055cbe36ccc99 in OrchDaemon::start (this=this@entry=0x55cbe505f6b0) at orchdaemon.cpp:757
#11 0x000055cbe3654990 in main (argc=, argv=) at main.cpp:735
Why I did it
Fix orchagent crash in voq system
How I verified it
Verified that voq system boots up fine without any crash.