HomeFreeBSD

gve: Use load-acquire to fetch generation bits

Description

gve: Use load-acquire to fetch generation bits

When running the driver using the DQO queue format, we must load the
generation bit and check it before possibly reading the rest of the
descriptor's fields.

Previously, we guarded against reordering of reads using an explicit
thread fence. This commit changes the thread fence to a load with
acquire semantics. Because the tx and rx generation fields are in a
bitfield, we cannot explicitly address them in an atomic load. Instead
we load the respective containing bytes in the descriptor and mask them
appropriately.

Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>

Reviewed by: markj
MFC after: 2 weeks
Differential Revision: https://reviews.freebsd.org/D50384

(cherry picked from commit b044f125373e05c20ca16edfd29cccad1f4025bd)

Details

Provenance
jtranoleary_google.comAuthored on May 20 2025, 11:34 PM
markjCommitted on Jun 20 2025, 12:46 PM
Reviewer
markj
Differential Revision
D50384: gve: Use load-acquire to fetch generation bits
Parents
rG1225d1a7c948: capsicum: Statically initialize commonly used capability rights
Branches
Unknown
Tags
Unknown