public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: dev@dpdk.org
Cc: Stephen Hemminger <stephen@networkplumber.org>
Subject: [REVIEW] doc/nfb: cleanup and update guide
Date: Sat, 24 Jan 2026 11:10:45 -0800	[thread overview]
Message-ID: <20260124191045.217143-1-stephen@networkplumber.org> (raw)
In-Reply-To: <20260123172224.1567362-9-spinler@cesnet.cz>

AI-generated review of bundle-1688-nfb-multiport.mbox
Reviewed using Claude (claude-opus-4-5-20251101)

This is an automated review. Please verify all suggestions.

---

# DPDK Patch Review: bundle-1688-nfb-multiport.mbox

This patch series (8 patches) enhances the NFB driver to create one ethdev per physical Ethernet port instead of one ethdev per PCI device.

---

## Patch 1/8: net/nfb: prepare for indirect queue mapping scheme

### Commit Message
- **Subject**: `net/nfb: prepare for indirect queue mapping scheme` (49 chars) ✓
- **Format**: Correct prefix, lowercase, imperative mood ✓
- **Signed-off-by**: Present ✓

### Code Review

**Warning: Unnecessary cast of void * (rte_calloc returns void *)**
```c
priv->queue_map_rx = rte_calloc("NFB queue map", (max_rx_queues + max_tx_queues),
        sizeof(*priv->queue_map_rx), 0);
```
This is actually fine - no cast is present. ✓

**Info: Variable declaration style**
```c
int i;
int ret;
```
The declaration at the top of the function is acceptable.

**Warning: Inconsistent loop variable types**
```c
for (i = 0; i < max_rx_queues; i++)
```
`i` is `int` but `max_rx_queues` is `uint16_t`. This works but could be cleaner with matching types.

---

## Patch 2/8: net/nfb: create one ethdev per ethernet port

### Commit Message
- **Subject**: `net/nfb: create one ethdev per ethernet port` (46 chars) ✓
- **Signed-off-by**: Present ✓

### Code Review

**Error: `__rte_internal` must be alone on the line preceding the return type**

In `drivers/net/nfb/nfb.h`:
```c
__rte_internal
int nfb_eth_common_probe(struct nfb_probe_params *params);
__rte_internal
int nfb_eth_common_remove(struct rte_device *dev);
```
These should be:
```c
__rte_internal
int
nfb_eth_common_probe(struct nfb_probe_params *params);

__rte_internal
int
nfb_eth_common_remove(struct rte_device *dev);
```

**Warning: Use of `snprintf` return value check pattern**
```c
ret = snprintf(pp->name + cp->basename_len, sizeof(pp->name) - cp->basename_len,
        "_eth%d", ifc->id);
if (ret < 0 || ret >= (signed int)sizeof(pp->name) - cp->basename_len)
```
The cast to `(signed int)` is unnecessary and the calculation on the right side could overflow. Consider using a clearer pattern.

**Warning: Empty line before new struct member**
```c
struct pmd_internals {
    ...
    struct nfb_device *nfb;

    TAILQ_ENTRY(pmd_internals) eth_dev_list;  /**< Item in list of all devices */
```
Inconsistent blank line usage within struct definition.

**Info: Static global initialization**
```c
static struct nfb_pmd_internals_head nfb_eth_dev_list =
    TAILQ_HEAD_INITIALIZER(nfb_eth_dev_list);
```
This is acceptable.

---

## Patch 3/8: net/nfb: add vdev as alternative device probe method

### Commit Message
- **Subject**: `net/nfb: add vdev as alternative device probe method` (50 chars) ✓
- **Signed-off-by**: Present ✓

### Code Review

**Error: Missing SPDX on line 1 - actually present and correct** ✓

**Warning: Use of standard library `strdup` instead of DPDK equivalent**
```c
dev_params = strdup(vdev_args);
```
Consider using `rte_strdup()` or documenting why standard `strdup` is appropriate here.

**Warning: Use of standard library `free` instead of DPDK equivalent**
```c
free(dev_params);
```
Should use `rte_free()` if `rte_malloc()` family was used, but since `strdup` was used, `free` is correct.

**Info: Consistent error handling pattern** ✓

---

## Patch 4/8: net/nfb: add device argument "port" to limit used ports

