Skip to content

added pfc code#194

Closed
meghna-mishra wants to merge 3 commits intoAzure:masterfrom
meghna-mishra:addPfcCode
Closed

added pfc code#194
meghna-mishra wants to merge 3 commits intoAzure:masterfrom
meghna-mishra:addPfcCode

Conversation

@meghna-mishra
Copy link
Copy Markdown

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)

  • 201811
  • 201911
  • 202006
  • 202012
  • 202106
  • 202111

Description for the changelog

Link to config_db schema for YANG module changes

A picture of a cute animal (not mandatory but encouraged)

image

@meghna-mishra
Copy link
Copy Markdown
Author

/azp run

@azure-pipelines
Copy link
Copy Markdown

Azure Pipelines successfully started running 1 pipeline(s).

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.

1 participant