|SUCCESS| [RFC,2/2] bpf: rename macros to match Linux kernel

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Wed Aug 5 12:14:10 CEST 2026


Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/167182

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-08-05

# DPDK BPF Library Macro Renaming Review

## Summary

This patch renames BPF opcode macros from DPDK's legacy `EBPF_*` naming to standard Linux kernel `BPF_*` naming. The changes are mechanical substitutions across the BPF subsystem with no functional alterations.

---

## Patch 1/2: Make bpf_def.h Private

### Errors

None.

### Warnings

None.

### Info

The patch correctly:
- Moves public symbols (`rte_ebpf_insn`, `RTE_EBPF_FUNC_MAX_ARGS`) to the public header with proper `rte_` prefix
- Makes `bpf_def.h` private by removing it from the meson install list
- Adds `#include "bpf_def.h"` to internal files that need the private definitions
- Updates all references consistently across the codebase

---

## Patch 2/2: Rename Macros to Match Linux Kernel

### Errors

None.

### Warnings

None.

### Info

This is a large but purely mechanical substitution patch. The changes follow a consistent pattern:

- `EBPF_ALU64` - `BPF_ALU64`
- `EBPF_DW` - `BPF_DW`
- `EBPF_MOV` - `BPF_MOV`
- `EBPF_ARSH` - `BPF_ARSH`
- `EBPF_END` - `BPF_END`
- `EBPF_TO_BE` - `BPF_TO_BE`
- `EBPF_TO_LE` - `BPF_TO_LE`
- `EBPF_JNE` - `BPF_JNE`
- `EBPF_JSGT` - `BPF_JSGT`
- `EBPF_JSGE` - `BPF_JSGE`
- `EBPF_JLT` - `BPF_JLT`
- `EBPF_JLE` - `BPF_JLE`
- `EBPF_JSLT` - `BPF_JSLT`
- `EBPF_JSLE` - `BPF_JSLE`
- `EBPF_CALL` - `BPF_CALL`
- `EBPF_EXIT` - `BPF_EXIT`
- `EBPF_XADD` - `BPF_XADD`
- `EBPF_ATOMIC` - `BPF_ATOMIC`
- `BPF_ATOMIC_ADD` - `BPF_ADD`
- `BPF_ATOMIC_XCHG` - `BPF_XCHG`
- `EBPF_REG_0` through `EBPF_REG_10` - `BPF_REG_0` through `BPF_REG_10`
- `EBPF_REG_NUM` - `MAX_BPF_REG`
- `EBPF_PSEUDO_CALL` - `BPF_PSEUDO_CALL`

All substitutions are applied consistently across:
- Test files (`app/test/test_bpf.c`, `app/test/test_bpf_validate.c`)
- Core BPF implementation (`lib/bpf/bpf_*.c`)
- Architecture-specific JIT backends (`lib/bpf/bpf_jit_arm64.c`, `lib/bpf/bpf_jit_x86.c`)
- Public and private headers

The substitutions preserve all functional semantics. The patch improves maintainability by aligning DPDK's BPF naming with the Linux kernel convention, reducing confusion for developers familiar with kernel BPF.

---

## Overall Assessment

Both patches are correct mechanical refactorings:

1. **Patch 1/2** properly makes internal definitions private while exposing only the necessary public API with the `rte_` prefix.
2. **Patch 2/2** renames legacy macros to match Linux kernel BPF naming conventions consistently across the entire codebase.

No correctness issues, resource leaks, or logic errors were identified. The changes are purely syntactic and do not alter runtime behavior.

**Recommendation:** Accept both patches.


More information about the test-report mailing list