From e8b52a652d766ee2d9758cfafe09b32e805b0f89 Mon Sep 17 00:00:00 2001 From: Sonic Build Admin Date: Tue, 10 Feb 2026 23:27:11 +0000 Subject: [PATCH] Fix switch stat counters by using get_stats_ext instead of get_stats We were seeing N/A for switch trimming counters in sonic-mgmt testing with th5. It turns out Broadcom only supports get_stats_ext in their SAI implementation. This PR switches from using get_stats to get_stats_ext to retrieve counters that are object type switch. This PR may be breaking to other vendors if they need to use get_stats. Backport Request - [x] 202412 - [x] 202511 --- syncd/FlexCounter.cpp | 1 + 1 file changed, 1 insertion(+) diff --git a/syncd/FlexCounter.cpp b/syncd/FlexCounter.cpp index 8dd7275a..e7e7f3c0 100644 --- a/syncd/FlexCounter.cpp +++ b/syncd/FlexCounter.cpp @@ -2450,6 +2450,7 @@ std::shared_ptr FlexCounter::createCounterContext( auto context = std::make_shared>(context_name, instance, SAI_OBJECT_TYPE_SWITCH, m_vendorSai.get(), m_statsMode); context->always_check_supported_counters = true; context->use_sai_stats_capa_query = true; + context->use_sai_stats_ext = true; return context; }