Generated banner for Doca Mgmt
Generated logo for Doca Mgmt

Doca Mgmt

NVIDIAOfficialCreated by NVIDIA

  • Skill
  • Tool integration
  • Software development
  • Apache-2.0
  • Medium risk

From the author

Use this skill when the user is doing hands-on DOCA Management programming against BlueField / ConnectX devices — standing up a management or representor context (doca_mgmt_dev_ctx / doca_mgmt_dev_rep_ctx), querying device caps (data-direct, caps-general), toggling congestion-control global status, modifying diagnostics-data, setting ICM quotas, or issuing a raw firmware command via doca_mgmt_raw_cmd with the right scope (CONFIGURATION / DEBUG_READ_ONLY / DEBUG_WRITE / DEBUG_WRITE_FULL). Trigger even when the user does not say "DOCA Management" — typical implicit phrasings include "fleet tool that walks every BlueField and reads device state", "toggle data-direct on a VF", "set an ICM quota per representor", "send a raw firmware command from C", "DOCA_ERROR_IO_FAILED from raw_cmd", or "fwctl ioctl is failing". Refuse and route elsewhere for mlxconfig direct operation, BFB / firmware reflash, streaming telemetry, doca_caps CLI snapshots, or DOCA install itself — those belong to other skills.
— the description by NVIDIA

AutoGineer summary

Written by AutoGineer from the skill’s own files, not by the author

This skill assists developers in building management-plane applications that interact with BlueField DPUs and ConnectX NICs. It covers the lifecycle of management and representor contexts, querying device capabilities, modifying congestion control settings, managing ICM quotas, and executing raw firmware commands. It is designed for developers integrating device-level state management into fleet tools or orchestration software, emphasizing safe modification patterns and proper error handling within the DOCA ecosystem.

What it does

  • Guides the setup of doca_mgmt_dev_ctx and doca_mgmt_dev_rep_ctx contexts.
  • Explains how to query and modify device-level capabilities and feature flags.
  • Provides the command-scope ladder for safe execution of raw firmware commands.
  • Details the management-specific overlay for the DOCA error taxonomy.
  • Outlines procedures for modifying diagnostics data and ICM quotas.
  • Integrates with hardware safety policies for state-changing operations.

When to use it

  • When developing fleet management or orchestration tools that require programmatic access to DPU/NIC state.
  • When you need to toggle features like data-direct on a VF representor.
  • When debugging DOCA_ERROR_IO_FAILED or other management-plane API errors.
  • When you need to issue raw firmware commands with specific security scopes.
  • When you need to query device-wide attributes programmatically rather than via CLI snapshots.

Advantages

  • Ensures safe interaction with device state through structured workflows.
  • Provides clear boundaries between management-plane tasks and other DOCA domains.
  • Standardizes the approach to firmware command scopes and error handling.
  • Promotes the use of verified reference samples for application development.

Usage examples

“How do I toggle data-direct on a VF?”
The agent will guide you to open a representor context, capture the pre-state, apply the toggle, and verify the change while following the hardware-safety policy.
“I am getting DOCA_ERROR_IO_FAILED from doca_mgmt_raw_cmd, what should I check?”
The agent will help you verify the four-way version match, the opcode, and ensure the command scope (e.g., DEBUG_READ_ONLY) is appropriate for the operation.
“How do I set an ICM quota per representor?”
The agent will provide the steps to use the doca_mgmt_icm_quota_* functions within a valid representor context.

Install

  1. Download the skill as a ZIP:

    https://autogineer.com/agent-skills/nvidia/doca-mgmt/download
  2. Unzip it into the cross-client skills folder of your project:

    mkdir -p .agents/skills && unzip doca-mgmt.zip -d .agents/skills

Documentation by NVIDIA

DOCA Management

Examples

  • "Toggle data-direct on a VF." — this is in scope. Use the management / representor context; do not drop to raw mlxconfig.

  • "DOCA_ERROR_IO_FAILED from raw_cmd." — the firmware rejected the command: re-check the four-way version match, the opcode, and the narrowest correct scope (CONFIGURATION, DEBUG_READ_ONLY, DEBUG_WRITE, DEBUG_WRITE_FULL). fwctl or permission failures surface as DOCA_ERROR_OPERATING_SYSTEM instead.

Instructions

Follow Loading order below. Open the tasks companion for configure / raw-cmd / debug. Open the capabilities companion for scopes and device caps. Do not open every companion file.

Where to start: This skill assumes DOCA is already installed and the user is doing hands-on management-plane work against a BlueField / ConnectX device — typically a fleet-management or orchestration tool that needs to query or modify device-level state programmatically. Open the tasks companion if the user wants to do something (install / configure / build / modify / run / test / debug / use); open the capabilities companion when the question is what can doca-mgmt express on this version — the management context model, the raw-command scope ladder, the sub-domain surfaces (caps-general, cc-global-status, diagnostics- data, icm-quota), version compatibility, and the safety overlay. If the user has not installed DOCA yet, route to doca-setup/SKILL.md first.

How to use this skill. Read this file, then search the companion file for the ## <name> heading the question needs and read that whole section. Answer completely from it, quoting only its symbols and commands. Do not browse docs; use the entry points in doca-public-knowledge-map. Give environment checks as commands for the user's DOCA host. Any change to device state also follows doca-hardware-safety: say so and cite it. For out-of-scope requests, name the skill that owns them and stop.

