diff --git a/syncd/FlexCounter.cpp b/syncd/FlexCounter.cpp index f907f4f07..4844b7b4e 100644 --- a/syncd/FlexCounter.cpp +++ b/syncd/FlexCounter.cpp @@ -865,7 +865,7 @@ class CounterContext : public BaseCounterContext return; } - if (always_check_supported_counters) + if (always_check_supported_counters && !dont_clear_support_counter) { m_supportedCounters.clear(); } @@ -1663,7 +1663,9 @@ std::shared_ptr FlexCounter::createCounterContext( else if (context_name == COUNTER_TYPE_MACSEC_SA) { auto context = std::make_shared>(context_name, SAI_OBJECT_TYPE_MACSEC_SA, m_vendorSai.get(), m_statsMode); + context->always_check_supported_counters = true; context->use_sai_stats_capa_query = false; + context->dont_clear_support_counter = true; return context; } else if (context_name == COUNTER_TYPE_FLOW) diff --git a/syncd/FlexCounter.h b/syncd/FlexCounter.h index 18d3f3af1..757ae0af1 100644 --- a/syncd/FlexCounter.h +++ b/syncd/FlexCounter.h @@ -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 {