### Commit Message
- **Subject**: `net/nfb: add device argument "port" to limit used ports` (53 chars) ✓
- **Signed-off-by**: Present ✓

### Code Review

**Warning: Missing include for `isdigit`**
```c
if (value == NULL || strlen(value) == 0 || !isdigit(*value))
```
Needs `#include <ctype.h>` for `isdigit()`.

**Warning: Implicit integer conversion**
```c
if (*end != '\0' || port >= (unsigned long)ifc_params->map_info.ifc_cnt)
```
The cast to `unsigned long` is explicit, which is good.

---

## Patch 5/8: net/nfb: init only MACs associated with device

### Commit Message
- **Subject**: `net/nfb: init only MACs associated with device` (46 chars) ✓
- **Signed-off-by**: Present ✓

### Code Review

**Warning: Use of standard library `calloc` and `free`**
```c
intl->rxmac = calloc(ifc->eth_cnt, sizeof(*intl->rxmac));
...
free(intl->txmac);
free(intl->rxmac);
```
Should consider using `rte_calloc()` and `rte_free()` for consistency with DPDK memory management, especially if these structures may be accessed in data path or shared between processes.

**Info: Loop variable type consistency**
```c
int i, rxm, txm;
...
for (i = 0; i < mi->eth_cnt; i++) {
```
Types are consistent within the function.

---

## Patch 6/8: net/nfb: add compatible cards to driver PCI ID table

### Commit Message
- **Subject**: `net/nfb: add compatible cards to driver PCI ID table` (52 chars) ✓
- **Signed-off-by**: Present ✓

### Code Review
No issues found. Simple addition of PCI IDs. ✓

---

## Patch 7/8: net/nfb: report firmware version

### Commit Message
- **Subject**: `net/nfb: report firmware version` (33 chars) ✓
- **Signed-off-by**: Present ✓

### Code Review

**Info: Good error handling pattern**
```c
if (proj_name == NULL)
    proj_name = "";
if (proj_vers == NULL)
    proj_vers = "";
```
Proper NULL pointer handling. ✓

**Info: Return value calculation**
```c
if (ret >= (signed int)fw_size)
    return strlen(proj_name) + 1 + strlen(proj_vers) + 1;
```
Returns required buffer size when buffer is too small - follows DPDK convention. ✓

---

## Patch 8/8: doc/nfb: cleanup and update guide

### Commit Message
- **Subject**: `doc/nfb: cleanup and update guide` (35 chars) ✓
- **Signed-off-by**: Present ✓

### Documentation Review

**Info: Good documentation update**
- Added features to `features/nfb.ini` ✓
- Updated `nfb.rst` with current information ✓
- Added release notes entry ✓

**Warning: Release notes mention "timestamp value has been updated" but no timestamp changes in this series**
The release notes state:
```
* The timestamp value has been updated to make it usable.
```
But there are no timestamp-related code changes in this patch series. This may be referring to changes in a previous version or should be removed.

---

## Summary

### Errors (Must Fix)
1. **Patch 2**: `__rte_internal` functions in header file must have return type on separate line

### Warnings (Should Fix)
1. **Patch 2**: Empty line inconsistency in struct definition
2. **Patch 3**: Consider documenting use of standard `strdup`/`free`
3. **Patch 4**: Missing `#include <ctype.h>` for `isdigit()`
4. **Patch 5**: Consider using `rte_calloc()`/`rte_free()` instead of standard library functions
5. **Patch 8**: Release notes mention timestamp changes not present in this series

### Info (Consider)
1. Loop variable type consistency could be improved in some places
2. Overall code organization and error handling patterns are good
3. Documentation updates are comprehensive

### Overall Assessment
The patch series is well-structured and addresses a clear functional enhancement. The main blocking issue is the `__rte_internal` formatting in patch 2. Other warnings should be addressed for better code quality and DPDK consistency.

  reply	other threads:[~2026-01-24 19:10 UTC|newest]

