Skip to content

Commit

Permalink
Check whether flex counter has been configured before clear counter o…
Browse files Browse the repository at this point in the history
…n removing a pool

Signed-off-by: Stephen Sun <stephens@nvidia.com>
  • Loading branch information
stephenxs committed Nov 18, 2021
1 parent 7b2546c commit 814f659
Showing 1 changed file with 5 additions and 2 deletions.
7 changes: 5 additions & 2 deletions orchagent/bufferorch.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -212,8 +212,11 @@ bool BufferOrch::isPortReady(const std::string& port_name) const

void BufferOrch::clearBufferPoolWatermarkCounterIdList(const sai_object_id_t object_id)
{
string key = BUFFER_POOL_WATERMARK_STAT_COUNTER_FLEX_COUNTER_GROUP ":" + sai_serialize_object_id(object_id);
m_flexCounterTable->del(key);
if (m_isBufferPoolWatermarkCounterIdListGenerated)
{
string key = BUFFER_POOL_WATERMARK_STAT_COUNTER_FLEX_COUNTER_GROUP ":" + sai_serialize_object_id(object_id);
m_flexCounterTable->del(key);
}
}

void BufferOrch::generateBufferPoolWatermarkCounterIdList(void)
Expand Down

0 comments on commit 814f659

Please sign in to comment.