public inbox for dev@dpdk.org
 help / color / mirror / Atom feed
From: Stephen Hemminger <stephen@networkplumber.org>
To: Jake Freeland <jfree@FreeBSD.org>
Cc: Anatoly Burakov <anatoly.burakov@intel.com>,
	Bruce Richardson <bruce.richardson@intel.com>,
	dev@dpdk.org
Subject: Re: [PATCH v2 0/3] EAL memory fixes
Date: Thu, 22 Jan 2026 21:09:31 -0800	[thread overview]
Message-ID: <20260122210931.05d3ed8b@phoenix.local> (raw)
In-Reply-To: <20250814213246.4141803-1-jfree@FreeBSD.org>

On Thu, 14 Aug 2025 16:32:42 -0500
Jake Freeland <jfree@FreeBSD.org> wrote:

> Hi there,
> 
> This patchset contains a number of EAL-specific memory fixes that I've
> made over the last year. Two pertain to FreeBSD, one pertains to Linux.
> 
> v2:
> * Log messages are no longer split across multiple lines.
> * The patch titled "Do not index out of bounds in memseg list" has been
>   removed since there was no indexing out of bounds happening.
> * A new patch has been added per Anatoly's recommendation that starts
>   searching for memseg entries after the last used entry.
> 
> Jake Freeland (3):
>   eal/freebsd: Do not use prev_ms_idx for hole detection
>   eal/freebsd: Avoid claiming memseg holes
>   eal/linux: Check hugepage access permissions
> 
>  lib/eal/freebsd/eal_memory.c      | 24 +++++++++++++++++++-----
>  lib/eal/linux/eal_hugepage_info.c |  7 +++++++
>  2 files changed, 26 insertions(+), 5 deletions(-)
> 
> --
> 2.47.2
> 

AI review of this series is mostly positive

=== Patch Review: bundle-1679-eal-freebsd.mbox (via Claude) ===
# DPDK Patch Review: eal/freebsd Memory Management Fixes

## Summary
This patch series contains 3 commits addressing memory management issues in FreeBSD EAL and adding permission checks for Linux hugepage directories.

---

## Patch 1/3: eal/freebsd: Do not use prev_ms_idx for hole detection

### Errors
None found.

### Warnings

1. **Subject line capitalization issue**
   - Subject: `eal/freebsd: Do not use prev_ms_idx for hole detection`
   - "Do" should be lowercase after the colon per guidelines
   - Should be: `eal/freebsd: do not use prev_ms_idx for hole detection`

### Info
- Commit message is clear and explains the problem well
- `Signed-off-by` and `Acked-by` tags present and in correct order
- Code change is minimal and focused
- Line lengths are within limits

---

## Patch 2/3: eal/freebsd: Avoid claiming memseg holes

### Errors
None found.

### Warnings

1. **Subject line capitalization issue**
   - Subject: `eal/freebsd: Avoid claiming memseg holes`
   - "Avoid" should be lowercase after the colon
   - Should be: `eal/freebsd: avoid claiming memseg holes`

2. **Variable declaration style inconsistency**
   ```c
   for (msl_idx = 0; msl_idx < RTE_MAX_MEMSEG_LISTS;
   				msl_idx++) {
   	int start_idx, num_elems;
   	bool empty, need_hole;
   ```
   - The new variables `start_idx` and `num_elems` are declared at the start of the block, which is acceptable. However, they could be declared closer to their point of use or initialized when meaningful values exist.

3. **Potential logic issue with start_idx check**
   ```c
   start_idx = rte_fbarray_find_prev_n_used(
   		arr, arr->len - 1, 1) + 1;
   if (start_idx < 0)
   	start_idx = 0;
   ```
   - Since `rte_fbarray_find_prev_n_used()` returns -1 on failure, and then +1 is added, `start_idx` would be 0 when the function fails, making the `if (start_idx < 0)` check unreachable. This appears to be dead code. Consider:
   ```c
   start_idx = rte_fbarray_find_prev_n_used(arr, arr->len - 1, 1);
   if (start_idx < 0)
   	start_idx = 0;
   else
   	start_idx++;
   ```

### Info
- Commit message explains the fix adequately
- Tags are present and in correct order

---

## Patch 3/3: eal/linux: Check hugepage access permissions

### Errors
None found.

### Warnings

