|WARNING| gso: fix segmentation of unsupported tunnel packets
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Mon Nov 9 11:03:24 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/172739
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-09
# DPDK Patch Review
## ERRORS
None.
## WARNINGS
**Missing release notes update**
The patch fixes a bug where unsupported tunnel packets are incorrectly segmented, causing header corruption. This is a significant functional fix that affects GSO behavior and should be documented in the release notes.
**Suggested fix:**
Add an entry to `doc/guides/rel_notes/release_26_XX.rst` (or the appropriate current release notes file) under the "Fixed Issues" section:
```rst
* **gso: Fixed segmentation of unsupported tunnel packets.**
Fixed a bug where tunnel packets with unsupported tunnel types were
incorrectly segmented as plain IPv4 packets, causing header corruption.
Such packets now return ``-ENOTSUP`` as documented.
```
## INFO
**Correctness analysis**
The patch correctly identifies that `IS_IPV4_TCP()` and `IS_IPV4_UDP()` macros fail to check for tunnel bits, allowing unsupported tunnel packets to fall through to plain IPv4/TCP or IPv4/UDP segmentation. When this happens, the inner header lengths are used to segment what should be treated as an outer+inner packet structure, resulting in the segment processing overwriting outer headers.
The fix adds `RTE_MBUF_F_TX_TUNNEL_MASK` to both macro checks, ensuring that packets with tunnel flags set but not matching any supported tunnel type combination will fail the `IS_IPV4_TCP()` and `IS_IPV4_UDP()` checks. This causes them to fall through to the default case in the GSO path, which returns `-ENOTSUP`.
The logic is sound:
- Before: `(flags & (TCP_SEG | IPV4)) == (TCP_SEG | IPV4)` matches even when tunnel bits are set
- After: `(flags & (TCP_SEG | IPV4 | TUNNEL_MASK)) == (TCP_SEG | IPV4)` only matches when tunnel bits are zero
This is the correct fix for the described bug.
**Style compliance**
The patch follows DPDK C coding style:
- Macro continuation properly aligned with backslash
- Line length within limits
- No forbidden tokens introduced
- Consistent with existing code patterns in the file
**Test coverage note**
While not required for this review, adding a test case for unsupported tunnel packets to `app/test/test_gso.c` would help prevent regression. The test would verify that GSO returns `-ENOTSUP` for a tunnel packet with a tunnel type not in `gso_types`.
Review-Result: WARNING
More information about the test-report
mailing list