[PATCH v9 07/21] net/txgbe: fix Tx desc free logic
Stephen Hemminger
stephen at networkplumber.org
Tue Jun 23 18:50:47 CEST 2026
On Mon, 22 Jun 2026 19:10:55 +0800
Zaiyu Wang <zaiyuwang at trustnetic.com> wrote:
> diff --git a/drivers/net/txgbe/txgbe_rxtx.c b/drivers/net/txgbe/txgbe_rxtx.c
> index e2cd9b8841..d6efb3b8cc 100644
> --- a/drivers/net/txgbe/txgbe_rxtx.c
> +++ b/drivers/net/txgbe/txgbe_rxtx.c
> @@ -98,12 +98,11 @@ txgbe_tx_free_bufs(struct txgbe_tx_queue *txq)
> if (tx_last_dd >= txq->nb_tx_desc)
> tx_last_dd -= txq->nb_tx_desc;
>
> - volatile uint16_t head = (uint16_t)*txq->headwb_mem;
> + uint32_t h = rte_atomic_load_explicit(txq->headwb_mem,
> + rte_memory_order_acquire);
This will fail build on clang since txq->headwb_mem is declared as volatile
not _Atomic type.
Please fix, and resubmit both patch series.
$ CC=clang-21 meson setup build -Denable_stdatomic=true
$ ninja -C build
../drivers/net/txgbe/txgbe_rxtx.c:101:16: error: address argument to atomic operation must be a pointer to _Atomic type ('volatile uint32_t *' (aka 'volatile unsigned int *') invalid)
101 | uint32_t h = rte_atomic_load_explicit(txq->headwb_mem,
| ^ ~~~~~~~~~~~~~~~
../lib/eal/include/rte_stdatomic.h:69:2: note: expanded from macro 'rte_atomic_load_explicit'
69 | atomic_load_explicit(ptr, memorder)
| ^ ~~~
/usr/lib/llvm-21/lib/clang/21/include/stdatomic.h:145:30: note: expanded from macro 'atomic_load_explicit'
145 | #define atomic_load_explicit __c11_atomic_load
| ^
../drivers/net/txgbe/txgbe_rxtx.c:647:16: error: address argument to atomic operation must be a pointer to _Atomic type ('volatile uint32_t *' (aka 'volatile unsigned int *') invalid)
647 | uint32_t h = rte_atomic_load_explicit(txq->headwb_mem,
| ^ ~~~~~~~~~~~~~~~
../lib/eal/include/rte_stdatomic.h:69:2: note: expanded from macro 'rte_atomic_load_explicit'
69 | atomic_load_explicit(ptr, memorder)
| ^ ~~~
/usr/lib/llvm-21/lib/clang/21/include/stdatomic.h:145:30: note: expanded from macro 'atomic_load_explicit'
145 | #define atomic_load_explicit __c11_atomic_load
| ^
2 errors generated.
More information about the dev
mailing list