Skip to content

Conversation

@Pterosaur
Copy link
Contributor

@Pterosaur Pterosaur commented Oct 31, 2025

What I did
Remove redundant HFT capability conditions in the CounterNameMapUpdater

Why I did it
This redundant HFT will skip the QUEUE and IPG stats if the platform doesn't support HFT
Fix the issue: https://github.com/aristanetworks/sonic-qual.msft/issues/861

How I verified it

Check the PG and QUEUE map are in the COUNTER DB.

admin@str4-7060x6-512-2:~$ redis-cli -n 2
127.0.0.1:6379[2]> keys *NAME*
1) "COUNTERS_BUFFER_POOL_NAME_MAP"
2) "COUNTERS_QUEUE_NAME_MAP"
3) "COUNTERS_LAG_NAME_MAP"
4) "COUNTERS_PORT_NAME_MAP"
5) "COUNTERS_PG_NAME_MAP"
6) "COUNTERS_RIF_NAME_MAP"
127.0.0.1:6379[2]>

Details if related

@Pterosaur Pterosaur requested a review from prsunny as a code owner October 31, 2025 01:04
Copilot AI review requested due to automatic review settings October 31, 2025 01:04
@mssonicbld
Copy link
Collaborator

/azp run

@Pterosaur Pterosaur requested a review from r12f October 31, 2025 01:04
@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

Copy link

Copilot AI left a comment

Choose a reason for hiding this comment

The reason will be displayed to describe this comment to others. Learn more.

Pull Request Overview

This PR refactors the setCounterNameMap method in CounterNameMapUpdater by removing a redundant outer if (gHFTOrch) check. The change simplifies the code without affecting functionality, since the check is already performed in the single-parameter overload that gets called for each counter map entry.


💡 Add Copilot custom instructions for smarter, more guided reviews. Learn how to get started.

@kperumalbfn
Copy link
Contributor

@Pterosaur could you have a sonic-mgmt test to check the counters with HFT enabled and disabled?

@Pterosaur Pterosaur changed the title [hft]: Fix queue and ipg stats missing if hft isn't enabled [hft]: Fix queue and ipg stats missing if hft isn't supported Oct 31, 2025
@Pterosaur
Copy link
Contributor Author

@Pterosaur could you have a sonic-mgmt test to check the counters with HFT enabled and disabled?

@kperumalbfn

I think the current tests of sonic-mgmt should have covered the HFT "enabled/disabled" case.
Actually, the title isn't precise. It should be supported/not supported. I just fixed it.
To the platform w/o HFT supported, the stats of QUEUE and IPG will always show zero.

@Pterosaur
Copy link
Contributor Author

sonic-mgmt test: sonic-net/sonic-mgmt#21163

prasoon-nexthop added a commit to prasoon-nexthop/sonic-swss that referenced this pull request Nov 5, 2025
Add comprehensive unit tests for CounterNameMapUpdater to verify that
counter name maps are correctly written to COUNTERS_DB regardless of
HFT (High Frequency Telemetry) support.

Tests cover:
- QUEUE counter maps without HFT support
- Priority Group counter maps without HFT support
- Handling of empty OID values
- Single counter name map operations

These tests verify the fix from sonic-net#3967
that removed the redundant outer 'if (gHFTOrch)' check which was preventing
counter registration on platforms without HFT support.

Signed-off-by: Prasoon Saurav <[email protected]>
@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Pterosaur
Copy link
Contributor Author

/azp run

@azure-pipelines
Copy link

Commenter does not have sufficient privileges for PR 3967 in repo sonic-net/sonic-swss

@Pterosaur
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Pterosaur
Copy link
Contributor Author

/azpw run

@mssonicbld
Copy link
Collaborator

/AzurePipelines run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@mssonicbld
Copy link
Collaborator

/azp run

@azure-pipelines
Copy link

Azure Pipelines successfully started running 1 pipeline(s).

@Pterosaur
Copy link
Contributor Author

Duplicated #3982

@Pterosaur Pterosaur closed this Nov 10, 2025
Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment

Projects

None yet

Development

Successfully merging this pull request may close these issues.

4 participants