[PATCH v1 0/2] fix bug
Stephen Hemminger
stephen at networkplumber.org
Tue Jan 13 16:32:58 CET 2026
On Mon, 22 Dec 2025 18:25:33 +0800
Tianhao Zhang <zhang.tianhao2 at zte.com.cn> wrote:
> V1:
> - Add pcie bar channel check after getting dtb space left.
> - Delete np soft resource uninstallation from NP online uninit process.
>
> Tianhao Zhang (2):
> net/zxdh: add pcie bar channel check
> net/zxdh: delete np soft resource uninstallation
>
> drivers/net/zxdh/zxdh_np.c | 11 +++++++----
> drivers/net/zxdh/zxdh_np.h | 2 ++
> 2 files changed, 9 insertions(+), 4 deletions(-)
>
I started using AI to review code in next-net.
It spotted some issues in these patches, please revise and resubmit.
Now let me read the two patches:---
## DPDK Patch Review: ZXDH PMD Patches
### Patch 1: `net/zxdh: add PCIe BAR channel check`
#### Commit Message
| Check | Status | Notes |
|-------|--------|-------|
| Subject ≤60 chars | ✓ Pass | 35 characters |
| Correct prefix | ✓ Pass | `net/zxdh:` is correct |
| Lowercase after colon | ✓ Pass | |
| Imperative mood | ✓ Pass | "add" |
| No trailing period | ✓ Pass | |
| Body ≤75 chars/line | ✓ Pass | |
| Body doesn't start with "It" | ✓ Pass | |
| Signed-off-by present | ✓ Pass | Real name and valid email |
#### Code Review
**Style Issues (Warning)**:
1. **Mixed changes**: The patch combines alignment/whitespace fixes with functional changes. The parameter alignment changes in `zxdh_np_dtb_queue_unused_item_num_get()` could be a separate cleanup patch. This makes the functional change harder to review.
2. **Log message style**: The error message `"pcie bar abnormal."` has a trailing period. While not strictly forbidden, DPDK log messages typically omit trailing periods for consistency.
**Code Quality (Info)**:
```c
if ((*p_item_num & ZXDH_DTB_SPACE_LEFT_MASK) == ZXDH_DTB_SPACE_LEFT_MASK) {
```
- The comparison is explicit (good) ✓
- Uses named constant (good) ✓
- Consider: what condition does `0x3F` represent? A brief comment explaining why this specific bit pattern indicates a BAR abnormality would aid maintainability.
**Commit Message Content (Warning)**:
The body text:
> After obtaining the DTB element register;
> check if the PCIe link is abnormal.
The semicolon makes this read awkwardly as two sentence fragments. Suggested rewrite:
> Add a check after obtaining the DTB element register to detect
> abnormal PCIe link conditions.
#### Verdict: **Acceptable with minor suggestions**
---
### Patch 2: `net/zxdh: optimize the procedure for NP online uninit`
#### Commit Message
| Check | Status | Notes |
|-------|--------|-------|
| Subject ≤60 chars | ✓ Pass | 52 characters |
| Correct prefix | ✓ Pass | `net/zxdh:` |
| Lowercase after colon | ✓ Pass | |
| Imperative mood | ✓ Pass | "optimize" |
| No trailing period | ✓ Pass | |
| Body ≤75 chars/line | ✓ Pass | All lines under 75 |
| Body doesn't start with "It" | ✓ Pass | Starts with "Remove" |
| Signed-off-by present | ✓ Pass | |
#### Issues Identified
**Warning - Misleading subject line**:
The subject says "optimize" which implies performance improvement, but the body describes removing code to "avoid duplicate resource release." This is actually a **bug fix** (preventing double-free or duplicate cleanup), not an optimization.
Suggested subject alternatives:
- `net/zxdh: fix duplicate resource release in NP online uninit`
- `net/zxdh: remove redundant resource uninstall from online uninit`
**Warning - Potentially missing `Fixes:` tag**:
If this corrects a bug where resources were being released twice, a `Fixes:` tag should reference the commit that introduced the duplicate release. The AGENTS.md guidelines state:
> `Fixes:` tag present for bug fixes with 12-char SHA and exact subject
**Info - Incomplete context**:
The commit message says the uninstallation "should be called separately within NP uninit" but doesn't specify where that happens. A reference to the function or location where `zxdh_np_soft_res_uninstall()` is properly called would help reviewers verify correctness.
#### Code Review
The code change itself is clean - a straightforward removal of 4 lines. No style issues.
#### Verdict: **Needs revision**
---
## Summary
| Patch | Status | Required Actions |
|-------|--------|------------------|
| 0007 (BAR check) | **Acceptable** | Consider separating alignment fixes; improve commit message clarity |
| 0008 (uninit optimize) | **Needs revision** | Fix subject line ("fix" not "optimize"); add `Fixes:` tag if applicable; clarify where resource uninstall is now called |
More information about the dev
mailing list