|WARNING| [v8,25/25] eal: remove rte_atomicNN functions

dpdklab at iol.unh.edu dpdklab at iol.unh.edu
Thu Sep 17 22:58:29 CEST 2026


Test-Label: ai-code-review
Test-Status: WARNING
https://dpdk.org/patch/169783

_AI Code Review_

=== Patch Review: series.patch (via Claude) ===
Review date: 2026-09-17

# DPDK Patch Review

This is a 25-patch series converting DPDK from legacy `rte_atomic*` to C11 stdatomic.

## Pass 1: Correctness Bugs

No correctness bugs identified in this series. The conversions preserve the seq_cst memory ordering of the legacy API, and the handful of ordering reductions are explicitly documented (e.g., net/bonding relaxing statistics updates, net/vhost using seq_cst for handshaking).

## Pass 2: Style/Process Review

### Patch 02 (net/bonding) - Warning

**Memory ordering on marker timer:** The conversion of `rx_marker_timer` from `rte_atomic64_t` to `RTE_ATOMIC(uint64_t)` uses acquire on the load in the CAS loop and release on the error-path resets. The actual marker packet send occurs *after* the timer is set, so the release on the CAS success path is correct. However, the error-path resets use release ordering when there is nothing to publish--a plain relaxed store would suffice and more clearly documents intent. The acquire on the initial read is also superfluous (the CAS itself orders the reload). These are optimizations, not correctness issues.

### Patch 08 (net/sfc) - Warning

**Link status setting:** `sfc_port_init_dev_link()` calls `rte_eth_linkstatus_set(sa->eth_dev, &current_link)`, which internally performs an atomic exchange to prevent tearing. The comment "EFX_STATIC_ASSERT(sizeof(*dev_link) == sizeof(rte_atomic64_t));" was removed. If this assert was guarding against a size mismatch between the old `rte_atomic64_t` implementation and the link structure, its removal is safe because `rte_eth_linkstatus_set()` now handles the atomicity. If it was asserting that the link structure itself is 64 bits, that constraint should be checked at the `rte_eth_link` definition site, not here.

### Patch 09 (crypto/ccp) - Info

**Memzone name format change:** The comment "Note: the memzone names now start with zero; i.e '0000:03:00.0_0' which is harmless side effect." should explain *why* names start with zero. The original code used `rte_atomic32_add_return(&hwdev->os_dep.dma_alloc_cnt, 1)` which returned the post-increment value (starting at 1 for the first alloc). The new `rte_atomic_fetch_add_explicit(..., 1, ...) + 1` does the same, but the comment makes it sound like the name format changed. If names now start at `_0` instead of `_1`, that would indicate the `+ 1` was accidentally omitted--but the code shows it's still there (`alloc_cnt = ... + 1`). Either the comment is misleading or the code lost the `+ 1`. Checking: the code reads `alloc_cnt = rte_atomic_fetch_add_explicit(&..., 1, ...) + 1;` so the +1 is present and names should still start at `_1`. The commit message note about `_0` appears incorrect.

### Patch 14 (net/netvsc) - Info

**Commit message clarity:** "Note: the previous `rte_atomic32_test_and_set` return value was inverted relative to what this code expected; this patch fixes that. A standalone Fixes: patch is queued in next-net." The inversion fix is mentioned as a separate patch. This patch only does the conversion. Good.

### Patch 18 (drivers/event selftests) - Info

**Signed vs unsigned atomic:** `atomic_total_events` is changed from `rte_atomic32_t` (signed) to `RTE_ATOMIC(uint32_t)` (unsigned). The value is always non-negative (initialized to `total_events`, decremented by dequeued count, loop waits for zero). The type change is correct. The log formats change from `%d` to `%u` to match.

### Patch 20 (net/txgbe) - Info

**Commit message note:** "Note: The previous `rte_atomic32_test_and_set` return value was inverted relative to what this code expected; this patch fixes that. A standalone Fixes: patch is queued in next-net." Same situation as patch 14--fix is separate.

### Patch 21 (net/vhost) - Info

