|SUCCESS| [2/2] net/mlx5: report HWS counter pool allocation failure

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Mon Nov 9 14:43:11 CET 2026


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

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-11-09

# Review of DPDK Patch Series

## Patch 1/2: net/mlx5: embed HWS counter pool name in the pool

### ERRORS

**Double-free on error path**

Line 735 (removed):
```c
-	mp_name = mlx5_malloc(MLX5_MEM_ZERO, RTE_MEMZONE_NAMESIZE, 0, SOCKET_ID_ANY);
```

Line 810 (removed):
```c
-	mlx5_free(mp_name);
```

Line 837 (removed):
```c
-	mlx5_free((void *)cpool->cfg.name);
```

The original code allocated `mp_name` at line 735, assigned it to `pcfg.name`, then freed it at line 810 in the error path and at line 837 in destroy. When `pcfg` was copied to `cpool->cfg`, both `pcfg.name` and `cpool->cfg.name` pointed to the same heap allocation. The error path freed via `mp_name`, then destroy freed via `cpool->cfg.name` -- a double-free.

The patch eliminates the double-free by embedding the string in the config structure instead of allocating it separately. This is correct.

**Verdict**: The patch **fixes** a double-free bug. No new errors introduced.

---

## Patch 2/2: net/mlx5: report HWS counter pool allocation failure

### Clean

The patch adds DRV_LOG calls and improves error reporting. All new log lines are in error paths after allocation failures, where the logged size is computed from variables that have already been validated or are compile-time constants.

The change at lines 12771-12774 (flow_hw_action_handle_validate) simplifies the error path: instead of setting a generic "counters pool not initialized" error, it returns the error from `flow_hw_allocate_actions()` directly. This preserves the original error code and message, which is the stated intent of the patch.

No correctness issues, resource leaks, or style violations introduced.

---

## Summary

**Patch 1/2**: Fixes a double-free bug.  
**Patch 2/2**: Clean -- improves error reporting without introducing issues.

Review-Result: CLEAN


More information about the test-report mailing list