|SUCCESS| net/mlx5: reject unsupported layers before GRE and NVGRE
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Sun Nov 8 10:02:58 CET 2026
Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/172728
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-08
# DPDK Patch Review
## ERRORS
None identified.
## WARNINGS
None identified.
## INFO
### 1. Style: Multi-line condition formatting
**File:** `drivers/net/mlx5/mlx5_flow.c`
**Lines:**
```c
if (item_flags & (MLX5_FLOW_LAYER_OUTER_L4_TCP |
MLX5_FLOW_LAYER_ICMP | MLX5_FLOW_LAYER_ICMP6 |
MLX5_FLOW_ITEM_ESP))
```
The continuation lines in the multi-line conditional are single-indented (one tab). DPDK style requires double-indentation (two tabs) for continuation lines to distinguish them from the statement body. This pattern appears twice in the patch (once for GRE, once for NVGRE).
**Suggested fix:**
```c
if (item_flags & (MLX5_FLOW_LAYER_OUTER_L4_TCP |
MLX5_FLOW_LAYER_ICMP | MLX5_FLOW_LAYER_ICMP6 |
MLX5_FLOW_ITEM_ESP))
```
### 2. Error message terminology
**File:** `drivers/net/mlx5/mlx5_flow.c`
**Lines:**
```c
"GRE cannot follow TCP, ICMP or ESP layer"
"NVGRE cannot follow TCP, ICMP or ESP layer"
```
The error messages enumerate "TCP, ICMP or ESP layer" but the actual check includes ICMPv6 as well via `MLX5_FLOW_LAYER_ICMP6`. Consider updating the error messages to "TCP, ICMP, ICMPv6 or ESP layer" for consistency with the code, or use a more generic phrase like "unsupported preceding layer" to avoid listing specifics that may become incomplete if the check is extended.
This is a minor clarity issue rather than a correctness bug, as the error is still returned correctly when ICMPv6 is present.
---
## SUMMARY
The patch correctly addresses the validation gap for GRE and NVGRE items by rejecting unsupported preceding layers. The logic is sound:
- GRE-in-UDP returns `ENOTSUP` (not supported, could be valid but mlx5 doesn't implement it)
- GRE-after-TCP/ICMP/ICMPv6/ESP returns `EINVAL` (invalid combination)
The checks are properly placed in the validation functions and apply to both DV and HWS paths as stated. The fix prevents silent rule misinterpretation where `eth / ipv4 / udp / nvgre` would incorrectly match plain NVGRE by discarding the UDP layer.
The two Info-level items above are style/clarity suggestions and do not affect correctness.
Review-Result: CLEAN
More information about the test-report
mailing list