doca-flow

Build and debug DOCA Flow packet-steering applications on NVIDIA NICs and DPUs.

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

SYSTEM DOCUMENTATION & REQUIREMENTS

What problem does it solve?

Programming hardware packet steering with the DOCA Flow API is error-prone: agents invent nonexistent API names, misconfigure port bring-up, and silently fall back to kernel tc/iptables instead of libdoca_flow. This Skill grounds every step in the installed DOCA headers and shipped samples so pipes, ports, and counters actually program the hardware.

Core Features & Use Cases

  • Port and pipe bring-up: Step-by-step workflows for configuring Flow ports and representors, creating match/action pipes, and programming entries, with the DPDK-to-DOCA device mapping gate that causes most runtime failures.
  • API verification and error diagnosis: Verifies every doca_flow_* symbol against installed headers, maps DOCA_ERROR_* codes to their layer, and guards against commonly invented function names.
  • Observability and connection tracking: Covers per-entry and per-pipe counters, shared resources (encap, meter, counter, RSS), and the flow-ct module for hardware-accelerated 5-tuple connection tracking and NAT.
  • Use Case: A developer asks how to steer a 5-tuple flow to a specific queue on a BlueField DPU; the Skill walks through capability discovery, port start, pipe creation, entry commit, and counter readback using the shipped flow samples.

Quick Start

Ask your agent to bring up a DOCA Flow port on your NIC and create a pipe that matches IPv4 traffic and forwards it to a representor with per-entry counters.

Frequently Asked Questions about doca-flow

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

FAQPage Schema
How do I bring up a DOCA Flow port on a BlueField DPU?

First check device placement with mlxconfig: in SEPARATED_HOST mode the steering plane belongs to the DPU Arm cores, so host-side port start fails. Then allocate hugepages, probe devices with dv_flow_en=2, and call doca_flow_port_start with a mandatory port_id and device source.

How do I create a match/action pipe in DOCA Flow?

Build a doca_flow_pipe_cfg with explicit match and action masks, then call doca_flow_pipe_create, which validates the spec at construction time. Add entries with the pipe-type-specific call such as doca_flow_pipe_basic_add_entry, copying the argument list from the installed header.

Why does doca_flow_port_start fail with 'Failed to get hws cap'?

This signature means the opened function does not own the hardware steering plane, typically because a BlueField is in SEPARATED_HOST (NIC) mode where steering belongs to the DPU Arm. Run Flow on the Arm side or change the card mode via mlxconfig; no pipe-spec edit fixes this.

Does DOCA Flow support connection tracking and NAT?

Yes, the flow-ct module (doca_flow_ct.h) ships inside doca-flow and provides hardware-accelerated 5-tuple connection tracking, aging, and SNAT/DNAT. Initialize it after doca_flow_init but before port start, and confirm device support with doca_flow_ct_cap_is_dev_supported.

Can I use tc flower or DPDK rte_flow instead of DOCA Flow?

Not within this Skill's scope: kernel tc/flower, iptables, eBPF/XDP, OVS, and bare rte_flow bypass the DOCA Flow model of pipes, entries, and hardware counters. The Skill routes those questions elsewhere and insists deliverables link libdoca_flow.

Why does my DOCA Flow counter always read zero?

Counters require two steps: reserving a global pool via doca_flow_cfg_set_nr_counters at init, and passing a populated monitor struct to the add-entry call. Passing NULL for the monitor adds the entry successfully but binds no counter, so queries return zero under traffic.