1. **Subject line capitalization issue**
   - Subject: `eal/linux: Check hugepage access permissions`
   - "Check" should be lowercase after the colon
   - Should be: `eal/linux: check hugepage access permissions`

2. **Use of lowercase log message**
   - The log message uses lowercase which is inconsistent with some other EAL log messages, though this is a minor style preference.

### Info

1. **Consider using `faccessat()` for race-free checks**
   - The `access()` function has TOCTOU (time-of-check-time-of-use) race conditions. While this is likely acceptable for this use case (startup configuration), it's worth noting.

2. **Good defensive programming**
   - Adding permission checks before attempting to use mountpoints improves error handling and user feedback.

3. **Commit message is clear and concise**

---

## General Observations

### All Patches
- All patches have proper `Signed-off-by` tags with real names and valid email addresses
- All patches have `Acked-by` from the maintainer
- Tag order is correct (Signed-off-by before Acked-by)
- No trailing whitespace detected
- Line lengths appear to be within 100 character limit for code
- Commit body lines are within 75 character limit
- Files have appropriate licenses (existing files being modified)

### Missing Items (Info level)
- No `Fixes:` tag on patches 1 and 2, which appear to be bug fixes. If these fix regressions from specific commits, a `Fixes:` tag should be added.
- No `Cc: stable@dpdk.org` tag if these are candidates for backporting to stable releases.

---

## Summary of Required Changes

| Severity | Count | Items |
|----------|-------|-------|
| Error | 0 | - |
| Warning | 4 | 3x subject line capitalization, 1x potential dead code |
| Info | 4 | Missing Fixes tags, TOCTOU note, style preferences |

### Recommended Actions

1. **Fix subject lines** (all 3 patches): Change to lowercase after colon
   - `eal/freebsd: do not use prev_ms_idx for hole detection`
   - `eal/freebsd: avoid claiming memseg holes`
   - `eal/linux: check hugepage access permissions`

2. **Review the start_idx logic** in patch 2 to ensure the `< 0` check is reachable

3. **Consider adding `Fixes:` tags** if these address specific regressions

  parent reply	other threads:[~2026-01-23  5:09 UTC|newest]

Thread overview: 20+ messages / expand[flat|nested]  mbox.gz  Atom feed  top
2025-08-14 21:32 [PATCH v2 0/3] EAL memory fixes Jake Freeland
2025-08-14 21:32 ` [PATCH v2 1/3] eal/freebsd: Do not use prev_ms_idx for hole detection Jake Freeland
2025-10-13 12:23   ` Burakov, Anatoly
2025-10-14  9:06   ` Burakov, Anatoly
2025-08-14 21:32 ` [PATCH v2 2/3] eal/freebsd: Avoid claiming memseg holes Jake Freeland
2025-10-13 12:36   ` Burakov, Anatoly
2025-10-13 13:12   ` Burakov, Anatoly
2025-08-14 21:32 ` [PATCH v2 3/3] eal/linux: Check hugepage access permissions Jake Freeland
2025-10-13 12:43   ` Burakov, Anatoly
2025-10-15 16:53 ` [PATCH v2 0/3] EAL memory fixes Thomas Monjalon
2026-01-14  6:37 ` Stephen Hemminger
2026-01-14  9:31 ` [PATCH v3 " Jake Freeland
2026-01-14  9:31   ` [PATCH v3 1/3] eal/freebsd: do not use prev_ms_idx for hole detection Jake Freeland
2026-01-14  9:31   ` [PATCH v3 2/3] eal/freebsd: avoid claiming memseg holes Jake Freeland
2026-01-14  9:31   ` [PATCH v3 3/3] eal/linux: check hugepage access permissions Jake Freeland
2026-01-14 10:04     ` [PATCH v4] " Jake Freeland
2026-02-13 16:01     ` [PATCH v3 3/3] " David Marchand
2026-02-13 16:02   ` [PATCH v3 0/3] EAL memory fixes David Marchand
2026-01-23  5:09 ` Stephen Hemminger [this message]
2026-01-23 17:43   ` [PATCH v2 " Jake Freeland

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=20260122210931.05d3ed8b@phoenix.local \
    --to=stephen@networkplumber.org \
    --cc=anatoly.burakov@intel.com \
    --cc=bruce.richardson@intel.com \
    --cc=dev@dpdk.org \
    --cc=jfree@FreeBSD.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