Skip to content
New issue

Have a question about this project? Sign up for a free GitHub account to open an issue and contact its maintainers and the community.

By clicking “Sign up for GitHub”, you agree to our terms of service and privacy statement. We’ll occasionally send you account related emails.

Already on GitHub? Sign in to your account

Introduce SONiC CLI to fetch and display HW (ASIC, PHY) stats/counters #321

Open
shyam77git opened this issue Nov 30, 2022 · 2 comments
Open

Comments

@shyam77git
Copy link

PR: https://github.com/sonic-net/sonic-buildimage/pull/11731
“sonic-clear macsec” is clearing the stats with above fix/PR, and we see that stats are getting cleared in subsequent “show macsec Ethernet<>” CLI.

Deep-diving little more into this:
This clears the stats from the SW table (redis/FLEX) only and does not clear them at the PHY/device (HW) level.
Subsequent call of “show macsec Ethernet<>” CLI would display the delta stats (i.e. [stats fetched via/from platform/HW] – [stats cleared]).

Impact:
This approach can cause the mismatch of the stats between what SW is displaying vs what’s available in PHY!
During live traffic, this might complicate stats validation while debugging in case of traffic drop etc.
Mismatch:
After triggering “sonic-clear …” , stats in “show counters…” would be (HW – cached) counters whereas stats at the PHY (device) level would still be original HW stats/counters (without anyone invoking a clear to them), so this would be a mismatch

Proposal A:
“sonic-clear macsec” trigger can call the PHY-SAI API to clear the stats from the device (PHY/HW) and show the real stats fetched from the PHY without doing calculations at upper layer (SONiC/ SW table (redis/FLEX DB))
Or
Proposal B:
Do we have any command to display HW stats at SONiC (command) level?
If not, should we introduce one? At least, there would be a way to check and compare stats at SW and HW (device) level.

@shyam77git
Copy link
Author

Note: This issue applies to NPU/ASIC too.
i.e. current “show interface counters” behavior. Once we clear the counters – the counter data shown by SONiC will differ from counters present in ASIC.
Same proposal/mechanism can be applied to NPU as well

@shyam77git
Copy link
Author

shyam77git commented Nov 30, 2022

FYI @judyjoseph @abdosi

Sign up for free to join this conversation on GitHub. Already have an account? Sign in to comment
Labels
None yet
Projects
None yet
Development

No branches or pull requests

1 participant