HomeFreeBSD

buf_ring: Use atomic operations with br_prod_tail

Description

buf_ring: Use atomic operations with br_prod_tail

As with br_cons_tail use an atomic load acquire to read br_prod_tail
in buf_ring_dequeue_mc and buf_ring_peek*.

On dequeue we need to ensure we don't read the entry from the buf_ring
until it is available and prod_tail has updated. There is already an
appropriate store in the enqueue path and an appropriate load in the
single consumer dequeue, we just need one in the other functions that
read from the buf_ring.

Reviewed by: imp, markj
Sponsored by: Arm Ltd
Differential Revision: https://reviews.freebsd.org/D46154

(cherry picked from commit 947754af55edc217c10e3456d97558c4eb6d0f99)

Details

Provenance
andrewAuthored on Aug 19 2024, 9:07 AM
Reviewer
imp
Differential Revision
D46154: buf_ring: Use atomic operations with br_prod_tail
Parents
rGb5410efe42c5: buf_ring: Remove old arm-only dequeue code
Branches
Unknown
Tags
Unknown