Skip to content

Commit

Permalink
sonic-swss: Fix orchagent crash in generateQueueMapPerPort. (#2552)
Browse files Browse the repository at this point in the history
* 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.
  • Loading branch information
skbarista authored and yxieca committed Dec 7, 2022
1 parent 1a4a5d9 commit abc6a81
Showing 1 changed file with 3 additions and 1 deletion.
4 changes: 3 additions & 1 deletion orchagent/portsorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -5991,7 +5991,9 @@ void PortsOrch::generateQueueMapPerPort(const Port& port, FlexCounterQueueStates
uint8_t queueRealIndex = 0;
if (getQueueTypeAndIndex(port.m_queue_ids[queueIndex], queueType, queueRealIndex))
{
if (!queuesState.isQueueCounterEnabled(queueRealIndex))
/* voq counters are always enabled. There is no mechanism to disable voq
* counters in a voq system. */
if (!voq && !queuesState.isQueueCounterEnabled(queueRealIndex))
{
continue;
}
Expand Down

0 comments on commit abc6a81

Please sign in to comment.