|SUCCESS| [v2,2/2] net/bnxt: remove VLA from EM key block swap

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Tue Oct 13 21:57:54 CEST 2026


Test-Label: ai-code-review
Test-Status: SUCCESS
https://dpdk.org/patch/171206

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-10-13

# DPDK Patch Review

## PATCH 1/2: net/bnxt: cap memcpy at field size

### Errors

None.

### Warnings

None.

### Info

**Defensive bounds check on trusted device-table input**

The added bounds check protects against a caller-supplied `size` exceeding the 16-byte fixed array.
All current callers pass `sizeof()` of a protocol field, which is compile-time safe.
The patch hardens against future incorrect calls, but there is no evidence in the diff
that any current call can reach the error path.
The check is defensive programming rather than a bug fix.

---

## PATCH 2/2: net/bnxt: remove VLA from EM key block swap

### Errors

None.

### Warnings

None.

### Info

**VLA removal is a code quality improvement**

The replacement of a variable-length array with an in-place swap is correct.
The new implementation swaps blocks byte-by-byte without requiring a scratch buffer.
The logic is equivalent to the original (both swap pairs of blocks symmetrically around the midpoint)
and removes the VLA, which is a good practice.

**Loop variable declarations**

The new loop variables `i` and `j` are declared at function scope (`uint32_t i, j;`)
rather than at point of use (C99 `for (uint32_t i = 0; ...)`).
Both styles are acceptable per the guidelines, and this is consistent with the existing
`num_words` and `data_sz` declarations in the same function.

---

# Summary

Both patches are correct.
Patch 1 adds a defensive bounds check on input that is already safe in all current callers.
Patch 2 removes a VLA and implements an equivalent in-place swap.
No correctness bugs, style violations, or guideline issues identified.

Review-Result: CLEAN


More information about the test-report mailing list