@@ -6169,6 +6169,10 @@ void PortsOrch::generateQueueMapPerPort(const Port& port, FlexCounterQueueStates
6169
6169
queueVector.emplace_back (name.str (), id);
6170
6170
if (voq)
6171
6171
{
6172
+ // Install a flex counter for this voq to track stats. Voq counters do
6173
+ // not have buffer queue config. So it does not get enabled through the
6174
+ // flexcounter orch logic. Always enabled voq counters.
6175
+ addQueueFlexCountersPerPortPerQueueIndex (port, queueIndex, true );
6172
6176
queuePortVector.emplace_back (id, sai_serialize_object_id (port.m_system_port_oid ));
6173
6177
}
6174
6178
else
@@ -6184,12 +6188,12 @@ void PortsOrch::generateQueueMapPerPort(const Port& port, FlexCounterQueueStates
6184
6188
else
6185
6189
{
6186
6190
m_queueTable->set (" " , queueVector);
6191
+ CounterCheckOrch::getInstance ().addPort (port);
6187
6192
}
6188
6193
m_queuePortTable->set (" " , queuePortVector);
6189
6194
m_queueIndexTable->set (" " , queueIndexVector);
6190
6195
m_queueTypeTable->set (" " , queueTypeVector);
6191
6196
6192
- CounterCheckOrch::getInstance ().addPort (port);
6193
6197
}
6194
6198
6195
6199
void PortsOrch::addQueueFlexCounters (map<string, FlexCounterQueueStates> queuesStateVector)
@@ -6230,19 +6234,30 @@ void PortsOrch::addQueueFlexCountersPerPort(const Port& port, FlexCounterQueueSt
6230
6234
continue ;
6231
6235
}
6232
6236
// Install a flex counter for this queue to track stats
6233
- addQueueFlexCountersPerPortPerQueueIndex (port, queueIndex);
6237
+ addQueueFlexCountersPerPortPerQueueIndex (port, queueIndex, false );
6234
6238
}
6235
6239
}
6236
6240
}
6237
6241
6238
- void PortsOrch::addQueueFlexCountersPerPortPerQueueIndex (const Port& port, size_t queueIndex)
6242
+ void PortsOrch::addQueueFlexCountersPerPortPerQueueIndex (const Port& port, size_t queueIndex, bool voq )
6239
6243
{
6240
6244
std::unordered_set<string> counter_stats;
6245
+ std::vector<sai_object_id_t > queue_ids;
6246
+
6241
6247
for (const auto & it: queue_stat_ids)
6242
6248
{
6243
6249
counter_stats.emplace (sai_serialize_queue_stat (it));
6244
6250
}
6245
- queue_stat_manager.setCounterIdList (port.m_queue_ids [queueIndex], CounterType::QUEUE, counter_stats);
6251
+ if (voq)
6252
+ {
6253
+ queue_ids = m_port_voq_ids[port.m_alias ];
6254
+ }
6255
+ else
6256
+ {
6257
+ queue_ids = port.m_queue_ids ;
6258
+ }
6259
+
6260
+ queue_stat_manager.setCounterIdList (queue_ids[queueIndex], CounterType::QUEUE, counter_stats);
6246
6261
}
6247
6262
6248
6263
@@ -6350,7 +6365,7 @@ void PortsOrch::createPortBufferQueueCounters(const Port &port, string queues)
6350
6365
if (flexCounterOrch->getQueueCountersState ())
6351
6366
{
6352
6367
// Install a flex counter for this queue to track stats
6353
- addQueueFlexCountersPerPortPerQueueIndex (port, queueIndex);
6368
+ addQueueFlexCountersPerPortPerQueueIndex (port, queueIndex, false );
6354
6369
}
6355
6370
if (flexCounterOrch->getQueueWatermarkCountersState ())
6356
6371
{
0 commit comments