doca-common

Guides DOCA Common foundation primitives for BlueField DPU and ConnectX NIC programming.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Every DOCA application on a BlueField DPU or ConnectX NIC rests on the same foundation primitives — doca_ctx lifecycle, doca_dev device discovery, doca_mmap/doca_buf zero-copy buffers, the doca_pe progress engine, and the two-tier DOCA Log model — and misusing any of them causes the classic failures: tasks that submit but never complete, DOCA_ERROR_BAD_STATE crashes, and log lines that never appear. This Skill teaches agents the correct universal foundation sequence so those errors are avoided or diagnosed quickly.

Core Features & Use Cases

  • Universal foundation skeleton: Walks the canonical sequence every DOCA app follows — doca_devinfo_create_list, capability gating via doca_cap queries, doca_dev_open, doca_pe_create, per-library context creation, doca_pe_connect_ctx, doca_ctx_start, and the PE-driven run loop.
  • Zero-copy buffer wiring: Explains the doca_mmap / doca_buf_inventory / doca_buf layering so buffers flow across libraries (eth, dma, rdma) without copies, including lifecycle and teardown ordering.
  • Two-tier DOCA Log model: Clarifies the independent SDK tier (--sdk-log-level / DOCA_LOG_LEVEL_SDK) versus app tier (doca_log_register_source, per-source levels), the number-one first-app debug failure.
  • Error taxonomy and debug ladder: Maps DOCA_ERROR_* families (BAD_STATE, INVALID_VALUE, NOT_SUPPORTED, NOT_PERMITTED, NO_MEMORY, DRIVER) to their layer-specific causes and first actions.
  • Use Case: A developer starting a new DOCA Flow program on BlueField-3 asks what foundation code is needed before opening a Flow port; the agent walks the device discovery, capability check, PE creation, and context lifecycle in the correct order.

Quick Start

Ask your agent to walk you through the doca-common foundation skeleton needed before opening a doca_rdma context on your BlueField DPU.

Frequently Asked Questions about doca-common

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

FAQPage Schema
How do I set up the DOCA foundation before opening a doca-flow or doca-rdma context?

Follow the universal skeleton: enumerate devices with doca_devinfo_create_list, run doca_*_cap_* capability queries, open the device with doca_dev_open, create a progress engine with doca_pe_create, create the per-library context, call doca_pe_connect_ctx before doca_ctx_start, then drive doca_pe_progress in your run loop.

Why do my DOCA tasks submit but never complete?

The most common cause is not driving the progress engine. Every DOCA Core context requires doca_pe_connect_ctx before doca_ctx_start, and your main loop must call doca_pe_progress on every iteration for completions to surface.

What is the difference between --sdk-log-level and app-side DOCA log levels?

DOCA Log has two independent tiers: the SDK tier controls DOCA library internals (set via --sdk-log-level or DOCA_LOG_LEVEL_SDK, default WARNING), while the app tier controls your own DOCA_LOG_* emissions (set via doca_log_level_set_global_lower_limit, default INFO). Confusing them is the most common first-app logging failure.

How do I share zero-copy buffers between doca_dma and doca_rdma?

Register memory once with doca_mmap (set_memrange, add_dev, set_permissions, start), carve it into doca_buf handles via doca_buf_inventory, and reference the same buffers from both libraries. The same doca_buf crosses library boundaries without a second registration or copy.

What does DOCA_ERROR_BAD_STATE from doca_ctx_start mean?

It indicates a lifecycle violation — the context was operated on outside its allowed window, such as calling doca_ctx_start before doca_pe_connect_ctx or calling setters after start. Walk the create, configure, connect, start, use, stop, destroy order to find the misordered call.

Does doca-common require a separate installation?

No. doca-common ships with every DOCA SDK install and is present on any healthy installation. Verify it with pkg-config --modversion doca-common; if that query fails, the install itself is broken and should be fixed first.