Skip to content

Commit d0419dc

Browse files
authored
sonic-swss: Fix orchagent crash in generateQueueMapPerPort. (#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.
1 parent bd652a0 commit d0419dc

File tree

1 file changed

+3
-1
lines changed

1 file changed

+3
-1
lines changed

orchagent/portsorch.cpp

Lines changed: 3 additions & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -6123,7 +6123,9 @@ void PortsOrch::generateQueueMapPerPort(const Port& port, FlexCounterQueueStates
61236123
uint8_t queueRealIndex = 0;
61246124
if (getQueueTypeAndIndex(queue_ids[queueIndex], queueType, queueRealIndex))
61256125
{
6126-
if (!queuesState.isQueueCounterEnabled(queueRealIndex))
6126+
/* voq counters are always enabled. There is no mechanism to disable voq
6127+
* counters in a voq system. */
6128+
if (!voq && !queuesState.isQueueCounterEnabled(queueRealIndex))
61276129
{
61286130
continue;
61296131
}

0 commit comments

Comments
 (0)