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

[HLD] orchagent for PFC Historical stats #1903

Draft
wants to merge 1 commit into
base: master
Choose a base branch
from

Conversation

peterbailey-arista
Copy link

@peterbailey-arista peterbailey-arista commented Jan 24, 2025

Originally presented in SONiC Hackathon 2024

Using software to extrapolate PFC activity from existing PFC RX counters.

#1904

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.

@mssonicbld
Copy link
Collaborator

/azp run

Copy link

No pipelines are associated with this pull request.


A new orch agent named "PfcHistoryOrch" will configure a flex counter group ("PFC\_STAT\_HISTORY") with a lua script plugin to poll COUNTERS\_DB at the configured interval and investigate if Pause Frames have been received on the interface.

`TOTAL_PAUSE_TRANSITIONS`: Running total number of transitions from unpaused to paused
Copy link
Contributor

@lguohan lguohan Feb 25, 2025

Choose a reason for hiding this comment

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

take a look at this stats, looks like same as definition. https://github.com/sonic-net/sonic-swss/blob/master/orchagent/pfc_detect_broadcom.lua#L43

SAI_PORT_STAT_PFC_RX_PKTS
SAI_PORT_STAT_PFC_ON2OFF_RX_PKTS

Copy link
Contributor

Choose a reason for hiding this comment

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

in pfc watchdog logic, looks like we are already pulling these counters at ~200ms, so you might want to just reuse those counters instead of pulling your own.

Copy link
Author

Choose a reason for hiding this comment

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

Thank you for the feedback Guohan! I looked into your suggestion but think merging PFC history into the PFC watchdog would be impractical. Even though they both poll the same counters, the features are distinct and I believe should be individually configurable. Using the same flex counter would make this difficult.

For example, it should be possible to have history enabled while the watchdog is disabled and vice versa. Similarly it should be possible to enable them on different ports. It might additionally be misleading that configuring the polling interval for the watchdog would also correspond to the history feature.
Using the same Flex Counter by adding the pfc_stat_history.lua plugin to the watchdog (or by adjusting the pfc_detect_{platform}.lua script to estimate the historical data) would make these configurations significantly more cumbersome.

Looking at SAI_PORT_STAT_PFC_ON2OFF_RX_PKTS, it seems to be exclusive to broadcom platform and is not used or provided on other platforms, so it would only be usable in that situation regardless.

Please let me know what you think!

@peterbailey-arista peterbailey-arista marked this pull request as draft February 27, 2025 18:09
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

Successfully merging this pull request may close these issues.

3 participants