Re: [PATCH v4 0/4] af_packet correctness, performance, cksum

Stephen Hemminger
2026-02-02T18:53:19Z

On Mon, 2 Feb 2026 00:14:52 -0800
scott.k.mitch1@gmail.com wrote:

> From: Scott <scott.k.mitch1@gmail.com>
>
> This series fixes critical thread safety bugs in the af_packet PMD
> and adds performance optimizations.
>
> Patch 1 fixes two major correctness issues:
> - Thread safety: tp_status was accessed without memory barriers,
> violating the kernel's PACKET_MMAP protocol. On aarch64 and other
> weakly-ordered architectures, this causes packet corruption due to
> missing memory ordering. The fix matches the kernel's memory model:
> volatile unaligned reads/writes with explicit rte_smp_rmb/wmb
> barriers and __may_alias__ protection.
>
> - Frame calculations: Fixed incorrect frame overhead and address
> calculations that caused memory corruption when frames don't evenly
> divide blocks.

Fix patch 4 and resubmit.