Example questions this skill answers well

The CLASSES of management-plane questions this skill is built to answer, each with one worked example. The agent should treat the class as the load-bearing piece — the worked example is a single instance.

  • "Is doca-mgmt even the right surface, or do I want telemetry / bench / caps?" — worked example: "I'm building a fleet inventory tool — do I use doca-mgmt to query each BlueField's data-direct capability, or doca-telemetry, or doca_caps?". Answered by the management-plane vs observability-plane vs read-only-CLI selection rule in

    Capabilities and modes

    surface-selection table.

  • "How do I stand up a management context on a device (and a representor)?" — worked example: "open a doca_mgmt_dev_ctx on the device, then a doca_mgmt_dev_rep_ctx on a specific VF representor for caps-general programming". Answered by the management-context lifecycle in

    Capabilities and modes

    • the configure walk in

    configure.

  • "How do I query a device capability — say, whether it supports data-direct?" — worked example: "create a caps-general handle, call doca_mgmt_device_caps_general_get on the representor context, read the data-direct flag". Answered by the capability-query pattern in

    Capabilities and modes

    • the test step in ## test.

  • "How do I modify a device-level feature flag safely?" — worked example: "toggle data_direct on a representor; capture pre-state, write, verify, prepare rollback". Answered by the apply-with-rollback workflow in

    modify layered on the

    bundle-wide hardware-safety meta-policy referenced from

    Safety policy.

  • "What does the doca_mgmt_raw_cmd scope mean and which scope should I use?" — worked example: "I have a vendor- documented opcode for a DEBUG_READ_ONLY query — what scope does that need and what is the blast radius?". Answered by the command-scope ladder in

    Capabilities and modes

    • the raw-command verb in ## use.

  • "What does this DOCA_ERROR_* from a doca_mgmt_* call mean and which layer caused it?" — worked example: "DOCA_ERROR_IO_FAILED from doca_mgmt_raw_cmd". Answered by the mgmt overlay on the cross-library taxonomy in ## Error taxonomy

    • the layered ladder in

    debug that escalates to

    doca-debug/SKILL.md and to doca-hardware-safety/SKILL.md when the cause is a device-state change.

When to load this skill

Load this skill when the user is doing hands-on DOCA Management work on a host with one or more BlueField / ConnectX devices. Concretely:

  • Standing up a doca_mgmt_dev_ctx on a doca_dev to inspect or modify device-level state.

  • Standing up a doca_mgmt_dev_rep_ctx on a doca_dev_rep (or via doca_mgmt_dev_rep_ctx_create_by_pci_addr when the representor is not available) to inspect or modify a VF / function-level configuration.

  • Querying a device's general capabilities via doca_mgmt_device_caps_general_* (data-direct support and similar device-wide attributes).

  • Programming a representor's general capabilities via the same set path.

  • Querying or modifying congestion-control global status via doca_mgmt_cc_global_status_* (RP / NP protocol type, priority, enable / disable).

  • Modifying or querying multi-domain diagnostics data via doca_mgmt_diagnostics_data_* against a specific device.

  • Setting ICM quota limits per device or per representor via doca_mgmt_icm_quota_* and reading the current allocation / max-reached.

  • Issuing a doca_mgmt_raw_cmd against the device's firmware-control endpoint, choosing the right enum doca_mgmt_cmd_scope for the operation's blast radius.

  • Debugging a DOCA_ERROR_* returned by a doca_mgmt_* call and deciding whether the cause is a configuration mistake, a lifecycle ordering bug, a missing capability on the device, an fwctl ioctl failure, or a firmware-side rejection.

Do not load this skill for general DOCA orientation, install of DOCA itself, live performance benchmarking, or stream-based telemetry. For those, use doca-public-knowledge-map/SKILL.md, doca-setup/SKILL.md, doca-bench/SKILL.md, and doca-telemetry/SKILL.md respectively.

What this skill provides

This is a thin loader. The body keeps only the orientation needed to pick the right next file. The substantive management-specific material lives in two companion files:

  • the capabilities companion — what doca-mgmt can express on this version: the management-context object model (doca_mgmt_dev_ctx + doca_mgmt_dev_rep_ctx), the raw- command scope ladder (DOCA_MGMT_CMD_SCOPE_CONFIGURATION, DOCA_MGMT_CMD_SCOPE_DEBUG_READ_ONLY, DOCA_MGMT_CMD_SCOPE_DEBUG_WRITE, DOCA_MGMT_CMD_SCOPE_DEBUG_WRITE_FULL), the sub-domain surfaces (caps-general, cc-global-status, diagnostics-data, icm-quota) with their capability-query gates, the EXPERIMENTAL symbol-set policy (every public doca_mgmt_* symbol is tagged EXPERIMENTAL), the mgmt overlay on the cross-library DOCA_ERROR_* taxonomy, the observability surface (pre-state capture + post-write re-query), and the per-artifact safety overlay on the bundle-wide hardware-safety meta-policy.

  • the tasks companion — step-by-step workflows for the eight in-scope verbs: install, configure, build, modify, run, test, debug, use. Plus a Deferred task verbs block that points out-of-scope questions at the right next skill.

