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

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
rG7eb0fffc7792: buf_ring: Remove old arm-only dequeue code
Branches
Unknown
Tags
Unknown