From: Stephen Hemminger <stephen@networkplumber.org>
To: spinler@cesnet.cz
Cc: dev@dpdk.org
Subject: Re: [PATCH v2 0/6] net/nfb: code cleanup
Date: Thu, 15 Jan 2026 21:48:49 -0800 [thread overview]
Message-ID: <20260115214849.623db82c@phoenix.local> (raw)
In-Reply-To: <20260115144040.345873-1-spinler@cesnet.cz>
On Thu, 15 Jan 2026 15:40:34 +0100
spinler@cesnet.cz wrote:
> From: Martin Spinler <spinler@cesnet.cz>
>
> This patchset mainly cleans up the code and prepare it for another
> quite large rework. Also it resolves some unpleasant behavior.
>
> ---
> v2:
> * Fixed coding style issues
>
> Martin Spinler (6):
> net/nfb: use constant values for max Rx/Tx queues count
> net/nfb: fix bad pointer access in queue stats
> net/nfb: update timestamp calculation to meaningful value
> net/nfb: use process private variable for internal data
> net/nfb: release allocated resources correctly
> net/nfb: stop only started queues in fail path
>
> doc/guides/nics/nfb.rst | 6 +-
> drivers/net/nfb/nfb.h | 5 ++
> drivers/net/nfb/nfb_ethdev.c | 165 ++++++++++++++++++++---------------
> drivers/net/nfb/nfb_rx.c | 2 +-
> drivers/net/nfb/nfb_rx.h | 13 +--
> drivers/net/nfb/nfb_rxmode.c | 12 +--
> drivers/net/nfb/nfb_stats.c | 46 +++++-----
> drivers/net/nfb/nfb_tx.c | 2 +-
> 8 files changed, 142 insertions(+), 109 deletions(-)
>
> --
> 2.52.0
>
Looks ok but AI code review spotted somethings that need to be addressed.
---
## DPDK NFB Driver Patchset Review
**Series:** net/nfb cleanup (6 patches, v2)
**Submitter:** Martin Spinler <spinler@cesnet.cz>
---
### Patch 1/6: `net/nfb: use constant values for max Rx/Tx queues count`
| Check | Status | Notes |
|-------|--------|-------|
| Subject length | ✅ PASS | 51 chars (≤60) |
| Subject format | ✅ PASS | Lowercase after colon, no trailing period |
| Component prefix | ✅ PASS | `net/nfb:` is correct |
| Signed-off-by | ✅ PASS | Present with valid name/email |
| Fixes tag | ✅ PASS | `Fixes: 6435f9a0ac22` (12-char SHA) |
| Cc: stable | ✅ PASS | Present |
| Tag order | ✅ PASS | Fixes before Cc, blank line before Signed-off-by |
| Body doesn't start with "It" | ✅ PASS | Starts with "The" |
**Code Review:**
- Clean addition of `max_rx_queues` and `max_tx_queues` to `pmd_internals` structure
- Proper initialization from hardware counts instead of mutable `nb_*_queues`
**Issue (Warning):** The log message at line 543 still references `data->nb_rx_queues` / `data->nb_tx_queues` which will be 0 at that point since they're no longer initialized. Should log `internals->max_rx_queues` and `internals->max_tx_queues` instead.
---
### Patch 2/6: `net/nfb: fix bad pointer access in queue stats`
| Check | Status | Notes |
|-------|--------|-------|
| Subject length | ✅ PASS | 47 chars |
| Subject format | ✅ PASS | Correct format |
| Signed-off-by | ✅ PASS | Present |
| Fixes tag | ✅ PASS | Present with 12-char SHA |
| Cc: stable | ✅ PASS | Present |
| Body doesn't start with "It" | ✅ PASS | Starts with "The" |
**Code Review:**
- Correctly fixes the pointer dereference pattern from `rx_queue[i].rx_pkts` to `rx_queue->rx_pkts`
- The original code treated an array of pointers as an array of structures — this is a legitimate bug fix
**Issue (Warning):** Still missing NULL pointer checks before dereferencing `dev->data->rx_queues[i]` and `dev->data->tx_queues[i]`. The commit message mentions the pointer can be NULL, but the fix doesn't add the NULL check.
---
### Patch 3/6: `net/nfb: update timestamp calculation to meaningful value`
| Check | Status | Notes |
|-------|--------|-------|
| Subject length | ✅ PASS | 55 chars |
| Subject format | ✅ PASS | Correct format |
| Signed-off-by | ✅ PASS | Present |
| Fixes tag | ⚠️ **MISSING** | This is a bug fix (non-monotonic timestamp) |
| Cc: stable | ⚠️ **MISSING** | Should be present for bug fixes |
| Body doesn't start with "It" | ✅ PASS | Starts with "The" |
| Doc + code atomic | ✅ PASS | Both `nfb.rst` and `nfb_rx.h` updated together |
**Recommendation:** Add:
```
Fixes: 6435f9a0ac22 ("net/nfb: add new netcope driver")
Cc: stable@dpdk.org
```
---
### Patch 4/6: `net/nfb: use process private variable for internal data`
| Check | Status | Notes |
|-------|--------|-------|
| Subject length | ✅ PASS | 56 chars |
| Subject format | ✅ PASS | Correct format |
| Signed-off-by | ✅ PASS | Present |
| Fixes tag | ⚠️ **MISSING** | This fixes multi-process support |
| Cc: stable | ⚠️ **MISSING** | Should be present for fixes |
**Code Issues:**
1. **Error (Style):** Line 148 changes a Doxygen comment to broken format:
```c
-/**
+/* *
```
This breaks Doxygen documentation parsing. Should remain `/**` or be changed to `/*` (without the space after asterisk).
2. **Warning:** The new `struct pmd_priv` only contains `max_rx_queues` and `max_tx_queues` as `int` types. These should likely be `uint16_t` to match the DPDK convention for queue counts.
---
### Patch 5/6: `net/nfb: release allocated resources correctly`
| Check | Status | Notes |
|-------|--------|-------|
| Subject length | ✅ PASS | 49 chars |
| Subject format | ✅ PASS | Correct format |
| Signed-off-by | ✅ PASS | Present |
| Fixes tag | ⚠️ **MISSING** | This fixes resource leaks |
| Cc: stable | ⚠️ **MISSING** | Should be present |
**Code Review:**
- Good refactoring of cleanup paths using `goto` error handling
- Properly separates primary vs secondary process cleanup
**Issue (Warning):** Forward declaration added at line 21:
```c
static int nfb_eth_dev_uninit(struct rte_eth_dev *dev);
```
This is fine, but the blank line before it creates two consecutive blank lines which is non-standard.
---
### Patch 6/6: `net/nfb: stop only started queues in fail path`
| Check | Status | Notes |
|-------|--------|-------|
| Subject length | ✅ PASS | 47 chars |
| Subject format | ✅ PASS | Correct format |
| Signed-off-by | ✅ PASS | Present |
| Fixes tag | ⚠️ **MISSING** | This is a bug fix |
| Cc: stable | ⚠️ **MISSING** | Should be present |
**Code Review:**
- Correctly uses reverse iteration to only stop queues that were successfully started
- Loop logic is correct: `for (; i > 0; i--)` then `stop(dev, i - 1)`
---
## Summary
### Errors (Must Fix)
| Patch | Issue |
|-------|-------|
| 4/6 | Broken Doxygen comment: `/* *` should be `/**` or `/*` |
### Warnings (Should Fix)
| Patch | Issue |
|-------|-------|
| 1/6 | Log message references uninitialized `data->nb_*_queues` |
| 2/6 | Missing NULL checks for queue pointers (mentioned in commit but not implemented) |
| 3/6 | Missing `Fixes:` tag and `Cc: stable@dpdk.org` |
| 4/6 | Missing `Fixes:` tag and `Cc: stable@dpdk.org`; consider `uint16_t` for queue counts |
| 5/6 | Missing `Fixes:` tag and `Cc: stable@dpdk.org`; extra blank line before forward declaration |
| 6/6 | Missing `Fixes:` tag and `Cc: stable@dpdk.org` |
### Info (Consider)
- The series is well-structured with logical patch ordering
- Good that patches 1 and 2 have proper `Fixes:` tags — patches 3-6 should follow the same pattern
- Documentation is updated atomically with code in patch 3
### Verdict
**Needs revision.** The main blocker is the broken Doxygen comment in patch 4/6. Additionally, patches 3-6 should have `Fixes:` tags and `Cc: stable@dpdk.org` since they all fix bugs in the original driver.
next prev parent reply other threads:[~2026-01-16 5:48 UTC|newest]
Thread overview: 58+ messages / expand[flat|nested] mbox.gz Atom feed top
2026-01-15 14:01 [PATCH 0/6] spinler
2026-01-15 14:01 ` [PATCH 1/6] net/nfb: use constant values for max Rx/Tx queues count spinler
2026-01-15 14:01 ` [PATCH 2/6] net/nfb: fix bad pointer access in queue stats spinler
2026-01-15 14:01 ` [PATCH 3/6] net/nfb: update timestamp calculation to meaningful value spinler
2026-01-15 14:01 ` [PATCH 4/6] net/nfb: use process private variable for internal data spinler
2026-01-15 14:01 ` [PATCH 5/6] net/nfb: release allocated resources correctly spinler
2026-01-15 14:01 ` [PATCH 6/6] net/nfb: stop only started queues in fail path spinler
2026-01-15 14:40 ` [PATCH v2 0/6] net/nfb: code cleanup spinler
2026-01-15 14:40 ` [PATCH v2 1/6] net/nfb: use constant values for max Rx/Tx queues count spinler
2026-01-15 14:40 ` [PATCH v2 2/6] net/nfb: fix bad pointer access in queue stats spinler
2026-01-15 14:40 ` [PATCH v2 3/6] net/nfb: update timestamp calculation to meaningful value spinler
2026-01-15 14:40 ` [PATCH v2 4/6] net/nfb: use process private variable for internal data spinler
2026-01-15 14:40 ` [PATCH v2 5/6] net/nfb: release allocated resources correctly spinler
2026-01-15 14:40 ` [PATCH v2 6/6] net/nfb: stop only started queues in fail path spinler
2026-01-16 5:48 ` Stephen Hemminger [this message]
2026-01-16 9:42 ` [PATCH v2 0/6] net/nfb: code cleanup Martin Spinler
2026-01-16 17:39 ` Stephen Hemminger
2026-01-16 15:20 ` spinler
2026-01-16 15:20 ` [PATCH v3 1/6] net/nfb: use constant values for max Rx/Tx queues count spinler
2026-02-02 17:47 ` Stephen Hemminger
2026-02-02 18:58 ` Martin Špinler
2026-01-16 15:20 ` [PATCH v3 2/6] net/nfb: fix bad pointer access in queue stats spinler
2026-01-16 15:20 ` [PATCH v3 3/6] net/nfb: update timestamp calculation to meaningful value spinler
2026-01-16 15:20 ` [PATCH v3 4/6] net/nfb: use process private variable for internal data spinler
2026-01-20 0:13 ` Stephen Hemminger
2026-01-20 14:13 ` Martin Spinler
2026-01-20 16:11 ` Stephen Hemminger
2026-01-16 15:20 ` [PATCH v3 5/6] net/nfb: release allocated resources correctly spinler
2026-01-20 0:10 ` Stephen Hemminger
2026-01-20 14:14 ` Martin Spinler
2026-01-16 15:20 ` [PATCH v3 6/6] net/nfb: stop only started queues in fail path spinler
2026-01-20 0:09 ` Stephen Hemminger
2026-01-20 14:14 ` Martin Spinler
2026-01-16 15:22 ` [PATCH v3 0/6] net/nfb: code cleanup spinler
2026-01-21 4:57 ` Stephen Hemminger
2026-01-21 17:01 ` [PATCH v4 " spinler
2026-01-21 17:01 ` [PATCH v4 1/6] net/nfb: use constant values for max Rx/Tx queues count spinler
2026-01-21 17:01 ` [PATCH v4 2/6] net/nfb: fix bad pointer access in queue stats spinler
2026-01-21 17:01 ` [PATCH v4 3/6] net/nfb: update timestamp calculation to meaningful value spinler
2026-01-21 17:33 ` Stephen Hemminger
2026-01-27 8:12 ` Martin Spinler
2026-01-27 0:34 ` Stephen Hemminger
2026-01-27 8:16 ` Martin Spinler
2026-01-21 17:01 ` [PATCH v4 4/6] net/nfb: use process private variable for internal data spinler
2026-01-21 17:01 ` [PATCH v4 5/6] net/nfb: release allocated resources correctly spinler
2026-01-21 17:01 ` [PATCH v4 6/6] net/nfb: stop only started queues in fail path spinler
2026-01-21 17:35 ` [PATCH v4 0/6] net/nfb: code cleanup Stephen Hemminger
2026-02-02 19:33 ` [PATCH v5 " spinler
2026-02-02 19:33 ` [PATCH v5 1/6] net/nfb: use constant values for max Rx/Tx queues count spinler
2026-02-02 19:33 ` [PATCH v5 2/6] net/nfb: fix bad pointer access in queue stats spinler
2026-02-10 0:51 ` Stephen Hemminger
2026-02-02 19:33 ` [PATCH v5 3/6] net/nfb: update timestamp calculation to meaningful value spinler
2026-02-02 19:33 ` [PATCH v5 4/6] net/nfb: use process private variable for internal data spinler
2026-02-02 19:33 ` [PATCH v5 5/6] net/nfb: release allocated resources correctly spinler
2026-02-10 0:52 ` Stephen Hemminger
2026-02-02 19:33 ` [PATCH v5 6/6] net/nfb: stop only started queues in fail path spinler
2026-02-03 1:50 ` [PATCH v5 0/6] net/nfb: code cleanup Stephen Hemminger
2026-02-03 6:36 ` Martin Spinler
Reply instructions:
You may reply publicly to this message via plain-text email
using any one of the following methods:
* Save the following mbox file, import it into your mail client,
and reply-to-all from there: mbox
Avoid top-posting and favor interleaved quoting:
https://en.wikipedia.org/wiki/Posting_style#Interleaved_style
* Reply using the --to, --cc, and --in-reply-to
switches of git-send-email(1):
git send-email \
--in-reply-to=20260115214849.623db82c@phoenix.local \
--to=stephen@networkplumber.org \
--cc=dev@dpdk.org \
--cc=spinler@cesnet.cz \
/path/to/YOUR_REPLY
https://kernel.org/pub/software/scm/git/docs/git-send-email.html
* If your mail client supports setting the In-Reply-To header
via mailto: links, try the mailto: link
Be sure your reply has a Subject: header at the top and a blank line
before the message body.
This is an external index of several public inboxes,
see mirroring instructions on how to clone and mirror
all data and code used by this external index.