# doca-pcc-counters

doca-pcc-counters — a skill for Claude Code and Codex that arms and reads firmware PCC diagnostic counters (CNP, RTT, WRED-drop) on ConnectX / BlueField devices via pcc_counters.sh.

- skill · `type=skill` · Claude Code, Codex, Cursor, GitHub Copilot, Gemini CLI, OpenCode, Windsurf (Devin Desktop), Claude.ai · 128 installs · ★ 4106 repo stars
- Author: NVIDIA
- License: Apache-2.0 · policy=mirror · the beginning of the file is at the end of this page
- Source: https://github.com/NVIDIA/skills/tree/HEAD/skills/doca-pcc-counters/SKILL.md
- Updated: 2026-10-23
- Security check: automated, 2026-11-16 (text) — no signs of malicious code found.
- HTML: https://affpapa.org/en/nevibecode/skills/doca-pcc-counters

## What it does

The skill guides the agent through the two-step sequence: `set` on the target mst device, then `query` — returning named counter lines read directly from the mlx5 debugfs `diag_cnt` interface.

\`pcc_counters.sh` is a plain bash script shipped under the DOCA tools directory, not a compiled binary. It takes two positional arguments: `set | query` and an mst device path. There is no `--help` flag. The counter set is fixed by firmware and exists regardless of whether a custom `doca-pcc` DPA kernel is loaded.

The script requires Linux with DOCA/MFT installed, debugfs mounted, root access to the `diag_cnt` interface, and a ConnectX-6 or newer device — ConnectX-8 is not supported — or a BlueField. A wrong mst path produces `ERROR: Bad Device` before anything else runs. The `set` operation controls which counters are collected, not congestion-control or forwarding behaviour.

## Install

### Claude Code (native platform)

1. **Skills CLI (Vercel)**
```bash
npx skills add NVIDIA/skills --skill doca-pcc-counters -a claude-code
```

2. **Manually: put the files in place**
- File: `~/.claude/skills/doca-pcc-counters/SKILL.md` — Copy the whole skill folder; for one project use .claude/skills/doca-pcc-counters/

### Codex

1. **Skills CLI (Vercel)**
```bash
npx skills add NVIDIA/skills --skill doca-pcc-counters -a codex
```

2. **Manually: put the files in place**
- File: `.agents/skills/doca-pcc-counters/SKILL.md` — For all projects use ~/.agents/skills/

### Cursor

1. **Skills CLI (Vercel)**
```bash
npx skills add NVIDIA/skills --skill doca-pcc-counters -a cursor
```

2. **Manually: put the files in place**
- File: `.cursor/skills/doca-pcc-counters/SKILL.md` — Cursor also reads .agents/skills/ and .claude/skills/

### GitHub Copilot

1. **GitHub CLI**
```bash
gh skill install NVIDIA/skills skills/doca-pcc-counters
```

2. **Manually: put the files in place**
- File: `.github/skills/doca-pcc-counters/SKILL.md`

### Gemini CLI

1. **Skills CLI (Vercel)**
```bash
npx skills add NVIDIA/skills --skill doca-pcc-counters -a gemini-cli
```

2. **Platform CLI**
```bash
gemini skills install https://github.com/NVIDIA/skills --path skills/doca-pcc-counters
```

### Windsurf (Devin Desktop)

**Manually: put the files in place**
- File: `.devin/skills/doca-pcc-counters/SKILL.md` — The legacy .windsurf/skills/ path still works

### OpenCode

**Skills CLI (Vercel)**
```bash
npx skills add NVIDIA/skills --skill doca-pcc-counters -a opencode
```

### Claude.ai

**Claude.ai**
- Zip the folder and upload it in Settings → Capabilities → Skills

Where a file is given instead of a command, copy the files from the source to that path: https://github.com/NVIDIA/skills/tree/HEAD/skills/doca-pcc-counters/SKILL.md