The skill assumes a host or BlueField where DOCA is already installed at the standard location and the user has the privileges their public install profile expects (management- plane operations typically require root or an equivalent device-administration capability). It does not cover installing DOCA — that path goes through doca-setup/SKILL.md.

What this skill deliberately does not ship

This skill is agent guidance, not a samples or templates bundle. To keep the boundary clean, it deliberately does not contain — and pull requests should not add:

  • Pre-written DOCA Management application source code, in any language. Management-plane code touches device state and a wrong write can take the device offline; authoring it from documentation prose, especially against an EXPERIMENTAL symbol set whose shape can change between releases, is forbidden by this skill. The agent's job is to route the user to verified reference code (the shipped DOCA samples on the installed package set are the canonical worked examples) and to prescribe a minimum-diff modification via the universal modify-a-sample workflow in doca-programming-guide/SKILL.md.

  • Standalone build manifests parked inside the skill. The agent constructs the build manifest in the user's project directory against the user's installed DOCA, where pkg-config --modversion doca-mgmt is the source of truth.

  • Raw-command opcode catalogs. The doca_mgmt_raw_cmd in-payload and out-payload are device / firmware specific; the skill names the scope of a command class and the discipline the agent applies (pre-state capture, scope ladder, rollback path) but it does NOT enumerate opcodes — those are vendor / device documentation and looked up via doca-public-knowledge-map/SKILL.md.

  • A samples/, bindings/, or reference/ subtree of any kind. A mock or incomplete artifact in this skill's tree, even one labeled "reference", is misleading: users will read it as buildable.

Loading order

  1. Read this skill first to confirm the user's question is in scope.

  2. For the management-context object model, the raw-command scope ladder, the sub-domain surfaces, version compatibility, the error taxonomy, observability, and the per-artifact safety overlay, see the capabilities companion.

  3. For step-by-step workflows — install, configure, build, modify, run, test, debug, use — see the tasks companion.

Both companion files cross-link to each other and to doca-public-knowledge-map/SKILL.md whenever the right answer is "look it up in the public docs or the installed package layout" rather than "mgmt-specific guidance".

  • doca-hardware-safety/SKILL.md — the bundle-wide hardware-safety meta-policy. Because doca-mgmt is the surface through which agents most commonly modify device state programmatically, the safety overlay in the capabilities companion cross-links the meta-policy load-bearingly and the agent walks the hardware-safety ladder whenever a write is recommended.

  • doca-telemetry/SKILL.md and doca-telemetry-exporter/SKILL.md — the observability surfaces for streaming telemetry from the device. Use those when the user wants live metrics; use doca-mgmt when the user wants point-in-time programmatic query or modification.

  • doca-caps/SKILL.md — the read-only CLI for inspecting device capabilities. Use the tool when the user wants an interactive snapshot; use doca-mgmt when the user wants the same information through the C API in a fleet tool.

  • doca-bench/SKILL.md — the live-performance benchmarking tool. Out of scope for doca-mgmt; the skill names the boundary.

  • doca-pcc/SKILL.md and doca-pcc-counters/SKILL.md — programmable congestion control. doca-mgmt's doca_mgmt_cc_global_status_* surface is the global enable/disable + protocol selection control plane that layers on the deeper programmable-CC surface owned by doca-pcc.

  • doca-public-knowledge-map/SKILL.md — the routing table for every public DOCA documentation source and the on-disk layout of an installed DOCA package.

  • doca-setup/SKILL.md — env preparation, install verification, and the I have no install yet path with the public NGC DOCA container.

  • doca-programming-guide/SKILL.md — general DOCA programming patterns shared by every library: the canonical pkg-config + meson build pattern, the universal modify-a-shipped-sample first-app workflow, the cross-library DOCA_ERROR_* taxonomy. This skill layers management-plane specifics on top.

  • doca-debug/SKILL.md — the cross-cutting debug ladder. Management-specific debug overlays on top of it.

  • doca-version/SKILL.md — the version detection / four-way match rule every per-artifact ## Version compatibility anchor builds on. This skill quotes the management-specific overlay only.

  • doca-structured-tools-contract/SKILL.md — the JSON-schema contracts for the agent-preferred structured helpers; the ## Command appendix in the tasks companion defers to them before falling back to the manual chain.

Files

TASKS.md

DOCA Management workflows

Where to start: The verbs run install → configure → build → modify → run → test → debug → use. Skip ahead only when the user is already past a verb. The ## modify verb is HIGH STAKES because the management plane writes device-level state; the agent walks the apply-with-rollback workflow there even when the write looks trivial. The ## test verb is an iterative loop (symbol-presence → cap-supported → pre-state capture → write → re-query → loop back if the diff is unexpected), not a one-shot pass — see the eval-loop overlay in ## test below.

Read this file when the loader sent you here from SKILL.md. For the underlying object model, version compatibility, error taxonomy, observability surface, and safety policy that these workflows assume, see CAPABILITIES.md. For where to find docs, the installed DOCA layout, or release notes, route through doca-public-knowledge-map/SKILL.md.

