Skip to content

Commit

Permalink
Fix an error in the test
Browse files Browse the repository at this point in the history
All counters are created in bulk mode.
We should translate bulkAddObject to iteration of single call (addObject) for counter groups that do not support bulk.

Signed-off-by: Stephen Sun <[email protected]>
  • Loading branch information
stephenxs committed Feb 17, 2025
1 parent fe9a9be commit 55881cb
Showing 1 changed file with 13 additions and 1 deletion.
14 changes: 13 additions & 1 deletion syncd/FlexCounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -1754,7 +1754,11 @@ class DashMeterCounterContext : public BaseCounterContext
_In_ const std::string &per_object_stats_mode) override
{
SWSS_LOG_ENTER();
SWSS_LOG_ERROR("It does not support to add counter in bulk mode for DashMeterCounterContext");

for (auto i = 0uL; i < vids.size(); i++)
{
addObject(vids[i], rids[i], idStrings, per_object_stats_mode);
}
}

bool hasObject() const override
Expand Down Expand Up @@ -2756,6 +2760,14 @@ void FlexCounter::bulkAddCounter(
idStrings,
"");
}
else if (objectType == SAI_OBJECT_TYPE_BUFFER_POOL && field == BUFFER_POOL_COUNTER_ID_LIST)
{
counterIds = idStrings;
}
else if (objectType == SAI_OBJECT_TYPE_BUFFER_POOL && field == STATS_MODE_FIELD)
{
statsMode = value;
}
else
{
SWSS_LOG_ERROR("Object type and field combination is not supported, object type %s, field %s",
Expand Down

0 comments on commit 55881cb

Please sign in to comment.