Thread overview: 131+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2026-01-15 15:16 [PATCH 0/8] net/nfb: rework to real multiport spinler
2026-01-15 15:16 ` [PATCH 1/8] net/nfb: prepare for indirect queue mapping scheme spinler
2026-01-16 17:34   ` Stephen Hemminger
2026-01-20 15:16     ` Martin Spinler
2026-01-15 15:16 ` [PATCH 2/8] net/nfb: create ethdev for every eth port/channel spinler
2026-01-15 15:16 ` [PATCH 3/8] net/nfb: add vdev as alternative device probe method spinler
2026-01-15 15:16 ` [PATCH 4/8] net/nfb: add device argument "port" to limit used ports spinler
2026-01-16 17:36   ` Stephen Hemminger
2026-01-20 15:16     ` Martin Spinler
2026-01-16 17:36   ` Stephen Hemminger
2026-01-16 17:37   ` Stephen Hemminger
2026-01-15 15:16 ` [PATCH 5/8] net/nfb: init only MACs associated with device spinler
2026-01-15 15:16 ` [PATCH 6/8] net/nfb: add compatible cards to driver PCI ID table spinler
2026-01-15 15:16 ` [PATCH 7/8] net/nfb: report firmware version spinler
2026-01-15 15:16 ` [PATCH 8/8] doc/nfb: cleanup and update guide spinler
2026-01-16  5:50 ` [PATCH 0/8] net/nfb: rework to real multiport Stephen Hemminger
2026-01-16 16:44 ` [PATCH v2 " spinler
2026-01-16 16:44   ` [PATCH v2 1/8] net/nfb: prepare for indirect queue mapping scheme spinler
2026-01-16 16:44   ` [PATCH v2 2/8] net/nfb: create ethdev for every eth port/channel spinler
2026-01-16 16:44   ` [PATCH v2 3/8] net/nfb: add vdev as alternative device probe method spinler
2026-01-16 16:44   ` [PATCH v2 4/8] net/nfb: add device argument "port" to limit used ports spinler
2026-01-16 16:44   ` [PATCH v2 5/8] net/nfb: init only MACs associated with device spinler
2026-01-16 16:44   ` [PATCH v2 6/8] net/nfb: add compatible cards to driver PCI ID table spinler
2026-01-16 16:44   ` [PATCH v2 7/8] net/nfb: report firmware version spinler
2026-01-16 16:44   ` [PATCH v2 8/8] doc/nfb: cleanup and update guide spinler
2026-01-20  2:25   ` [PATCH v2 0/8] net/nfb: rework to real multiport Stephen Hemminger
2026-01-20 15:16     ` Martin Spinler
2026-01-21 17:03 ` [PATCH v3 " spinler
2026-01-21 17:03   ` [PATCH v3 1/8] net/nfb: prepare for indirect queue mapping scheme spinler
2026-01-21 17:03   ` [PATCH v3 2/8] net/nfb: create ethdev for every eth port/channel spinler
2026-01-21 17:03   ` [PATCH v3 3/8] net/nfb: add vdev as alternative device probe method spinler
2026-01-21 17:40     ` Stephen Hemminger
2026-01-21 17:03   ` [PATCH v3 4/8] net/nfb: add device argument "port" to limit used ports spinler
2026-01-21 17:03   ` [PATCH v3 5/8] net/nfb: init only MACs associated with device spinler
2026-01-21 17:03   ` [PATCH v3 6/8] net/nfb: add compatible cards to driver PCI ID table spinler
2026-01-21 17:03   ` [PATCH v3 7/8] net/nfb: report firmware version spinler
2026-01-21 17:03   ` [PATCH v3 8/8] doc/nfb: cleanup and update guide spinler
2026-01-21 17:41     ` Stephen Hemminger
2026-01-21 17:42   ` [PATCH v3 0/8] net/nfb: rework to real multiport Stephen Hemminger
2026-01-22  7:27 ` [PATCH v4 " spinler
2026-01-22  7:27   ` [PATCH v4 1/8] net/nfb: prepare for indirect queue mapping scheme spinler
2026-01-22  7:27   ` [PATCH v4 2/8] net/nfb: create ethdev for every eth port/channel spinler
2026-01-22  7:27   ` [PATCH v4 3/8] net/nfb: add vdev as alternative device probe method spinler
2026-01-22  7:27   ` [PATCH v4 4/8] net/nfb: add device argument "port" to limit used ports spinler
2026-01-22  7:27   ` [PATCH v4 5/8] net/nfb: init only MACs associated with device spinler
2026-01-22  7:27   ` [PATCH v4 6/8] net/nfb: add compatible cards to driver PCI ID table spinler
2026-01-22  7:27   ` [PATCH v4 7/8] net/nfb: report firmware version spinler
2026-01-22  7:27   ` [PATCH v4 8/8] doc/nfb: cleanup and update guide spinler
2026-01-23  1:00   ` [PATCH v4 0/8] net/nfb: rework to real multiport Stephen Hemminger
2026-01-23  1:01   ` Stephen Hemminger
2026-01-23  1:14   ` Stephen Hemminger
2026-01-23 17:34     ` Martin Spinler
2026-01-23 17:22 ` [PATCH v5 " spinler
2026-01-23 17:22   ` [PATCH v5 1/8] net/nfb: prepare for indirect queue mapping scheme spinler
2026-01-23 17:22   ` [PATCH v5 2/8] net/nfb: create one ethdev per ethernet port spinler
2026-01-27  0:37     ` Stephen Hemminger
2026-01-27  8:12       ` Martin Spinler
2026-01-27 14:09         ` Stephen Hemminger
2026-01-23 17:22   ` [PATCH v5 3/8] net/nfb: add vdev as alternative device probe method spinler
2026-01-23 17:22   ` [PATCH v5 4/8] net/nfb: add device argument "port" to limit used ports spinler
2026-01-23 17:22   ` [PATCH v5 5/8] net/nfb: init only MACs associated with device spinler
2026-01-23 17:22   ` [PATCH v5 6/8] net/nfb: add compatible cards to driver PCI ID table spinler
2026-01-23 17:22   ` [PATCH v5 7/8] net/nfb: report firmware version spinler
2026-01-23 17:22   ` [PATCH v5 8/8] doc/nfb: cleanup and update guide spinler
2026-01-24 19:10     ` Stephen Hemminger [this message]
2026-01-24 19:19   ` [PATCH v5 0/8] net/nfb: rework to real multiport Stephen Hemminger
2026-02-02 15:34 ` [PATCH v6 " spinler
2026-02-02 15:34   ` [PATCH v6 1/8] net/nfb: prepare for indirect queue mapping scheme spinler
2026-02-02 17:50     ` Stephen Hemminger
2026-02-02 15:34   ` [PATCH v6 2/8] net/nfb: create one ethdev per ethernet port spinler
2026-02-02 15:34   ` [PATCH v6 3/8] net/nfb: add vdev as alternative device probe method spinler
2026-02-02 15:34   ` [PATCH v6 4/8] net/nfb: add device argument "port" to limit used ports spinler
2026-02-02 15:34   ` [PATCH v6 5/8] net/nfb: init only MACs associated with device spinler
2026-02-02 15:34   ` [PATCH v6 6/8] net/nfb: add compatible cards to driver PCI ID table spinler
2026-02-02 15:34   ` [PATCH v6 7/8] net/nfb: report firmware version spinler
2026-02-02 15:34   ` [PATCH v6 8/8] doc/nfb: cleanup and update guide spinler
2026-02-02 17:42     ` [REVIEW] " Stephen Hemminger
2026-02-02 17:51       ` Stephen Hemminger
2026-02-02 17:52       ` Stephen Hemminger
2026-02-02 17:54       ` Stephen Hemminger
2026-02-02 17:54       ` Stephen Hemminger
2026-02-04 12:31 ` [PATCH v7 0/8] net/nfb: rework to real multiport spinler
2026-02-04 12:31   ` [PATCH v7 1/8] net/nfb: prepare for indirect queue mapping scheme spinler
2026-02-04 12:31   ` [PATCH v7 2/8] net/nfb: create one ethdev per ethernet port spinler
2026-02-04 12:31   ` [PATCH v7 3/8] net/nfb: add vdev as alternative device probe method spinler
2026-02-04 12:31   ` [PATCH v7 4/8] net/nfb: add device argument "port" to limit used ports spinler
2026-02-04 12:31   ` [PATCH v7 5/8] net/nfb: init only MACs associated with device spinler
2026-02-04 12:31   ` [PATCH v7 6/8] net/nfb: add compatible cards to driver PCI ID table spinler
2026-02-04 12:31   ` [PATCH v7 7/8] net/nfb: report firmware version spinler
2026-02-04 12:31   ` [PATCH v7 8/8] doc/nfb: cleanup and update guide spinler
2026-02-10  0:35   ` [PATCH v7 0/8] net/nfb: rework to real multiport Stephen Hemminger
2026-02-13 18:53     ` Martin Špinler
2026-02-12 18:35   ` Stephen Hemminger
2026-02-13 18:53     ` Martin Špinler
2026-02-13 18:53 ` [PATCH v8 " spinler
2026-02-13 18:53   ` [PATCH v8 1/8] net/nfb: prepare for indirect queue mapping scheme spinler
2026-02-13 18:53   ` [PATCH v8 2/8] net/nfb: create one ethdev per ethernet port spinler
2026-02-13 19:33     ` Stephen Hemminger
2026-02-13 18:53   ` [PATCH v8 3/8] net/nfb: add vdev as alternative device probe method spinler
2026-02-13 18:53   ` [PATCH v8 4/8] net/nfb: add device argument "port" to limit used ports spinler
2026-02-13 18:53   ` [PATCH v8 5/8] net/nfb: init only MACs associated with device spinler
2026-02-13 18:53   ` [PATCH v8 6/8] net/nfb: add compatible cards to driver PCI ID table spinler
2026-02-13 18:53   ` [PATCH v8 7/8] net/nfb: report firmware version spinler
2026-02-13 18:53   ` [PATCH v8 8/8] doc/nfb: cleanup and update guide spinler
2026-02-13 19:39   ` [PATCH v8 0/8] net/nfb: rework to real multiport Stephen Hemminger
2026-02-13 20:13     ` Martin Špinler
2026-02-16 16:24 ` [PATCH v9 " spinler
2026-02-16 16:24   ` [PATCH v9 1/8] net/nfb: prepare for indirect queue mapping scheme spinler
2026-02-16 16:25   ` [PATCH v9 2/8] net/nfb: create one ethdev per ethernet port spinler
2026-02-16 16:25   ` [PATCH v9 3/8] net/nfb: add vdev as alternative device probe method spinler
2026-02-16 16:25   ` [PATCH v9 4/8] net/nfb: add device argument "port" to limit used ports spinler
2026-02-16 16:25   ` [PATCH v9 5/8] net/nfb: init only MACs associated with device spinler
2026-02-16 16:25   ` [PATCH v9 6/8] net/nfb: add compatible cards to driver PCI ID table spinler
2026-02-16 16:25   ` [PATCH v9 7/8] net/nfb: report firmware version spinler
2026-02-16 16:25   ` [PATCH v9 8/8] doc/nfb: cleanup and update guide spinler
2026-02-16 22:11   ` [PATCH v9 0/8] net/nfb: rework to real multiport Stephen Hemminger
2026-02-17  7:09     ` Martin Spinler
2026-02-17  7:10 ` [PATCH v10 " spinler
2026-02-17  7:10   ` [PATCH v10 1/8] net/nfb: prepare for indirect queue mapping scheme spinler
2026-02-17  7:10   ` [PATCH v10 2/8] net/nfb: create one ethdev per ethernet port spinler
2026-02-17  7:10   ` [PATCH v10 3/8] net/nfb: add vdev as alternative device probe method spinler
2026-02-17  7:10   ` [PATCH v10 4/8] net/nfb: add device argument "port" to limit used ports spinler
2026-02-17  7:10   ` [PATCH v10 5/8] net/nfb: init only MACs associated with device spinler
2026-02-17  7:10   ` [PATCH v10 6/8] net/nfb: add compatible cards to driver PCI ID table spinler
2026-02-17  7:10   ` [PATCH v10 7/8] net/nfb: report firmware version spinler
2026-02-17  7:10   ` [PATCH v10 8/8] doc/nfb: cleanup and update guide spinler
2026-03-13 16:48     ` Thomas Monjalon
2026-02-17 14:58   ` [PATCH v10 0/8] net/nfb: rework to real multiport Stephen Hemminger
2026-02-17 15:05     ` Martin Spinler
2026-02-17 15:22       ` Martin Spinler
2026-02-19  0:12   ` Stephen Hemminger

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=20260124191045.217143-1-stephen@networkplumber.org \
    --to=stephen@networkplumber.org \
    --cc=dev@dpdk.org \
    /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 a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox