|WARNING| net/af_packet: fix build with old kernel headers

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Fri Nov 6 16:05:18 CET 2026


Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/172698

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-06

# DPDK Patch Review

## Summary
This patch adds compatibility for older kernel headers by defining `PACKET_IGNORE_OUTGOING` when not present, and adds fallback logic when the kernel rejects the socket option.

---

## ERRORS

None identified.

---

## WARNINGS

### 1. Variable declaration style inconsistency
**Line 924:**
```c
bool pmd_filter;
```

The variable `pmd_filter` is declared at the top of the function but not initialized until much later (line 1062). This creates a large gap between declaration and first use. Consider declaring it closer to its point of first use for better readability.

**Suggested fix:**
```c
/* Move declaration to line ~1061, just before first assignment */
bool pmd_filter = ignore_outgoing != 0 && nb_queues > 1;
if (ignore_outgoing != 0 && nb_queues == 1) {
    /* ... */
}
```

### 2. Missing release notes entry
The patch fixes a build failure on older systems and changes runtime behavior (fallback to PMD filtering when kernel doesn't support the option). This is significant enough to warrant a release notes entry.

**Suggested action:**
Add an entry to `doc/guides/rel_notes/release_XX_XX.rst` under the "Fixed Issues" section describing:
- Build failure on systems with kernel headers < 4.20
- Graceful fallback to PMD filtering on kernels < 4.20

---

## INFO

### Documentation improvement
The added documentation in `af_packet.rst` clearly explains the kernel requirement and fallback behavior, which is helpful for users. The wording is clear and appropriate.

---

Review-Result: WARNING


More information about the test-report mailing list