|WARNING| app/testpmd: fix VXLAN-GPE and GENEVE custom port parsing
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Fri Nov 6 04:43:13 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/172651
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-06
# DPDK Patch Review
## ERRORS
### Resource Leak on Error Path
**File:** app/test-pmd/csumonly.c
**Function:** `parse_tunnel_udp_custom_port()`
**Line:** 594-595
```c
if (rte_pktmbuf_data_len(m) < off + sizeof(*uh))
return ptype;
```
After modifying `uh->dst_port` at line 611, if the function returns early at line 620 (when `RTE_ETH_IS_TUNNEL_PKT(new_ptype) == 0`), the original port value is not restored. The saved port is only restored in the success path. This leaves the mbuf in an inconsistent state.
**Fix:** Restore `saved_port` before the early return at line 620:
```c
if (RTE_ETH_IS_TUNNEL_PKT(new_ptype) == 0) {
uh->dst_port = saved_port;
return ptype;
}
```
---
## WARNINGS
### Missing Release Notes
This patch fixes a significant functional bug (custom tunnel port parsing broken since commit 76730c7b9b5a) and changes packet processing behavior when `parse-tunnel` is enabled. It should be documented in the release notes under the "Fixed Issues" section for app/testpmd.
**Action:** Add an entry to `doc/guides/rel_notes/release_<version>.rst` documenting the fix for VXLAN-GPE and GENEVE custom port parsing.
---
## INFO
### Boolean Return Type Preferred
**File:** app/test-pmd/csumonly.c
**Function:** `can_process_inner_headers()`
**Lines:** 624-636
The function is a predicate (answers a yes/no question) and already returns `bool`. This is correct usage following the guidelines. No change needed.
---
### Comparison Style
**File:** app/test-pmd/csumonly.c
**Lines:** 627, 769
```c
if ((ptype & RTE_PTYPE_INNER_L3_MASK) == 0)
return false;
```
```c
if (txp->parse_tunnel && RTE_ETH_IS_TUNNEL_PKT(ptype) == 0 &&
```
The explicit comparison `== 0` is correct per DPDK style. No change needed.
---
### Function Parameter Const Correctness
**File:** app/test-pmd/csumonly.c
**Function:** `parse_tunnel_udp_custom_port()`
**Line:** 585-587
The function modifies the mbuf's UDP header temporarily, so the non-const `struct rte_mbuf *m` parameter is correct. No change needed.
---
## SUMMARY
The patch correctly addresses the issue where custom VXLAN-GPE and GENEVE ports were not recognized after the switch to `rte_net_get_ptype()`. The approach of temporarily substituting the default port is a reasonable workaround given the constraints.
The critical issue is the missing port restoration on the early return path, which leaves packet data in an inconsistent state. This must be fixed.
The missing release notes entry is important for users tracking bug fixes but does not affect code correctness.
Review-Result: ERROR
More information about the test-report
mailing list