|SUCCESS| net: fix tunnel parsing of non-IP packets
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Mon Nov 9 15:41:41 CET 2026
Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/172744
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-09
# DPDK Patch Review
## Patch Summary
This patch fixes a bug in `rte_net_get_ptype()` where non-IP packets were incorrectly parsed as tunneled packets due to EtherType values being compared against IP protocol numbers.
---
## ERRORS
None identified.
---
## WARNINGS
None identified.
---
## INFO
### Code correctness analysis
The fix is correct. The bug occurs because:
1. When EtherType is neither IPv4 (0x0800) nor IPv6 (0x86DD), the code skips L3 parsing
2. The `proto` variable still contains the EtherType value (big-endian in the packet)
3. On little-endian systems, `ptype_tunnel_without_udp()` then compares this byte-swapped EtherType against IP protocol numbers:
- EtherType 0x0400 - read as 0x04 - matches IPPROTO_IPIP (4)
- EtherType 0x2900 - read as 0x29 - matches IPPROTO_IPV6 (41)
- EtherType 0x2F00 - read as 0x2F - matches IPPROTO_GRE (47)
The patch correctly returns early for non-IP packets, preventing the tunnel parsing logic from operating on invalid data.
### Pre-existing pattern observation (Info only)
The surrounding code uses explicit comparison style (`if (proto == rte_cpu_to_be_16(...))`), which is consistent with DPDK guidelines. The patch maintains this style.
---
Review-Result: CLEAN
More information about the test-report
mailing list