Re: [PATCH v2 1/4] net/af_packet: fix thread safety and frame calculations

Stephen Hemminger
2026-01-28T16:59:37Z

On Wed, 28 Jan 2026 01:36:04 -0800
scott.k.mitch1@gmail.com wrote:

> +/**
> + * Read tp_status from packet mmap ring. Matches kernel's READ_ONCE() with smp_rmb()
> + * ordering in af_packet.c __packet_get_status.
> + */
> +static inline uint32_t
> +tpacket_read_status(const volatile void *tp_status)
> +{
> + rte_smp_rmb();
> + return *((const volatile unaligned_uint32_t *)tp_status);
> +}

Wouldn't rte_compiler_barrier() be better choice here.
You are really only trying to keep compiler from optimzing the access.

And tp_status is aligned in ring isn't it?