|WARNING| [v2] dev: fix hotplug notification to secondary
dpdklab at iol.unh.edu
dpdklab at iol.unh.edu
Tue Jul 7 14:34:19 CEST 2026
Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/166599
_AI Code Review_
=== Patch Review: series.patch (via Claude) ===
Review date: 2026-07-07
# DPDK Patch Review
## Summary
This patch fixes a logical error in the evaluation of `no_shconf` for hotplug notification to secondary processes.
---
## Errors
None.
---
## Warnings
### 1. No release notes update
**File:** None included
**Issue:** This bug fix corrects a critical logical inversion that breaks multi-process hotplug notification. It should have a release notes entry in `doc/guides/rel_notes/release_XX_YY.rst` documenting the fix.
**Suggested fix:** Add an entry under "Fixed Issues" in the current release notes:
```rst
* **Fixed hotplug notification to secondary processes.**
Fixed a logical error that prevented hotplug events from being
properly notified to secondary processes.
```
---
## Info
### 1. Variable initialization style
**File:** `lib/eal/common/eal_common_dev.c`
**Lines:** 272, 431
**Observation:** The boolean variable `do_mp` is initialized at declaration with a computed value. This is acceptable style in C99, though some prefer separating declaration and initialization for complex expressions.
**Current code:**
```c
bool do_mp = internal_conf->no_shconf == 0;
```
**Alternative (optional):**
```c
bool do_mp;
do_mp = (internal_conf->no_shconf == 0);
```
Both styles are acceptable per the guidelines. No change required.
---
## Positive Observations
1. **Correct boolean logic:** The fix properly converts the `no_shconf` integer flag (where 0 means shared config *is* enabled) to the boolean `do_mp` (true when multi-process *should* be done).
2. **Consistent fix:** Both occurrences of the bug (`rte_dev_probe` and `rte_dev_remove`) are corrected.
3. **Explicit comparison:** The code correctly uses explicit comparison `== 0` rather than relying on implicit truthiness of integers, following DPDK style guidelines.
4. **Proper bool usage:** Uses `bool` type from `<stdbool.h>` for a true/false flag, which is the preferred style.
---
## Overall Assessment
This is a clean, correct bug fix. The only missing piece is the release notes update, which should be added since this fixes a correctness bug that affects multi-process functionality. The code change itself follows DPDK style and correctly fixes the logical inversion.
More information about the test-report
mailing list