doca-pcc-counters

Arm and read firmware PCC diagnostic counters on ConnectX and BlueField devices.

3.2k|370|Updated Feb 25, 2026
One-click install
npx skills add https://github.com/NVIDIA/skills --skill doca-pcc-counters
Or copy as Structured Prompt for Agent
Please help me install this Agent Skill.
Skill: doca-pcc-counters
Source: https://github.com/NVIDIA/skills/tree/main/skills/doca-pcc-counters
Command: npx skills add https://github.com/NVIDIA/skills --skill doca-pcc-counters

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Reading a ConnectX or BlueField device's firmware PCC (Programmable Congestion Control) diagnostic counters requires knowing the exact two-operation contract of the pcc_counters.sh script, the mst device resolution flow, and the mlx5 debugfs diag_cnt interface, and mistakes like querying before arming or misreading a zero counter lead to wrong congestion-control conclusions.

Core Features & Use Cases

  • Guided counter readout: Walks the agent through the canonical set-then-query sequence against an mst device path, with the fixed firmware counter set (PCC_CNP_COUNT, RTT-perf, WRED-drop families) documented verbatim.
  • Layered error diagnosis: Maps symptoms like ERROR: Bad Device, Bad Request, empty dumps, and counters stuck at zero to a seven-layer error taxonomy covering install, mst resolution, debugfs permissions, and traffic state.
  • Safety-gated privileged operations: Flags the set operation as a privileged debugfs write requiring operator confirmation, and refuses to translate counter deltas into congestion-control tuning changes.
  • Use Case: An operator investigating whether congestion control is dropping packets on a RoCE port asks the agent to capture the CNP and WRED-drop counters for /dev/mst/mt41692_pciconf0, and the skill produces a verbatim counter snapshot as evidence.

Quick Start

Ask your agent to arm and read the PCC diagnostic counters on your device, for example: "Use pcc_counters.sh to set and then query the PCC counters on /dev/mst/mt41692_pciconf0 and show me the CNP and WRED-drop values."

Frequently Asked Questions about doca-pcc-counters

High-intent search queries and answers about installing and using this skill.

FAQPage Schema
How do I read PCC diagnostic counters on a ConnectX or BlueField device?

Run sudo ./pcc_counters.sh set <mst-device> first to arm the counters, then sudo ./pcc_counters.sh query <mst-device> to read them. The device argument must be an mst path from sudo mst status -v, such as /dev/mst/mt41692_pciconf0.

What counters does pcc_counters.sh report?

The script reports a fixed firmware counter set including PCC_CNP_COUNT, MAD_RTT_PERF_CONT_REQ/RES, the WRED-drop families for SX, ACK, NACK, CNP, and RTT events, HANDLED_SXW/RXT_EVENTS, and per-port DROP_RTT and RTT_GEN counters. The set is not user-extensible.

Why does pcc_counters.sh print ERROR: Bad Device?

The mst device path you passed does not match any entry in sudo mst status -v. Run sudo mst start, then sudo mst status -v, and use the exact device path it lists for your NIC.

Why is a PCC counter stuck at zero after query?

A zero usually means the device genuinely saw no such events, not a tool bug. Confirm set was run before query and that relevant RoCE traffic is generating congestion, RTT, or drop events before treating a zero as a finding.

Can pcc_counters.sh configure congestion control or load a custom PCC algorithm?

No. The script only arms and reads firmware diagnostic counters; it does not change congestion-control behavior or forwarding. Custom PCC algorithm development belongs to the doca-pcc library skill, and firmware PCC configuration is routed through the DOCA documentation.