**Boolean flag types:** `started`, `dev_attached`, and `running` are changed from `rte_atomic32_t` to `RTE_ATOMIC(uint32_t)` and use 0/1 values. Consider `RTE_ATOMIC(bool)` for clarity, as suggested in AGENTS.md. (The next patch does this for `allow_queuing` and `while_queuing`, so this is just a consistency note.)

### Patch 22 (net/vhost) - Info

**Dekker handshake seq_cst pairing:** The commit message correctly explains why both the store and load must be seq_cst in the data-path presence announcement vs. control-thread drain handshake. The release on the while_queuing=0 exit is also correct.

### Patch 23 (vdpa/ifc) - Info

**Flag grouping:** The commit message says `started`, `dev_attached`, and `running` are "grouped with the existing bools to reduce padding in struct ifcvf_internal." The diff shows the RTE_ATOMIC flags moved next to each other, but there are no other `bool` members shown in the context--check that the grouping is optimal. (Not an error, just a note for future reviewers with access to the full struct definition.)

### Patch 24 (test/atomic) - Info

**Test scope:** The final test only covers 128-bit compare-exchange and is conditional on x86_64/aarch64. The commit message says "Only the 128 bit compare-and-swap case test remains." MSVC is explicitly excluded with `#ifndef RTE_TOOLCHAIN_MSVC` at the top. The x86_64/aarch64 check is inside the test function, so non-matching arches return `TEST_SKIPPED`. Correct.

### Patch 25 (eal: remove) - Warning

**Release notes:** The deprecation notice was in `deprecation.rst` but is now moved to `release_26_11.rst` under "Removed Items" with details of what was removed. The ABI section of the release notes should also mention this is an ABI break (applications using the removed types will fail to compile/link), but the text provided says "Use the C11 `rte_atomic_*_explicit` operations instead." This is correct user-facing guidance. **However**: the patch removes all of `rte_atomic{16,32,64}_{init,read,set,add,sub,inc,dec,...}` and the `rte_atomic{16,32,64}_t` types. These were marked `__rte_deprecated` in earlier releases (or should have been). This patch does not show the prior deprecation macros being removed--likely they were never added, meaning this is a hard break without a deprecation period. **Check**: were these APIs formally deprecated in an earlier release? If not, this is a policy violation (APIs must be deprecated for one release before removal). If they were, the patch is fin
 e.

**Checkpatch exclusion removed:** The patch removes the checkpatch rule that flagged new uses of `rte_atomic[0-9][0-9]_`. Correct now that the API is gone.

**x86 meson.build:** `rte_atomic_32.h` is removed from `dpdk_arch_indirect_headers` but `rte_atomic_64.h` remains (used by 64-bit x86). Correct.

**Leftover `#ifdef RTE_FORCE_INTRINSICS`:** The ARM32/64, LoongArch, and RISC-V headers each had a `#ifndef RTE_FORCE_INTRINSICS #error` block. These are removed. The x86 and PPC headers do not have such a block in the final state. The ARM/LoongArch/RISC-V headers now `#include "generic/rte_atomic.h"` without the guard, meaning they rely on the 128-bit CAS definition (if present). This is correct--`RTE_FORCE_INTRINSICS` was about selecting between legacy atomic implementations, now removed.

---

## Summary

All patches in this series are **correct**. No use-after-free, resource leaks, or logic errors identified.

**Warnings:**
- **Patch 02**: Ordering on error-path marker timer reset could be relaxed, not release.
- **Patch 08**: Static assert removal--confirm link status atomicity is still correct.
- **Patch 25**: Confirm these APIs were formally deprecated in a prior release before removal.

**Info:**
- **Patch 09**: Commit message claims memzone names "now start with zero" but code still has `+ 1`.
- **Patch 21**: Consider `RTE_ATOMIC(bool)` for 0/1 flags (consistency with patch 22/23).
- **Patch 23**: Verify struct layout optimization claim.
- **Patch 24**: Test coverage limited to x86_64/aarch64 128-bit CAS.

**Process:**
- Patch 25 removes a large deprecated API. If it was not marked `__rte_deprecated` in a prior release, this violates the deprecation policy.


More information about the test-report mailing list