Closed
Conversation
added 2 commits
March 23, 2026 10:18
Author
|
/azp run |
|
Azure Pipelines successfully started running 1 pipeline(s). |
This file contains hidden or bidirectional Unicode text that may be interpreted or compiled differently than what appears below. To review, open the file in an editor that reveals hidden Unicode characters.
Learn more about bidirectional Unicode characters
Sign up for free
to join this conversation on GitHub.
Already have an account?
Sign in to comment
Add this suggestion to a batch that can be applied as a single commit.This suggestion is invalid because no changes were made to the code.Suggestions cannot be applied while the pull request is closed.Suggestions cannot be applied while viewing a subset of changes.Only one suggestion per line can be applied in a batch.Add this suggestion to a batch that can be applied as a single commit.Applying suggestions on deleted lines is not supported.You must change the existing code in this line in order to create a valid suggestion.Outdated suggestions cannot be applied.This suggestion has been applied or marked resolved.Suggestions cannot be applied from pending reviews.Suggestions cannot be applied on multi-line comments.Suggestions cannot be applied while the pull request is queued to merge.Suggestion cannot be applied right now. Please check back later.
Why I did it
Added gNMI getter for show pfc counters, show pfc asymmetric and show pfc priority so client can fetch per-port PFC RX and TX packet counts for each priority, historical PFC pause transitions, whether asymmetric PFC is enabled/disabled, which PFC priorities are configured as lossless, via gNMI in JSON format.
How I did it
Added the following main getter functions:
getPfcCounters() — Entry point for show pfc counters; if --history is set, delegates to getPfcCountersHistory().
Otherwise builds per-port RX/TX PFC packet counters (PFC0–PFC7) from SAI_PORT_STAT_PFC_*_{RX,TX}_PKTS fields.
getPfcAsymmetric() — Reads the PORT table from CONFIG_DB and extracts the pfc_asym field for each Ethernet port.
Supports optional interface filtering via a positional arg; defaults to "N/A" if the field is absent.
getPfcPriority() — Reads the PORT_QOS_MAP table from CONFIG_DB and extracts the pfc_enable field per interface.
Supports optional interface filtering; returns an error if the specified interface doesn't exist in the table.
Other functions added:
fetchPortCounters() — Reads COUNTERS_PORT_NAME_MAP from COUNTERS_DB to get port-name→OID mappings.
Then fetches COUNTERS: for each port and returns a map keyed by port name.
getPfcCountersHistory() — Reads historical PFC watchdog stats for each port and each priority (PFC0–PFC7).
Tries SAI-prefixed fields first with EST fallback for transitions/duration, and EST-only for recent pause timestamp/time.
How to verify it
Pending.
Which release branch to backport (provide reason below if selected)
Description for the changelog
Link to config_db schema for YANG module changes
A picture of a cute animal (not mandatory but encouraged)