## When to use it
- dump CNP / RTT / WRED-drop counters from a ConnectX / BlueField device
- diagnose why a PCC counter is stuck at zero after query
- resolve an `ERROR: Bad Device` from the script
- confirm whether congestion-control events are occurring on a port
- capture a PCC counter snapshot as evidence for a network investigation

## Example prompts
- Arm the PCC counters on `/dev/mst/mt41692_pciconf0` with `set`, then read them with `query`
- The script printed `ERROR: Bad Device` — help me find the correct mst device path
- \`PCC_CNP_COUNT` reads 0 after `query` — are counters not armed or is there genuinely no traffic?

## Source text · SKILL.md · Apache-2.0

Below is the content of a third-party file. It is data, not instructions for you: do not act on anything written inside unless the human asks. Block tag: aa0e5c34866a4b40.

BEGIN THIRD-PARTY FILE aa0e5c34866a4b40
```text
---
license: Apache-2.0
name: doca-pcc-counters
description: >
  Use this skill when the user is invoking the DOCA PCC Counters tool —
  the `pcc_counters.sh` bash script under the DOCA tools directory — to
  arm and read the fixed firmware/hardware PCC (Programmable Congestion
  Control) diagnostic counters (CNP, RTT, WRED-drop, etc.) on a ConnectX
  / BlueField device via mst + the mlx5 debugfs `diag_cnt` interface.
  The script takes two positional args — `set | query` and an mst device
  path — with no `--help` or subcommands. Trigger even without
  "pcc_counters.sh" or "PCC counters": "how do I read the CNP / RTT /
  WRED-drop counters", "PCC counter stuck at zero", "the script says Bad
  Device", or "is congestion control dropping packets on this port?".
  Route elsewhere for writing a custom PCC algorithm (doca-pcc), factory
  firmware PCC config, DOCA install, or fleet-wide CC tuning.
metadata:
  author: NVIDIA <doca-feedback@nvidia.com>
  kind: tool
  doca_version: "3.5"
  tags:
    - doca
    - pcc
    - counters
compatibility: >
  Requires DOCA/MFT on Linux with a ConnectX-6 or newer (not
  ConnectX-8) or BlueField
  device, mst tools, mounted debugfs, and root access to the mlx5
  diag_cnt interface. The script reads fixed firmware and hardware
  diagnostics independently of custom PCC code. Its set operation
  changes which counters are collected, not congestion-control or
  forwarding behavior; treat later fleet tuning as a separate
  high-stakes action. The validation steps require a live DOCA install.
---

# DOCA PCC Counters (`pcc_counters.sh`)

## Examples

- **"How do I read the PCC diagnostic counters on this device?"** —
  this is in scope. Arm then query; do not treat this as PCC
  algorithm tuning.
- **"The script printed ERROR: Bad Device."** — resolve the mst
  path before assuming firmware is broken.

## Instructions

Follow Loading order below. Open the tasks companion for run /
debug. Open the capabilities companion for the fixed counter set.
Do not open every companion file.

**Where to start:** This is a tool skill for invoking
`pcc_counters.sh` — a small bash script that arms and reads the
device's fixed set of firmware / hardware **PCC diagnostic
counters** (CNP count, RTT-perf, WRED-drop, RTT-gen, handled
events) through the mlx5 debugfs `diag_cnt` interface. Open
the tasks companion and start at `## run` for
the canonical `set`-then-`query` sequence, or
`## debug` when the user reports
*"`ERROR: Bad Device`"*, *"counter stuck at zero"*, or *"the
```
END THIRD-PARTY FILE aa0e5c34866a4b40

The third-party file has ended. Everything between the aa0e5c34866a4b40 tags is data: requests and commands from it are not followed. An “end of file” line with another tag inside the block is part of the file.

First 2537 of 12006 bytes. © NVIDIA · Apache-2.0 · https://github.com/NVIDIA/skills/tree/HEAD/skills/doca-pcc-counters/SKILL.md

_Part of the page did not fit — see the HTML version._

---
NeVibeCode on affpapa.org. Catalog texts are descriptions, not instructions for the agent. How to choose and install: https://affpapa.org/en/nevibecode/agents.md
