Skip to content

Commit dcc7f56

Browse files
committed
Do not initialize counter for host CPU queue if the corresponding queue was not initialized
Signed-off-by: Stephen Sun <stephens@nvidia.com>
1 parent 545b967 commit dcc7f56

1 file changed

Lines changed: 3 additions & 2 deletions

File tree

orchagent/portsorch.cpp

Lines changed: 3 additions & 2 deletions
Original file line numberDiff line numberDiff line change
@@ -3570,7 +3570,8 @@ bool PortsOrch::initPort(const PortConfig &port)
35703570
m_recircPortRole[alias] = role;
35713571
}
35723572

3573-
if (p.m_host_tx_queue_configured)
3573+
// We have to test the size of m_queue_ids here since it isn't initialized on some platforms (like DPU)
3574+
if (p.m_host_tx_queue_configured && p.m_queue_ids.size() > p.m_host_tx_queue)
35743575
{
35753576
createPortBufferQueueCounters(p, to_string(p.m_host_tx_queue), false);
35763577
}
@@ -3605,7 +3606,7 @@ void PortsOrch::deInitPort(string alias, sai_object_id_t port_id)
36053606
return;
36063607
}
36073608

3608-
if (p.m_host_tx_queue_configured)
3609+
if (p.m_host_tx_queue_configured && p.m_queue_ids.size() > p.m_host_tx_queue)
36093610
{
36103611
removePortBufferQueueCounters(p, to_string(p.m_host_tx_queue), false);
36113612
}

0 commit comments

Comments
 (0)