|WARNING| net/mlx5: fix Rx queue count with enhanced CQE compression
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Fri Nov 20 15:35:20 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/173059
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-20
The changed loop condition, `check_cqe_iteration()`, and the cqe pointer all treat `cq_ci` as a CQ ring slot index. In the enhanced layout, this patch advances that index by the packet count of the compressed CQE.
Errors
1. The CQ index may be advanced by the packet count instead of by one slot.
Added lines:
```
n = rxq->cqe_comp_layout ?
MLX5_CQE_NUM_MINIS(op_own) + 1U :
rte_be_to_cpu_32(cqe->byte_cnt);
```
Then, unchanged:
```
cq_ci += n;
```
`cq_ci` is used as a slot index in two places:
- `cqe = &(*rxq->cqes)[cq_ci & cqe_cnt];`
- `check_cqe_iteration(cqe, rxq->cqe_n, cq_ci)`, which derives the expected iteration count from it.
In the basic layout, a compressed session reserves one CQE slot per packet, so advancing by `byte_cnt` works. In the enhanced layout, one compressed CQE holds up to 8 mini-CQEs in a single slot. Advancing the index by `MLX5_CQE_NUM_MINIS(op_own) + 1` would skip CQE slots that hold further completions.
If so, the effects would be:
- The returned count would be wrong.
- The validity-iteration check could be done against the wrong slot or iteration.
That is the same class of bug this patch is meant to fix.
Suggested fix: in the enhanced layout, keep two counters, one for packets and one for slots. Add `MLX5_CQE_NUM_MINIS(op_own) + 1` to the packet count and advance `cq_ci` by 1. Keep the existing `cq_ci += n` only for the basic layout.
Please also confirm that the pre-loop handling of an in-progress decompression (the branch that resets `cq_ci = rxq->cq_ci`) matches how the enhanced-layout Rx burst tracks its zip state.
Info
1. The basic-layout branch passes the local `cqe_n` to `check_cqe()`. The new branch passes `rxq->cqe_n` to `check_cqe_iteration()`. Using the same variable in both arms would make the expression easier to read.
Review-Result: ERROR
More information about the test-report
mailing list