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 committed Dec 6, 2022
1 parent bd652a0 commit d0419dc
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 @@ -6123,7 +6123,9 @@ void PortsOrch::generateQueueMapPerPort(const Port& port, FlexCounterQueueStates
uint8_t queueRealIndex = 0;
if (getQueueTypeAndIndex(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 d0419dc

Please sign in to comment.