diff --git a/syncd/scripts/syncd_init_common.sh b/syncd/scripts/syncd_init_common.sh index e9a1bee228..9e2de054e6 100644 --- a/syncd/scripts/syncd_init_common.sh +++ b/syncd/scripts/syncd_init_common.sh @@ -66,13 +66,16 @@ if [ "$SUPPORTING_BULK_COUNTER_GROUPS" != "" ]; then CMD_ARGS+=" -B $SUPPORTING_BULK_COUNTER_GROUPS" fi -# Enable per-port counter capability discovery (see sonic-buildimage#28460, #1774). -# Add ASIC types that needs this feature here -case "$SONIC_ASIC_TYPE" in - broadcom) - CMD_ARGS+=" -G" - ;; -esac +ENABLE_PER_PORT_COUNTER_DISCOVERY=$(echo $SYNCD_VARS | jq -r 'if has("enable_per_port_counter_discovery") then .enable_per_port_counter_discovery else "" end') +if [ "$ENABLE_PER_PORT_COUNTER_DISCOVERY" == "true" ]; then + CMD_ARGS+=" -G" +elif [ -z "$ENABLE_PER_PORT_COUNTER_DISCOVERY" ]; then + case "$SONIC_ASIC_TYPE" in + broadcom) + CMD_ARGS+=" -G" + ;; + esac +fi case "$(cat /proc/cmdline)" in *SONIC_BOOT_TYPE=fastfast*)