/dataplane-engineering:dpdk-dataplane-engineeringfrom Dataplane Engineering
DPDK (Data Plane Development Kit) dataplane engineering in C/C++: write hot-path packet-processing code, review it for mbuf-ownership and performance bugs, size mempools/queues/descriptors, tune systems that miss their packets-per-second target evidence-first (counters before config changes), and answer DPDK questions (API semantics, EAL options, version porting, mempool/NUMA/hugepage setup). Use whenever the user works with DPDK APIs or tools (rte_*, mbuf, mempool, lcore, EAL, PMD, testpmd, l3fwd), mentions kernel bypass or poll-mode drivers, Mpps rates, hugepages or NUMA placement for a NIC, RX/TX queues, RSS, imissed/rx_nombuf drops, VFIO, mlx5, ice/E810 or netvsc, or asks to write, review, optimize or debug packet-forwarding, NFV, vSwitch, UPF or dataplane code, even without saying DPDK. NOT for eBPF/XDP programs, kernel network-stack tuning (sysctl, irqbalance on plain servers), pcap/Wireshark analysis, P4/switch ASICs, lock-free or io_uring code with no NIC, or OVS/VM networking without DPDK code.
Trending skills
7-day visitors to each skill page
Ships in Dataplane Engineering. Installing the plugin adds it to Claude Code.
What the skill costs in Claude's context, stage by stage
Name and description: Claude knows it exists.
SKILL.md joins the conversation and stays.
Read when SKILL.md points to them; scripts run unread.
Operate as a senior dataplane engineer: skeptical of averages, obsessed with the per-packet cycle budget, and exact about who owns every mbuf. DPDK code reads like ordinary C, but the rules that make it correct and fast are invisible in the syntax. This skill makes them explicit and makes you prove them.
Treat every DPDK task as a contract over three things, and write them down before changing code:
Plus the evidence that will prove the result: a counter, a profile, a benchmark. Never "it ran".
| Task | Read first |
|---|---|
| Write or modify per-packet (hot-path) code | references/datapath-code.md |
| Mempool, mbuf, hugepages, NUMA, EAL memory, VFIO/IOVA | references/memory-numa.md |
| "Too slow", "drops", "only X Mpps", "does not scale": tune or debug | references/tuning-methodology.md |
| Review existing DPDK code | references/review-checklist.md, then datapath-code.md |
| Vendor, NIC or cloud specifics (Intel ice/i40e, AMD EPYC, Arm, mlx5, Azure, virtio) | references/platforms-and-nics.md |
A mixed task ("review and fix") takes the review checklist first, then datapath-code.md before writing replacement code. A "which datapath should we use" question (DPDK vs AF_XDP vs the kernel stack) is in scope: answer it from the cost model below, and say plainly when DPDK is the wrong tool (connection-heavy workloads that need kernel TCP, no dedicated cores, no ownership of hugepages and NIC binding).
Ask only when the answer changes the work; otherwise state the assumption and proceed.
Deterministic helpers: run them instead of re-deriving by hand, and treat their output as candidates to inspect, not verdicts.
python ${CLAUDE_SKILL_DIR}/scripts/dpdk_static_scan.py <path>: heuristic scan of C/C++
sources for hot-path anti-patterns, ownership hazards and deprecated APIs. Run it first in
every review; then read the code around each hit.python ${CLAUDE_SKILL_DIR}/scripts/dpdk_budget.py budget|mempool|descriptors ...: cycles per
packet at a given link speed and packet size, mempool demand from the port/queue/lcore shape
(--n checks an existing pool against it), RX descriptor depth from the bandwidth-delay model.
Quote its output in the answer.sh ${CLAUDE_SKILL_DIR}/scripts/dpdk_env_probe.sh: read-only Linux host probe (hugepages per
node, NIC NUMA node and driver binding, kernel-cmdline isolation, IOMMU, governor, DPDK
version). Nothing is modified.Why the rules exist: at 10 GbE line rate with 64-byte frames one core sees 14.88 Mpps, a budget of about 67 ns (roughly 200 cycles at 3 GHz) per packet. At 100 GbE it is 6.7 ns. One LLC miss costs 30-40 ns, one DRAM access 60-100 ns, a syscall hundreds of ns, a contended cache line worse. A single careless line in the loop halves throughput. Hence, on the per-packet path:
rte_ring; read-mostly tables
use RCU (rte_rcu_qsbr) or an atomically swapped pointer, never a rwlock. A counter that
must be shared needs only a relaxed atomic.likely/unlikely on exception paths, no integer division
or modulo by a variable (power-of-two masks), no floating point, prefetch the next packets'
data while processing the current ones, cold paths out of line.rte_eth_tx_burst() takes ownership only of the packets it
reports sent; the remainder is still yours: free it or retry it. After a successful TX or
ring enqueue the mbuf is gone; touching it is a use-after-free with delayed symptoms.| Anti-pattern | Why it hurts | Fix |
|---|---|---|
rte_eth_rx_burst(..., 1) or a burst that is not a multiple of 8 | No amortisation; vector RX paths stay off | Burst 32-64 into an array |
Per-packet rte_pktmbuf_alloc + memcpy "for safety" | Allocation plus a full copy per packet; RX already gave you exclusive ownership | Forward the RX mbuf itself; clone or copy only when the packet really goes two places |
Lock or fetch_add on shared stats in the loop | Cache-line ping-pong serialises every core | Per-lcore counters, aggregated off the hot path |
| Adjacent per-core counters in one array | False sharing costs as much as a lock | One __rte_cache_aligned struct per lcore, plus RTE_CACHE_GUARD |
Mempool cache_size = 0 | Every alloc/free hits the shared ring with a CAS | Cache 256-512 (sizing rules in memory-numa.md) |
Hardcoded socket_id = 0, or SOCKET_ID_ANY on a 2-socket box | Remote-socket mbufs and descriptors for every core on the other socket | rte_eth_dev_socket_id(port) / rte_lcore_to_socket_id(), one pool per socket |
rte_eth_tx_burst return value ignored | Every unsent mbuf leaks, and rx_nombuf climbs under load only | Free or retry pkts[sent..n-1] |
% or / by a variable in the loop | 20-90 cycles per integer division | Power-of-two sizes and & (n - 1) |
| printf / RTE_LOG per packet or "every N packets" | Syscall and formatting inside the budget | Counters plus a reporting thread |
while (!stop) on a plain int | Compiler may hoist the load; also a data race | C11 atomic flag, relaxed load |
usleep / sched_yield "to save CPU" in the poll loop | Latency spikes, cold caches, missed bursts | PMD power management (rte_power_ethdev_pmgmt_queue_enable) or interrupt mode |
A poll-mode core showing less than ~100% CPU in top | A busy-polling lcore spins whatever the load; anything lower means the thread floats, something in the loop blocks, or the hypervisor preempts it | Treat it as a finding: pin the thread, remove the blocking call, measure poll gaps with rte_rdtsc() |
Mempool sized by a magic number (8192) | Descriptors alone pin ports x rxq x rxd + ports x txq x txd mbufs; a pool that only covers them is empty before the first packet | n >= descriptors + lcores x burst x stages + lcores x cache_size, plus headroom |
Two lcores polling one RX queue, or queue id derived from rte_lcore_id() | Queues are not thread-safe; lcore ids are not dense | Explicit (port, queue) per worker, assigned at init |
| More RX queues than polling lcores (two or more per core) | Each extra queue halves the burst the others fill and adds a fixed poll cost per iteration; descriptor and mbuf demand double | One RX queue per polling lcore; add lcores, not queues, unless NIC-side counters prove the RX path is the limit |
| Hardcoded offload mask | Silently drops the driver to the scalar path, or fails on another PMD | Intersect with rte_eth_dev_info_get() capabilities |
Legacy API: rte_atomicNN_*, KNI, master/slave lcore names, rte_eth_stats.q_ipackets, -c coremask | Deprecated or removed; breaks on upgrade | C11 atomics, virtio-user/tap, main/worker, xstats, -l/--lcores |
Name each gate before claiming a task is done. A gate you cannot name is a finding.
rx_burst ends in exactly one of: tx_burst (counted
as sent), a successful ring enqueue, or rte_pktmbuf_free, on every path including errors.
The unsent remainder of every burst is handled. Nothing is touched after handoff. Clones
are never written through.8 queues x 512 descriptors is already
4096 before a single packet is in flight), and descriptor depth is the packet rate times
the longest service gap divided by the queues.imissed vs rx_nombuf vs ierrors vs NIC-side discards; perf/PMU). Every
recommendation names the measurement that will confirm it. A tuning plan puts measurement
before any configuration change: read the counters, then run a testpmd (or l3fwd) baseline
on the same cores and queues; if the baseline also misses the target the limit is the
platform, otherwise it is the application. "Try hugepages" without evidence is cargo cult.rte_eal_init return checked and argc/argv shifted; descriptor counts
adjusted to device limits; offloads intersected with capabilities; link waited for;
signal -> atomic flag -> workers exit -> rte_eth_dev_stop/close -> rte_eal_cleanup;
device removal and reset events handled wherever a VF can be revoked (cloud, SR-IOV).Do not claim correctness from a passing run, and do not claim a speedup without a before/after measurement on the same traffic.
pkg-config --cflags --libs libdpdk.
Makefile-era examples are obsolete.-l/--lcores and -S replace the deprecated -c/-s coremasks (deprecated 25.11).
--numa-mem/--numa-limit are the documented names (--socket-mem/--socket-limit still
parse as aliases). Gone from the option table: -w (use -a/--allow, -b/--block) and
--master-lcore (use --main-lcore). --remap-lcore-ids (25.11) gives contiguous lcore ids.rte_get_main_lcore, RTE_LCORE_FOREACH_WORKER.q_ipackets,
q_opackets, q_errors of struct rte_eth_stats (25.11; read xstats rx_qN_packets
instead), the enable_kmods build option (25.11; igb_uio lives in the separate dpdk-kmods
repository).rte_atomicNN_* legacy atomics (use C11 <stdatomic.h> or DPDK's
rte_atomic_*_explicit wrappers from rte_stdatomic.h), VXLAN-GPE flow items, the legacy
flow director API (removal targeted for 26.11).RTE_LCORE_VAR_* for per-lcore state (24.11,
experimental), RTE_CACHE_GUARD against prefetcher-induced false sharing, the mbuf history
debug field (25.11), rte_pmu_read() for in-process PMU counters.cache_size <= n / 1.5 and advised n % cache_size == 0;
26.07 requires only cache_size <= n. RTE_MEMPOOL_CACHE_MAX_SIZE is 512 in both.Lead with the finding that explains the user's symptom (for new code: with the topology and ownership model). Then state assumptions (version, NIC, machine), the code or plan, the evidence behind each claim (counter, profile, formula), the commands to run, and the residual risks (platform, driver, untested paths). Reviews group findings as Bugs (will misbehave), Performance (cycles left on the table, with the order of magnitude) and Hygiene (portability, deprecations), each with file:line, consequence and fix.
The bundled scripts are your instruments, not the user's: quote the numbers and formulas they
produce, and give the user commands that run on the target host (testpmd, rte_eth_stats,
perf, sysfs). A deliverable meant for other people does not mention the scripts by path.
references/datapath-code.md (opens in a new tab)references/memory-numa.md (opens in a new tab)references/platforms-and-nics.md (opens in a new tab)references/review-checklist.md (opens in a new tab)references/tuning-methodology.md (opens in a new tab)scripts/dpdk_budget.py (opens in a new tab)scripts/dpdk_env_probe.sh (opens in a new tab)scripts/dpdk_static_scan.py (opens in a new tab)What SKILL.md sets; muted values are Claude Code's defaults
Other plugins' skills for the same job
npx claudepluginhub syukpublic/ai-dev-toolkit --plugin dataplane-engineering