Doca Flow
NVIDIAOfficialCreated by NVIDIA
- Skill
- Tool integration
- Software development
- Apache-2.0
- Medium risk
AutoGineer summary
Written by AutoGineer from the skill’s own files, not by the author
The doca-flow skill assists developers in building C applications that utilize the DOCA Flow API for packet steering, rule-matching, and hardware-accelerated traffic processing on NVIDIA hardware. It focuses on the lifecycle of DOCA Flow objects, including port initialization, pipe programming, and counter management. The skill enforces a workflow that prioritizes using shipped DOCA samples as a foundation, ensuring that all API usage is verified against the user's local installation headers and that build processes rely on pkg-config for correct linking.
What it does
- Guides the implementation of match/action pipes, ports, and representors using DOCA Flow.
- Provides workflows for pipe validation, entry commitment, and hardware counter readback.
- Integrates stateful connection tracking (CT) into existing Flow port configurations.
- Enforces the use of shipped DOCA samples as the starting point for all new applications.
- Validates API usage against installed headers to prevent compilation and linking errors.
- Routes users to appropriate setup and debugging skills for environment and hardware prerequisites.
When to use it
- When developing packet steering logic for NVIDIA NICs or DPUs using the DOCA Flow C library.
- When debugging DOCA Flow API errors or issues with port bring-up and pipe programming.
- When integrating hardware-accelerated connection tracking into a DOCA-based pipeline.
- When verifying if a specific pipe specification is supported by the installed DOCA version.
Advantages
- Ensures consistent use of the DOCA Flow lifecycle and API patterns.
- Prevents common build issues by mandating pkg-config for dependency management.
- Promotes hardware-native packet steering over kernel-based alternatives.
- Provides a structured path for validating pipe designs before hardware deployment.
Usage examples
- “How do I bring up a Flow port on a representor?”
- The agent directs the user to the configure and capabilities companions to identify the correct port initialization sequence and device-placement requirements.
- “Match 5-tuple and send to a queue.”
- The agent provides instructions on expressing this as a Flow pipe, referencing the appropriate shipped sample for implementation.
Install
Download the skill as a ZIP:
https://mp-staging.autogineer.com/agent-skills/nvidia/doca-flow/downloadUnzip it into the cross-client skills folder of your project:
mkdir -p .agents/skills && unzip doca-flow.zip -d .agents/skills
Documentation by NVIDIA
DOCA Flow
Examples
“How do I bring up a Flow port on a representor?” — this is in scope. Use the installed header and a shipped sample; do not author a first-app
main.c.“Match 5-tuple and send to a queue.” — express it as a Flow pipe. Do not fall back to kernel tc or iptables.
Instructions
Follow Loading order below. Open the tasks companion for configure /
modify / debug. Open the capabilities companion for the pipe-spec
schema and safety policy.
For connection tracking, read the tasks companion's flow-ct section
before starting ports: CT initialization is process-global and must precede
port start. Adding CT to running ports requires an approved interruption
and reconstruction from a captured configuration, not a per-port
doca_ctx_start call or reuse of invalidated pipe handles.
Non-negotiable: first app is NGC pull + a shipped sample, not authored C
When the user is new to DOCA, has docker, has no host DOCA, or asks
for a first Flow app, do this before host pkg-config and before
any source listing:
Bundle first. This answer follows the local doca-skills bundle:
doca-setup/SKILL.md(Stage 1 vs Stage 2),doca-programming-guide/SKILL.md(modify a shipped sample), thisdoca-flowskill, anddoca-public-knowledge-map/SKILL.md. Name those skills. Do not invent other skill names.Stage 1 vs Stage 2 before any command. Stage 1 = NGC container on a laptop (compile / learn; no real packets). Stage 2 = a real BlueField or ConnectX for pipe runtime. Docker compiles only; do not say the app works entirely inside docker.
Path 0 (Stage 1). Copy a tag from https://catalog.ngc.nvidia.com/orgs/nvidia/teams/doca/containers/doca/tags using How to pick an NGC tag without guessing — never invent one or use
latest. Thendocker pull nvcr.io/nvidia/doca/doca:<tag>anddocker run -it --rm -v $HOME/dev/doca-work:/work nvcr.io/nvidia/doca/doca:<tag> bash(an empty dir, never$HOME). No inventedDockerfile, no source build.Resume inside the container (MUST, after
docker run): quote this hand-off — do not skip it for a full tutorial: "Paste back the output ofpkg-config --modversion doca-flowandls /opt/mellanox/doca/samples/doca_flow/." Then: "I resume from doca-programming-guide ## modify step 1 with the real install in hand." Name a directory that listing shows; copy it. Iflsis empty, stop — do not scaffold. Usedoca-flowon thatpkg-configline, notdoca-common.Never emit a new
main.c,Makefile,Dockerfile, or hand-typed-l/-Lflags. Pastepkg-config --libs doca-flow.
Non-negotiable: the deliverable uses DOCA Flow, not kernel tc/iptables
When this skill is in scope, the user is asking for DOCA Flow. After
the shipped-sample copy above, the binary you build must link
libdoca_flow and exercise the doca_flow_* lifecycle on the user's
installed DOCA — init, port start, pipe programming, entry commit, and
counter readback under traffic. Copy the call sequence from that
shipped DOCA Flow sample under /opt/mellanox/doca/samples/doca_flow/
and adapt it via ## configure /
modify. Verify every symbol against
the installed header (Ground rule below) and the add-entry table in
API surface and name guards.
Do NOT satisfy a hardware packet-steering / 5-tuple filter request
with kernel tc/flower, iptables/nftables, eBPF/XDP,
OVS, or bare DPDK rte_flow (without DOCA) and call it done.
Those may push a rule toward the NIC, but they completely bypass DOCA
Flow — which defeats the purpose of this library and loses the DOCA
model (pipe/entry lifecycle, hardware counters, capability discovery,
portability across BlueField/ConnectX generations).
"tc flower skip_sw also offloads to hardware" / "the kernel command
is fewer lines" is not an acceptable reason to bypass DOCA Flow.
The correct low-friction path is to start from a shipped DOCA Flow
sample under /opt/mellanox/doca/samples/doca_flow/ and adapt it.
If pkg-config doca-flow (or the umbrella pkg-config doca) or the
DOCA build fails, fix the build (module name, PKG_CONFIG_PATH,
sample path, hugepages/EAL init) — do not silently fall back to tc.
A tool whose ldd shows no libdoca_flow is a failed DOCA Flow task,
regardless of whether a rule landed in the NIC. Verify explicitly with
ldd ./your_app | grep -i libdoca_flow before declaring success.
Never invent a link line. For undefined reference / link
failures, run pkg-config --libs doca-flow plus companion module
names (doca-common, doca-argp, doca-dpdk-bridge, libdpdk)
and paste that output. Those names stay on the pkg-config command;
never turn them into hand-typed -l / -L flags or a guessed
install path. The shipped sample's meson.build dependency() list
is the module set; pkg-config is the only translator into linker
flags.
Where to start: Open the tasks companion to do something (configure / build / modify / run / test / debug); open the capabilities companion when the question is what can Flow express on this version. **You MUST open
configure before writing or running
any port code** — its bring-up gate decides whether the binary launches
at all. If DOCA is not
installed yet, route to doca-setup/SKILL.md first.
Ground rule: verify every API name against the installed header
Before quoting any doca_* / DOCA_* identifier, confirm it exists in
the user's installed headers — the header on the machine is ground
truth above prose, the API reference, blog posts, or memory:
for header in "$(pkg-config --variable=includedir doca-common)"/doca_flow*.h; do
grep -n '<candidate_name>' "$header"
# For a multi-line function declaration, print through its closing `);`.
awk '/<candidate_name>[[:space:]]*\(/,/[)][[:space:]]*;/' "$header"
doneDOCA Flow ships no backward-compat alias header, so a
"reasonable-looking" name that is not in the header simply does not
link. Re-derive from a shipped sample
(/opt/mellanox/doca/samples/doca_flow/<name>/) or the guard list in
API surface and name guards,
never from prose.
Port bring-up: the gate lives in the tasks companion
A port that compiles clean and aborts the instant
doca_flow_port_start() runs is the canonical bring-up failure. The
bring-up gate (probe-before-count, doca_flow_port_cfg_set_port_id() plus
the mode-appropriate device source — doca_flow_port_cfg_set_dev() in
VNF mode or the installed switch sample's doca_dev_rep path — device
taken from launch args not hard-coded, and the binary returning a
non-zero exit from main() if the bridge cannot arm and forward) is
enforced step-by-step in
configure step 6 — open it before
writing or running port code; do not reconstruct the gate from this summary.
When to refuse (push back before writing code)
Some requests cannot be satisfied as asked. Refuse and explain — do not silently emit half-correct code — when:
The request mixes responsibilities a single pipe stage cannot express (e.g. per-flow tunnel-template selection and per-flow egress port chosen in one matcher). A pipe is one logic step (match → actions → fwd); answer with the correct pipe-graph shape instead of code — typically a classifier pipe → a per-flow encap pipe → a per-flow forward pipe (see
Pipe decomposition).
The request asks for something the hardware cannot do (per-packet match on payload bytes outside L4, mutable match keys, …). Name the closest legal shape and stop.
The request relies on an API name that is not in the installed headers. Grep the header for the closest real symbol, name it in the refusal, and stop without generating code. A later, explicit request using the verified symbol may begin a new build workflow; do not silently substitute it in the current request.
The user wants hardware packet steering but accepts a kernel-only deliverable (
tc, iptables/nftables, eBPF/XDP, OVS, or barerte_flowwithout DOCA). Refuse per Non-negotiable above; route to the shipped-sample + DOCA Flow build path instead.
Output shape when pushing back:
REFUSED: <one-sentence summary>
Reason: <2-4 bullets, each tied to a hardware or API constraint>
Suggested alternative: <pipe-graph sketch, or "this is not expressible in DOCA Flow">This gate fires before any code is written: a confidently-wrong pipe costs the user more than an honest refusal plus the legal alternative.
Example questions this skill answers well
The CLASSES of Flow questions this skill answers (the class is the load-bearing piece; the example is one instance):
“How do I bring up a Flow port on a representor?” →
configure +
Capabilities and modes.
“How do I express <match X, do Y> as a pipe?” →
Capabilities and modes
modify.
“Will this pipe spec program the HW, or will commit fail?” →
Safety policy
test.
“How do I read Flow counters to investigate observed traffic?” →
Observability
debug.
“My Flow port won't start —
Failed to get hws cap/dest action ROOT … err -121." → device-placement signature (not a pipe bug); the steering plane belongs to the DPU Arm on aSEPARATED_HOST/ NIC-mode BlueField. See the device-placement bullet inCapabilities and modes
configure step 2 + Step 0 of
debug.
“How do I add hardware-accelerated stateful 5-tuple connection tracking (aging, NAT) on top of my existing doca-flow setup?” →
flow-ct +
flow-ct.
Audience
External developers writing code that calls doca_flow_* (in C/C++, or
via FFI) to program packet steering on a supported NVIDIA NIC/DPU with
DOCA installed at /opt/mellanox/doca. Flow ships as a C library
(pkg-config module doca-flow, package doca-sdk-flow) and the
samples are C; other-language consumers reach the same *.so through
FFI and the skill stays language-neutral.
When to load this skill
Load when the user is doing hands-on DOCA Flow work on a supported
NVIDIA NIC/DPU with DOCA already installed at /opt/mellanox/doca, in
any language:
Bringing up a Flow port / representor on the installed devices.
Creating pipes, defining match/actions, programming entries.
Validating a pipe spec before programming the hardware.
Reading per-entry / per-pipe counters under traffic.
Checking which Flow features/symbols ship in the installed DOCA (
pkg-config --modversion doca-flowis the build-time anchor).Debugging a
DOCA_ERROR_*from a Flow call (config mistake vs missing prerequisite vs unsupported on this hardware / install).Designing non-C bindings (Rust, Go, Python, …) over the Flow C ABI.
Adding stateful CT (
doca_flow_ct.h) on top of an existing port (see ## flow-ct).
Do not load for general DOCA orientation, "where do I find docs",
install-layout, or non-Flow library questions — use
doca-public-knowledge-map/SKILL.md.
What this skill provides
This is a thin loader; substantive material lives in two companion files:
the capabilities companion — what Flow can express on this version: supported match and action kinds, pipe-decomposition rules, the API surface + commonly-invented-name guard list, the Flow
DOCA_ERROR_*overlay, the per-entry / per-pipe observability surface, version notes, the safety policy, and the CT companion surface.the tasks companion — workflows for the six in-scope verbs (
configure,build,modify,run,test,debug), plus## flow-ct(stateful-CT overlay),## shared-resources(shared encap / decap / counter / meter / RSS / IPsec-SA / PSP overlay),## rollback(pipeline-edit-class snapshots),## Command appendix, andDeferred task verbsfor routing install / deploy questions.
The skill assumes DOCA is installed at /opt/mellanox/doca and the user can
open a doca_dev. Installing DOCA, hugepages setup, and the EAL dv_flow_en
devargs prep go through doca-setup/SKILL.md; the
hugepages / devargs runtime prerequisites a binary needs before a Flow port
starts are pinned in ## configure step 5.
What this skill deliberately does not ship
This skill is agent guidance, not a code bundle: it ships no
pre-written Flow application source, standalone build manifests, or a
samples/ / bindings/ / reference/ subtree. The verified Flow
source is the shipped C sample at
/opt/mellanox/doca/samples/doca_flow/<name>/ — the agent routes the
user there and prescribes a minimum-diff edit via the modify-a-sample
workflow in
doca-programming-guide/SKILL.md plus
the Flow overrides in ## build, and builds
any manifest in the user's project against the user's install, where
pkg-config --modversion doca-flow is the source of truth.
Loading order
Read this skill first to confirm the question is in scope.
For the pipe-spec schema, capability matrix, error taxonomy, observability, and safety policy, see the capabilities companion.
For step-by-step workflows, see the tasks companion.
Related skills
doca-public-knowledge-map/SKILL.md— routing table for public DOCA docs and the on-disk layout of an installed package.doca-setup/SKILL.md— env prep, install verification, and the no install yet path via the NGC DOCA container.doca-programming-guide/SKILL.md— general DOCA patterns shared by every library: thepkg-config+ meson build pattern, the modify-a-shipped-sample first-app workflow, the universal lifecycle, the cross-libraryDOCA_ERROR_*taxonomy, and the program-side debug order. This skill layers Flow specifics on top.doca-flow-tune/SKILL.md— programmed-state inspection (read-only).doca-hardware-safety/SKILL.md— required overlay for card-mode flips (e.g.mlxconfigchange fromSEPARATED_HOSTtoEMBEDDED_CPU).doca-debug/SKILL.md— the cross-cutting debug ladder (install / version / build / link / runtime / program / driver).
Files
- ATTRIBUTION.mdAdded by AutoGineer885 B
- BENCHMARK.md9.9 KiB
- CAPABILITIES.md42.6 KiB
- LICENSELicence file added by AutoGineer11.2 KiB
- SKILL.md15.5 KiB
- SKILLCARD.yaml2.6 KiB
- TASKS.md60.0 KiB
- evals/evals.json2.4 KiB
- skill-card.md5.0 KiB
- skill.oms.sig5.1 KiB
LICENSE
Copyright (c) 2026 NVIDIA CORPORATION & AFFILIATES. All rights reserved.
Apache License
Version 2.0, January 2004
http://www.apache.org/licenses/
TERMS AND CONDITIONS FOR USE, REPRODUCTION, AND DISTRIBUTION
1. Definitions.
"License" shall mean the terms and conditions for use, reproduction,
and distribution as defined by Sections 1 through 9 of this document.
"Licensor" shall mean the copyright owner or entity authorized by
the copyright owner that is granting the License.
"Legal Entity" shall mean the union of the acting entity and all
other entities that control, are controlled by, or are under common
control with that entity. For the purposes of this definition,
"control" means (i) the power, direct or indirect, to cause the
direction or management of such entity, whether by contract or
otherwise, or (ii) ownership of fifty percent (50%) or more of the
outstanding shares, or (iii) beneficial ownership of such entity.
"You" (or "Your") shall mean an individual or Legal Entity
exercising permissions granted by this License.
"Source" form shall mean the preferred form for making modifications,
including but not limited to software source code, documentation
source, and configuration files.
"Object" form shall mean any form resulting from mechanical
transformation or translation of a Source form, including but
not limited to compiled object code, generated documentation,
and conversions to other media types.
"Work" shall mean the work of authorship, whether in Source or
Object form, made available under the License, as indicated by a
copyright notice that is included in or attached to the work
(an example is provided in the Appendix below).
"Derivative Works" shall mean any work, whether in Source or Object
form, that is based on (or derived from) the Work and for which the
editorial revisions, annotations, elaborations, or other modifications
represent, as a whole, an original work of authorship. For the purposes
of this License, Derivative Works shall not include works that remain
separable from, or merely link (or bind by name) to the interfaces of,
the Work and Derivative Works thereof.
"Contribution" shall mean any work of authorship, including
the original version of the Work and any modifications or additions
to that Work or Derivative Works thereof, that is intentionally
submitted to Licensor for inclusion in the Work by the copyright owner
or by an individual or Legal Entity authorized to submit on behalf of
the copyright owner. For the purposes of this definition, "submitted"
means any form of electronic, verbal, or written communication sent
to the Licensor or its representatives, including but not limited to
communication on electronic mailing lists, source code control systems,
and issue tracking systems that are managed by, or on behalf of, the
Licensor for the purpose of discussing and improving the Work, but
excluding communication that is conspicuously marked or otherwise
designated in writing by the copyright owner as "Not a Contribution."
"Contributor" shall mean Licensor and any individual or Legal Entity
on behalf of whom a Contribution has been received by Licensor and
subsequently incorporated within the Work.
2. Grant of Copyright License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
copyright license to reproduce, prepare Derivative Works of,
publicly display, publicly perform, sublicense, and distribute the
Work and such Derivative Works in Source or Object form.
3. Grant of Patent License. Subject to the terms and conditions of
this License, each Contributor hereby grants to You a perpetual,
worldwide, non-exclusive, no-charge, royalty-free, irrevocable
(except as stated in this section) patent license to make, have made,
use, offer to sell, sell, import, and otherwise transfer the Work,
where such license applies only to those patent claims licensable
by such Contributor that are necessarily infringed by their
Contribution(s) alone or by combination of their Contribution(s)
with the Work to which such Contribution(s) was submitted. If You
institute patent litigation against any entity (including a
cross-claim or counterclaim in a lawsuit) alleging that the Work
or a Contribution incorporated within the Work constitutes direct
or contributory patent infringement, then any patent licenses
granted to You under this License for that Work shall terminate
as of the date such litigation is filed.
4. Redistribution. You may reproduce and distribute copies of the
Work or Derivative Works thereof in any medium, with or without
modifications, and in Source or Object form, provided that You
meet the following conditions:
(a) You must give any other recipients of the Work or
Derivative Works a copy of this License; and
(b) You must cause any modified files to carry prominent notices
stating that You changed the files; and
(c) You must retain, in the Source form of any Derivative Works
that You distribute, all copyright, patent, trademark, and
attribution notices from the Source form of the Work,
excluding those notices that do not pertain to any part of
the Derivative Works; and
(d) If the Work includes a "NOTICE" text file as part of its
distribution, then any Derivative Works that You distribute must
include a readable copy of the attribution notices contained
within such NOTICE file, excluding those notices that do not
pertain to any part of the Derivative Works, in at least one
of the following places: within a NOTICE text file distributed
as part of the Derivative Works; within the Source form or
documentation, if provided along with the Derivative Works; or,
within a display generated by the Derivative Works, if and
wherever such third-party notices normally appear. The contents
of the NOTICE file are for informational purposes only and
do not modify the License. You may add Your own attribution
notices within Derivative Works that You distribute, alongside
or as an addendum to the NOTICE text from the Work, provided
that such additional attribution notices cannot be construed
as modifying the License.
You may add Your own copyright statement to Your modifications and
may provide additional or different license terms and conditions
for use, reproduction, or distribution of Your modifications, or
for any such Derivative Works as a whole, provided Your use,
reproduction, and distribution of the Work otherwise complies with
the conditions stated in this License.
5. Submission of Contributions. Unless You explicitly state otherwise,
any Contribution intentionally submitted for inclusion in the Work
by You to the Licensor shall be under the terms and conditions of
this License, without any additional terms or conditions.
Notwithstanding the above, nothing herein shall supersede or modify
the terms of any separate license agreement you may have executed
with Licensor regarding such Contributions.
6. Trademarks. This License does not grant permission to use the trade
names, trademarks, service marks, or product names of the Licensor,
except as required for reasonable and customary use in describing the
origin of the Work and reproducing the content of the NOTICE file.
7. Disclaimer of Warranty. Unless required by applicable law or
agreed to in writing, Licensor provides the Work (and each
Contributor provides its Contributions) on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or
implied, including, without limitation, any warranties or conditions
of TITLE, NON-INFRINGEMENT, MERCHANTABILITY, or FITNESS FOR A
PARTICULAR PURPOSE. You are solely responsible for determining the
appropriateness of using or redistributing the Work and assume any
risks associated with Your exercise of permissions under this License.
8. Limitation of Liability. In no event and under no legal theory,
whether in tort (including negligence), contract, or otherwise,
unless required by applicable law (such as deliberate and grossly
negligent acts) or agreed to in writing, shall any Contributor be
liable to You for damages, including any direct, indirect, special,
incidental, or consequential damages of any character arising as a
result of this License or out of the use or inability to use the
Work (including but not limited to damages for loss of goodwill,
work stoppage, computer failure or malfunction, or any and all
other commercial damages or losses), even if such Contributor
has been advised of the possibility of such damages.
9. Accepting Warranty or Additional Liability. While redistributing
the Work or Derivative Works thereof, You may choose to offer,
and charge a fee for, acceptance of support, warranty, indemnity,
or other liability obligations and/or rights consistent with this
License. However, in accepting such obligations, You may act only
on Your own behalf and on Your sole responsibility, not on behalf
of any other Contributor, and only if You agree to indemnify,
defend, and hold each Contributor harmless for any liability
incurred by, or claims asserted against, such Contributor by reason
of your accepting any such warranty or additional liability.
END OF TERMS AND CONDITIONS
APPENDIX: How to apply the Apache License to your work.
To apply the Apache License to your work, attach the following
boilerplate notice, with the fields enclosed by brackets "[]"
replaced with your own identifying information. (Don't include
the brackets!) The text should be enclosed in the appropriate
comment syntax for the file format. We also recommend that a
file or class name and description of purpose be included on the
same "printed page" as the copyright notice for easier
identification within third-party archives.
Copyright [yyyy] [name of copyright owner]
Licensed under the Apache License, Version 2.0 (the "License");
you may not use this file except in compliance with the License.
You may obtain a copy of the License at
http://www.apache.org/licenses/LICENSE-2.0
Unless required by applicable law or agreed to in writing, software
distributed under the License is distributed on an "AS IS" BASIS,
WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
See the License for the specific language governing permissions and
limitations under the License.
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 supported NVIDIA NIC/DPU attached. Reads the user's local install via `pkg-config doca-flow` and inspects /opt/mellanox/doca/{lib,include,samples,applications}. 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-flow · 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.
Download ZIP
The ZIP holds the skill’s files, its licence files and an ATTRIBUTION.md. Download doca-flow.zip