Skip to content

Commit

Permalink
Add a flag dont_clear_support_counter to support a case of not cleari…
Browse files Browse the repository at this point in the history
…ng the existing m_supportedCounters
  • Loading branch information
judyjoseph committed Jan 7, 2025
1 parent 0a51fd9 commit 66de812
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 0 deletions.
7 changes: 7 additions & 0 deletions syncd/FlexCounter.cpp
Original file line number Diff line number Diff line change
Expand Up @@ -859,6 +859,12 @@ class CounterContext : public BaseCounterContext
_In_ sai_stats_mode_t stats_mode)
{
SWSS_LOG_ENTER();
if (!m_supportedCounters.empty() && !always_check_supported_counters && !dont_clear_support_counter)
{
SWSS_LOG_NOTICE("Ignore checking of supported counters");
return;
}

if (always_check_supported_counters)
{
m_supportedCounters.clear();
Expand Down Expand Up @@ -1658,6 +1664,7 @@ std::shared_ptr<BaseCounterContext> FlexCounter::createCounterContext(
{
auto context = std::make_shared<CounterContext<sai_macsec_sa_stat_t>>(context_name, SAI_OBJECT_TYPE_MACSEC_SA, m_vendorSai.get(), m_statsMode);
context->use_sai_stats_capa_query = false;
context->dont_clear_support_counter = true;
return context;
}
else if (context_name == COUNTER_TYPE_FLOW)
Expand Down
1 change: 1 addition & 0 deletions syncd/FlexCounter.h
Original file line number Diff line number Diff line change
Expand Up @@ -59,6 +59,7 @@ namespace syncd
bool use_sai_stats_ext = false;
bool double_confirm_supported_counters = false;
bool no_double_check_bulk_capability = false;
bool dont_clear_support_counter = false;
};
class FlexCounter
{
Expand Down

0 comments on commit 66de812

Please sign in to comment.