|WARNING| net/ice: fix ACL entry limit on devices with 8 ports
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Mon Nov 9 17:51:33 CET 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/172749
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-09
# DPDK Patch Review
## ERRORS
None.
## WARNINGS
### 1. Missing release notes update
**Issue:** The patch fixes a user-visible bug (rule creation failing silently, now returning explicit error) but does not update the release notes.
**Why it matters:** Users relying on the previous behavior (silent fallback) will see an API change (explicit rejection). This should be documented.
**Suggested fix:** Add an entry to `doc/guides/rel_notes/release_26_11.rst` (assuming 26.11 is the current release) under "**Fixed Issues**":
```rst
* **net/ice: Fixed ACL entry limit on devices with 8 ports.**
Fixed an issue where the driver accepted more ACL rules than the hardware
could support on devices with more than 4 PFs. The driver now correctly
rejects rules beyond the available NORMAL priority band entries with an
explicit error instead of silently falling back to the switch engine.
```
### 2. Potential off-by-one in max_entries check
**Issue:** The code sets `max_entries = params.depth / 2` and checks `if (slot_id < pf->acl.max_entries)`. Since `slot_id` is zero-based (bitmap index), if `max_entries` is 128, valid slots are 0-127. The check looks correct, but the error message "Exceed the maximum entry number(%u)" prints `max_entries` (128) when the actual last valid slot is 127. This could confuse users debugging why slot 128 was rejected.
**Suggested fix:** Clarify the error message to indicate it's an index limit, not a count:
```c
PMD_DRV_LOG(ERR, "ACL slot %u exceeds available slots (0-%u)",
slot_id, pf->acl.max_entries - 1);
```
Or keep the count-based message but make it clearer:
```c
PMD_DRV_LOG(ERR, "Exceed the maximum entry count(%u) - slot %u unavailable",
pf->acl.max_entries, slot_id);
```
### 3. Inconsistent hw_entry_id array sizing
**Issue:** The `hw_entry_id` array in `struct ice_acl_info` is still sized to `MAX_ACL_NORMAL_ENTRIES` (256), but on an 8-port device `max_entries` is 128. Half the array is unused but still allocated. This wastes memory and creates a mismatch between the array size and the runtime limit.
**Why it matters:** The array allocation does not reflect the actual device capacity. On an 8-port device, 128 entries (1024 bytes) are wasted per PF.
**Suggested fix:** Make `hw_entry_id` a dynamically allocated array based on `max_entries`, or change `MAX_ACL_NORMAL_ENTRIES` to be device-specific. Since the fix is localized to correctness, this is a Warning (future cleanup), not an Error.
## INFO
None.
---
**Summary:**
The patch correctly fixes the logic bug where the driver did not account for the halved ACL depth on 8-port devices. The core fix (deriving `max_entries` from `params.depth / 2` and checking against it) is sound.
The warnings address:
1. Missing user-facing documentation of the behavior change
2. Error message clarity for debugging
3. Memory allocation inefficiency (pre-existing, but now more visible)
Review-Result: WARNING
More information about the test-report
mailing list