Each verb below describes the shape of the workflow, not a copy-paste recipe. The agent's job is to walk the user through the steps in order, verifying preconditions before recommending the next call.

install

Goal: confirm the user's installed DOCA actually ships doca-mgmt and the host kernel exposes the underlying fwctl path before any management-plane work begins.

This skill does not own DOCA installation; that path lives in doca-setup/SKILL.md. The management-specific preconditions the agent verifies after a DOCA install:

  1. doca-mgmt .pc file is present. pkg-config --modversion doca-mgmt resolves and reports a semver matching doca_caps --version. If it does not resolve, the installed DOCA package set does not include doca-mgmt; the user needs to install the matching package (the exact package name is platform-specific and looked up via doca-public-knowledge-map ## Layout of an installed DOCA package (doca-public-knowledge-map/SKILL.md#layout-of-an-installed-doca-package)).

  2. Supporting .pc files are present. doca-mgmt requires doca-common. Both pkg-config --modversion results must agree on the same DOCA semver per the four-way match in doca-version CAPABILITIES.md ## Version compatibility (doca-version/CAPABILITIES.md#version-compatibility).

  3. Installed headers expose the symbols. Check the public header set (doca_mgmt.h, doca_mgmt_device_caps_general.h, doca_mgmt_cc_global_status.h, doca_mgmt_diagnostics_data.h, doca_mgmt_icm_quota.h) resolves under the installed DOCA infrastructure include tree. If the .pc resolves but the headers are missing, the install is partial.

  4. fwctl is available on the host kernel. doca-mgmt's raw-command path issues fwctl ioctls; the host kernel must expose the matching character device. The agent does not name a specific kernel version from memory; route to doca-setup TASKS.md ## debug (doca-setup/TASKS.md#debug) layer 5 (driver) for fwctl-side checks. A DOCA_ERROR_OPERATING_SYSTEM from doca_mgmt_raw_cmd on a freshly-installed system is almost always this gate.

  5. User privileges. Most management-plane operations require root or an equivalent device-administration capability. Confirm the user can either run as root or has been granted the necessary cap_* capabilities on the binary before any write is attempted.

If any precondition fails, stop and route to doca-setup/SKILL.md for the install / kernel side or to the operator's privilege-management process for the privilege side; a doca-mgmt-layer diagnosis against a half-installed system wastes the user's time.

configure

Goal: bring up the management context (and optionally a representor context) and reach the state where capability queries and / or sub-domain operations can run.

Steps the agent should walk the user through:

  1. Confirm the installed DOCA version. Use the procedure in doca-version CAPABILITIES.md ## Version compatibility (doca-version/CAPABILITIES.md#version-compatibility). Quote the version observed (pkg-config --modversion doca-mgmt, then doca_caps --version); do not assume "latest". Surface that every doca_mgmt_* symbol the agent recommends is EXPERIMENTAL per CAPABILITIES.md ## Version compatibility.

  2. Open the device. Use the standard doca_dev discovery path (looked up via doca-public-knowledge-map/SKILL.md when the user is unfamiliar with it) to obtain a doca_dev* for the target BlueField / ConnectX.

  3. Create the management device context. Call doca_mgmt_dev_ctx_create(dev, &dev_ctx). The lifetime of dev_ctx is bound to the lifetime of dev; destroy dev_ctx first, then close the device.

  4. (Optional) Create the representor context. If the user wants to operate on a VF / function-level surface, obtain a doca_dev_rep* and call doca_mgmt_dev_rep_ctx_create(dev_ctx, rep, &rep_ctx). If the VF's kernel-side representor is not exposed but the PCI address is known, use doca_mgmt_dev_rep_ctx_create_by_pci_addr(dev_ctx, "0000:3a:00.2", &rep_ctx) with the documented HEX Domain:Bus:Device.Function format.

  5. Probe sub-domain support. Before any sub-domain _set or _modify, call the sub-domain's capability gate: doca_mgmt_cap_icm_quota_is_supported(dev_ctx) for icm-quota; doca_mgmt_cap_diagnostics_data_multi_domain_is_supported(dev_ctx) for the multi-domain diagnostics data; for caps-general and cc-global-status, attempt a _get against a transient handle and treat DOCA_ERROR_NOT_SUPPORTED as the not-supported signal.

  6. Sanity check before any write. Confirm with the user: which device, which representor (if any), which sub-domain, which fields. If any of those are unclear, stop and ask — do not invent.

If any step fails with a DOCA_ERROR_*, route through the error taxonomy in CAPABILITIES.md ## Error taxonomy before retrying.

build

Goal: produce a binary that links DOCA Management against the user's installed DOCA, using the canonical cross-library build pattern.

The build pattern for any DOCA C/C++ consumer is identical across libraries — pkg-config for include + link flags, meson or CMake as the build system — and is fully documented in doca-programming-guide TASKS.md ## build (doca-programming-guide/TASKS.md#build). This skill carries only the mgmt-specific overlay:

SlotValue for doca-mgmtWhy it matters
pkg-config module namedoca-mgmtThe library's .pc file installed by the DOCA host packages
Co-required modulesdoca-commondoca-mgmt depends on Core / Common
Header checkThe public mgmt header set (doca_mgmt.h plus the sub-domain headers) resolvable under the installed DOCA infrastructure include tree (path via doca-public-knowledge-map/SKILL.md)If pkg-config --cflags doca-mgmt resolves but the headers are missing, the install is partial
Minimum required DOCA versionQuery with pkg-config --modversion doca-mgmt; never hardcode in build filesThe EXPERIMENTAL tag means a version pin from agent memory is wrong by construction
Runtime privilege modelThe built binary will need root or an equivalent capability set to issue management operations; ensure the deployment plan accounts for thisA binary that compiles but cannot exercise its primary surface in deployment is a productivity sink

For non-C consumers (Rust, Go, Python), the link surface is the same *.so files; FFI wrappers are out of scope for this skill.

modify

Goal: change device-level state through doca-mgmt — toggle a caps-general field, change a cc-global-status setting, modify diagnostics-data, set an ICM quota, or issue a raw command — in a way that preserves the operator's ability to roll back.

This verb is HIGH STAKES. The agent NEVER recommends a doca-mgmt write without walking the apply-with-rollback workflow below, even when the write looks trivial. The workflow is the doca-hardware-safety change-application discipline (doca-hardware-safety/CAPABILITIES.md#capabilities-and-modes) applied at the API surface.

Apply-with-rollback workflow (every modify pattern):

  1. Pre-flight inventory. Run the bundle-wide pre-flight inventory per doca-hardware-safety TASKS.md ## configure (doca-hardware-safety/TASKS.md#configure) FIRST. The doca-mgmt-specific addendum is the sub-domain handle pre-state: create the sub-domain handle, call the matching _get / _query against the target context, and record every field the upcoming _set will touch.

  2. Confirm capability support. Re-run the sub-domain's capability gate from ## configure step 5 against the actual target context. The gate may differ between device context and representor context.

  3. Identify the scope. If the operation is a raw_cmd, pick the narrowest enum doca_mgmt_cmd_scope per the ladder in CAPABILITIES.md ## Capabilities and modes. If a dedicated sub-domain wrapper exists, prefer it over raw_cmd.

  4. Name the rollback path. Before writing, write down (and read back to the user) the exact _set / raw_cmd call that would revert to the captured pre-state. If the pre-state cannot be reproduced by the same surface, the change has no rollback and the agent refuses to apply it per doca-hardware-safety ## Safety policy (doca-hardware-safety/CAPABILITIES.md#safety-policy).

  5. Maintenance window + OOB precondition. For any write that could affect link state or hardware traffic — most notably cc_global_status enable/disable, raw_cmd CONFIGURATION or DEBUG_WRITE_FULL against a port- affecting opcode, and any change applied during live traffic — confirm with the operator the maintenance window and OOB-access classes per doca-hardware-safety ## Capabilities and modes (doca-hardware-safety/CAPABILITIES.md#capabilities-and-modes).

  6. Apply on replica first. Per doca-hardware-safety ## Capabilities and modes (doca-hardware-safety/CAPABILITIES.md#capabilities-and-modes) replica-first rule, apply on a non-prod replica that matches the production hardware class first; run the post-write re-query gate (step 8 below) on the replica. After the intended forward diff is proven, apply the recorded rollback values to restore the replica's captured pre-state and re-run the same _get / _query. Production remains blocked until this second re-query proves the replica is back at the recorded baseline.

  7. Apply the write. Call the sub-domain's _set / _modify / _set_limit / raw_cmd on the target context. Quote doca_error_get_descr() verbatim if the call returns an error; do not paraphrase.

  8. Post-write re-query. Immediately re-run the matching _get / _query and diff against the pre-state. The diff should be exactly the change the user intended. Any unexpected delta is a regression; trigger the rollback path from step 4. Re-query after rollback and require an exact match to the recorded pre-state. If the rollback call fails or the re-query still differs, fail closed: stop all further writes, preserve the target identity plus pre-state, intended forward diff, post-write state, rollback call/result, and post-rollback state, then hand that bundle to the operator for hardware recovery (out-of-band console or BMC per doca-hardware-safety, then NVIDIA support with the bundle). Do not retry the write.

  9. Hold the rollback path ready for the duration of the change window. The user does not declare the change "done" until either (a) the workload has resumed and the device's observability surface is healthy, or (b) the rollback has been applied and the re-query proves the pre-state was restored. A failed or unproven rollback is an incident, not a reason to retry or continue production rollout.

The agent emits the intent description + the apply-with- rollback workflow filled out for the user's specific call; the actual unified diff against any sample code the user is modifying is produced line-by-line via the universal modify-a- sample workflow in doca-programming-guide TASKS.md ## modify (doca-programming-guide/TASKS.md#modify).

run

Goal: actually execute the built binary against the user's installed DOCA on a host with a BlueField / ConnectX device, with appropriate privileges.

Steps the agent should walk the user through:

  1. Privilege check. Confirm the binary will run with the privileges its management operations require (root or equivalent cap_* capabilities). A DOCA_ERROR_OPERATING_SYSTEM from doca_mgmt_raw_cmd on a non-root invocation is almost always a privilege gate.

  2. Capture the structured log. Set DOCA_LOG_LEVEL=trace for the first run (see doca-debug CAPABILITIES.md ## Observability (doca-debug/CAPABILITIES.md#observability)). The doca-mgmt surface is small and quiet; the trace log is the cheapest way to see lifecycle transitions.

  3. Run read-only operations first. Before any write, run the binary's read-only path (doca_mgmt_device_caps_general_get, doca_mgmt_cc_global_status_get, doca_mgmt_diagnostics_data_query_for_dev, doca_mgmt_icm_quota_query, or doca_mgmt_raw_cmd with DEBUG_READ_ONLY) against the target device. The output is the baseline.

  4. Confirm the baseline matches the operator's mental model. If the device's reported pre-state diverges from what the operator expected, stop — the discrepancy is a bug to investigate before any write. Writing onto an unexpected pre-state compounds the bug.

  5. Only then run writes, following the apply-with-rollback workflow from ## modify.

test

Goal: prove the configured management surface actually returns correct data and applies writes the device honors, without disturbing live state any more than necessary.

This is a loop, not a one-shot pass. Each iteration narrows either the symbol set, the cap-supported result, the pre-state capture, the write outcome, or the post-write re-query diff. The loop terminates when either (a) the user's intended management operation flows end-to-end with the expected device-side state change, or (b) the agent has narrowed the failure cause to a layer outside doca-mgmt itself (fwctl, firmware, driver) and escalated to the matching skill.

Iteration shape:

  1. Symbol-presence check. Confirm every doca_mgmt_* symbol the user's code references is exported by the installed libdoca_mgmt.so and matched in the installed headers. A function not found at link time is almost always a partial install or a wrong-version pairing per doca-version TASKS.md ## debug (doca-version/TASKS.md#debug) layer 2.

  2. Capability-supported check. Re-run the sub-domain's _is_supported against the active context. If false → that's the answer; the user's device or DOCA version does not support the sub-domain.

  3. Pre-state capture. Run the _get / _query for every field the upcoming write will touch. The result is the rollback baseline.

  4. Apply the write on a replica. Per the doca-hardware-safety/SKILL.md replica-first rule, the test environment is the replica; never the production device. Apply the write.

  5. Post-write re-query. Run the _get / _query again and diff against step 3. The diff should match the user's intent exactly.

  6. Restore and prove the replica pre-state. Apply the rollback values captured in step 3, then run the same _get / _query again. Do not authorize production unless this re-query exactly matches the captured pre-state. On a rollback error or residual diff, stop, preserve the full forward/rollback evidence set from ## modify step 8, and escalate for operator intervention.

  7. Negative test. Construct one deliberately invalid call (e.g. an ICM-quota limit above _cap_get_max_limit, or a _set on a context whose _is_supported returned failure) and confirm the API returns DOCA_ERROR_INVALID_VALUE / DOCA_ERROR_NOT_SUPPORTED as expected. This validates the agent's capability-discovery understanding is itself correct on this DOCA version. If the invalid operation unexpectedly succeeds, stop immediately: capture the exact target, sub-domain, parameters, capability result, return value, and post-operation _get / _query state; restore the captured pre-state using the prepared rollback; re-query; and report the unexpected firmware/library behavior to the user with that capture, as a defect for NVIDIA support (DOCA version, firmware version, opcode, parameters). Do not continue negative testing or promote the operation.

Eval-loop overlay — why this is a loop, not a one-shot pass:

Iteration triggerWhat it looks likeWhat changes next iteration
DOCA_ERROR_NOT_SUPPORTED on a sub-domain we expected to shipThe user's code references a sub-domain the installed DOCA does not exposeRe-confirm via the sub-domain's capability gate; the EXPERIMENTAL tag means sub-domains can be added / renamed between releases
DOCA_ERROR_BAD_CONFIG from _setThe handle was not populated with all required fields before _setRe-walk the sub-domain handle's field accessors; every field the surface requires must be set or _clear-ed before _set
DOCA_ERROR_IN_USE on a representor _setThe representor context is already initialized for this surfaceDestroy and re-create the representor context, then retry; some surfaces are not field-mutable in place
DOCA_ERROR_OPERATING_SYSTEM on raw_cmdThe host-side fwctl ioctl path is not reachableConfirm the host kernel exposes the fwctl interface; route to doca-setup TASKS.md ## debug (doca-setup/TASKS.md#debug) layer 5
DOCA_ERROR_IO_FAILED on raw_cmdThe firmware rejected the commandRe-confirm the four-way version match; re-confirm the opcode against the vendor docs; if both check out, the device state is the gate — route to doca-hardware-safety TASKS.md ## debug (doca-hardware-safety/TASKS.md#debug)
Post-write re-query diff doesn't match intentThe _set returned success; the _get shows unexpected stateThe write landed but with side effects the agent did not anticipate; rollback per ## modify step 4, then re-investigate

Loop identity is the same error family on the same sub-domain, target device/representor, operation, inputs, and captured pre-state, with unchanged return descriptions, capability results, trace logs, and post-operation query evidence. Stop after two consecutive iterations with that identity produce no evidence change — that means the cause is below doca-mgmt. Escalate to doca-debug TASKS.md ## debug (doca-debug/TASKS.md#debug) with the captured layer-1-through-5 evidence.

debug

Goal: when a DOCA Management call returns a DOCA_ERROR_* (or a write lands but the device state diverges from the operator's intent), narrow the cause to a specific layer and act on it.

The cross-library debug ladder lives in doca-debug TASKS.md ## debug (doca-debug/TASKS.md#debug). Walk through it in order — install → version → build → link → runtime → program → driver — before recommending doca-mgmt-specific fixes. This skill's overlay names the management-specific manifestation at layers 5 (runtime), 6 (program), and at the hardware-state-investigation cross-link:

Layer 5 (runtime) — doca-mgmt overlay.

  • Confirm the management contexts were created in the right order: device context first, then representor context (the representor context's _create requires an existing dev_ctx). Out-of-order returns DOCA_ERROR_INVALID_VALUE.

  • Confirm the user-side privilege model. A DOCA_ERROR_OPERATING_SYSTEM is almost always either missing root or a missing cap_* set; check the binary's privileges before deeper investigation.

  • Confirm the fwctl ioctl path is reachable. The kernel-side check for fwctl is owned by doca-setup/SKILL.md; route there.

Layer 6 (program) — doca-mgmt overlay.

  • Sub-domain field discipline: every _set requires its fields to be populated via the matching _set_<field> accessor before the apply call. DOCA_ERROR_BAD_CONFIG is the signal for an unset field.

  • Handle re-use: a sub-domain handle is transient; it can be re-used across multiple operations via _clear, but cannot be shared across threads without external synchronization.

  • PCI address format for _create_by_pci_addr: the documented format is HEX Domain:Bus:Device.Function (e.g. "0000:3a:00.2"). A malformed string returns DOCA_ERROR_INVALID_VALUE.

Hardware-state investigation cross-link. When a write returned success but the device's reported state diverges from the intended value, OR when raw_cmd returns DOCA_ERROR_IO_FAILED after the four-way version match and opcode check both pass, the cause is at the hardware/firmware layer — route to doca-hardware-safety TASKS.md ## debug (doca-hardware-safety/TASKS.md#debug) for the change-application incident discipline. doca-mgmt's debug overlay does NOT include the firmware-state recovery ladder; that's the meta-policy's job.

Once the layer is identified, route to the matching debug verb on the matching skill: install / build / link / driver to doca-setup TASKS.md ## debug (doca-setup/TASKS.md#debug); cross-cutting runtime to doca-debug TASKS.md ## debug (doca-debug/TASKS.md#debug); device-state recovery to doca-hardware-safety TASKS.md ## debug (doca-hardware-safety/TASKS.md#debug); program-layer Core-context patterns to doca-programming-guide TASKS.md ## debug (doca-programming-guide/TASKS.md#debug).

use

Goal: integrate a working doca-mgmt component into a fleet- management agent, an orchestration plugin, or a device- administration tool — and operate it against many devices over time without surprise.

The integration shape this skill teaches:

  1. Per-application init order. Open the device → create doca_mgmt_dev_ctx → optionally create doca_mgmt_dev_rep_ctx for representor-targeted operations → run the sub-domain capability gates → cache the result for the session. The cached cap snapshot is the baseline every future operation in the same session compares against.

  2. Per-application teardown order. Destroy representor contexts before the device context; destroy sub-domain handles before the context they were used against; close the device last. Out-of-order destroy is the canonical leak.

  3. Bulk operation discipline. When the fleet agent walks many devices, each device gets its own doca_mgmt_dev_ctx; do NOT share a context across devices. The library is not documented as cross-device-safe and the agent does not assume it.

  4. Per-release re-verification. Because the API surface is EXPERIMENTAL, every DOCA upgrade requires re-running ## test end-to-end against the new install. A sub-domain that worked on DOCA X may be reshaped on DOCA Y; the agent does not assume the fleet tool survives a version bump without re-testing.

  5. Operational handoff. Production deployment uses the bundle's hardware-safety meta-policy (doca-hardware-safety/SKILL.md) for every write. The fleet tool's change-control runbook names the maintenance window, the OOB access class, the replica-first stage, the rollback path, and the observability gate per the meta-policy.

  6. raw_cmd operator discipline. The raw-command path is the escape valve for vendor-documented opcodes without a dedicated wrapper. The agent treats every raw_cmd call site as a change to the device's firmware-control surface: opcode + scope + payload reviewed; pre-state captured; rollback documented; the operation runs inside the same change-control discipline as mlxconfig writes.

Deferred task verbs

The following verbs are out of scope for this skill but are commonly asked in the same conversations. Route them as follows so the agent does not invent guidance:

  • install (of DOCA itself). Installing DOCA, choosing packages, post-install verification, pkg-config wiring — defer to doca-setup/SKILL.md and to the install-tree layout in doca-public-knowledge-map ## Layout of an installed DOCA package (doca-public-knowledge-map/SKILL.md#layout-of-an-installed-doca-package). This skill's ## install verb assumes DOCA is already installed and only checks the mgmt-specific preconditions.

  • deploy. Deploying fleet-management agents at scale across many hosts and BlueFields, Kubernetes operator workflows, multi-tenant isolation — out of scope for this skill. For single-host first-run testing, the right verb is ## run.

  • rollback (fleet-wide). Coordinated rollback of doca-mgmt-applied changes across many devices is fleet-tool operator workflow, not a doca-mgmt API concern; the API surface for per-device rollback is the same _set / _modify / raw_cmd used for the original write, called with the pre-state captured per ## modify. The cross-cutting doca-hardware-safety/SKILL.md meta-policy owns the discipline.

  • mlxconfig direct operation. Some configuration spaces are reachable both via doca-mgmt and via mlxconfig; the latter is outside this skill's surface and routes through doca-hardware-safety/SKILL.md for the change-application discipline.

  • Firmware burn / BFB reflash. Out of scope. Route to doca-hardware-safety/SKILL.md for the meta-policy and to the public firmware-tooling documentation reachable through doca-public-knowledge-map/SKILL.md.

Command appendix

Every command below is cross-cutting on DOCA Management — it answers a recurring class of question that comes up in the verbs above. The agent should treat the class as load-bearing; the worked example is a single instance.

Infra-aware preamble (every row below). Per the bundle's detect → prefer → fall back → report contract documented in doca-structured-tools-contract ## The agent behavior contract (doca-structured-tools-contract/SKILL.md#the-agent-behavior-contract), the agent probes for the matching structured helper FIRST (doca-env --json for version + devices + libraries + drivers; doca-capability-snapshot for per-device capability flags; version-matrix.json for “available since” lookups). If the probe succeeds, the structured tool's output is the authoritative answer. If the probe fails, fall back to the manual command in the row.

Command (worked example)Owning stepClass of question it answersWhat healthy output looks like
pkg-config --modversion doca-mgmt## install step 1; ## configure step 1What is the build-time DOCA Management version?A semver matching doca_caps --version. Disagreement = partial install; route to doca-version TASKS.md ## debug (doca-version/TASKS.md#debug) layer 2
pkg-config --modversion doca-common doca-mgmt## install step 2Do both .pc files agree on the same DOCA semver?A single semver repeated twice. Any disagreement is the partial-install pattern
pkg-config --cflags --libs doca-mgmt## buildWhat include + link flags does the linker need?Includes resolve under whichever include directory pkg-config --cflags reports on this install (do not hardcode the path); libs include -ldoca_mgmt -ldoca_common
doca_caps --list-devs## configure step 2Which devices on this host can be used as a doca_dev for management operations?One row per visible device with PCIe address and capability flags
doca_caps --version## install step 1What is the runtime DOCA version on this host?A semver matching pkg-config --modversion doca-mgmt
cat /opt/mellanox/doca/applications/VERSION## install step 1; ## debug layer 1What does the install tree itself claim its version is?A semver matching the other version sources
id -u and getcap <binary>## run step 1Does the user / binary have the privileges management operations require?0 for root invocation, or a capability set that includes the device-administration cap_* the operation requires
ls /dev/fwctl*## install step 4Is the host kernel exposing the fwctl character device doca-mgmt's raw command path uses?One or more /dev/fwctl* character devices visible to root
DOCA_LOG_LEVEL=trace ./<binary>## run step 2What did the structured DOCA logger emit for the first failing call?A trace-level line on every lifecycle transition and every management-plane call
`dmesgtail -n 40` (requires sudo)## debug layer 7What did the kernel / driver / firmware log around the last mgmt call?
`mlxconfig -d <pcie> qhead -n 40` (requires sudo)## debug layer 7What firmware-stored config does the NIC / DPU report?

For commands shared across libraries (pkg-config --modversion, doca_caps, cat /opt/mellanox/doca/applications/VERSION, DOCA_LOG_LEVEL) the cross-library overlay is in doca-debug TASKS.md ## Command appendix (doca-debug/TASKS.md#command-appendix); this table adds the mgmt-specific rows on top.

Requirements and compatibility

Works with: Claude Code, Claude apps, OpenAI Codex, GitHub Copilot, Cursor, Gemini CLI, Kiro, OpenCode, Goose, Amp, Roo Code, JetBrains Junie, Factory Droid, Devin (ex-Windsurf), Mistral Vibe, OpenHands, Letta

“Works with” means the tool reads the open Agent Skills format; a skill written for one tool may use features others lack.

The author says: Requires DOCA SDK installed at /opt/mellanox/doca on Linux (Ubuntu 22.04/24.04 or RHEL/SLES) with a BlueField DPU or ConnectX NIC attached. Reads the user's local install via `pkg-config doca-mgmt` + `doca-common` and inspects /opt/mellanox/doca/{lib,include,samples,applications}; runtime operations require root (or device-admin cap_*) and an /dev/fwctl* character device exposed by the host kernel. The validation steps require a live DOCA install.

Security

What our scanner noticed· Medium risk

  • Large base64-encoded blobs

A static scan is not a guarantee. Skills are third-party content: review a skill before you let an agent use it.

Attribution and licence

Created by
NVIDIA
Publisher
NVIDIA (Official)
Source
NVIDIA/skills · skills/doca-mgmt · commit fce3cca
Licence
Apache License 2.0 (redistribution allowed)
  • LICENSE (added by AutoGineer from LICENSE-APACHE)
  • ATTRIBUTION.md (written by AutoGineer)
Synced

AutoGineer is not affiliated with or endorsed by NVIDIA or NVIDIA.

Download ZIP

The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download doca-mgmt.zip