Page MenuHomeFreeBSD

gve: Do minor cleanup and bump version
ClosedPublic

Authored by jtranoleary_google.com on Feb 12 2025, 6:16 PM.
Tags
None
Referenced Files
Unknown Object (File)
Tue, Mar 11, 3:40 PM
Unknown Object (File)
Mon, Mar 3, 5:06 AM
Unknown Object (File)
Sun, Mar 2, 12:24 PM
Unknown Object (File)
Sun, Feb 23, 11:13 AM
Unknown Object (File)
Sat, Feb 22, 2:07 PM
Unknown Object (File)
Wed, Feb 19, 8:15 PM
Unknown Object (File)
Wed, Feb 19, 2:10 AM
Unknown Object (File)
Tue, Feb 18, 2:42 PM
Subscribers

Details

Summary

This commit fixes several minor issues:

  • Removes an unnecessary function pointer parameter on gve_start_tx_ring
  • Adds a presubmit check against style(9)
  • Replaces mb() and rmb() macros with native atomic_thread_fence_seq_cst() and atomic_thread_fence_acq() respectively
  • Fixes various typos throughout
  • Increments the version number to 1.3.2

Co-authored-by: Vee Agarwal <veethebee@google.com>
Signed-off-by: Vee Agarwal <veethebee@google.com>
Signed-off-by: Jasper Tran O'Leary <jtranoleary@google.com>

Diff Detail

Repository
rG FreeBSD src repository
Lint
Lint Not Applicable
Unit
Tests Not Applicable

Event Timeline

This revision is now accepted and ready to land.Feb 13 2025, 8:50 AM
markj added inline comments.
sys/dev/gve/gve_rx_dqo.c
975

Just a suggestion: I suspect it would be marginally cheaper to use a load-acquire to fetch the generation number from the descriptor instead of issuing an explicit barrier:

uint8_t gen;

gen = atomic_load_acq_8(&compl_desc->generation);
if (gen == rx.dqo.cur_gen_bit)
    break;
...

On amd64 this doesn't matter of course.

sys/dev/gve/gve_tx_dqo.c
1034

Same comment here.

jtranoleary_google.com added inline comments.
sys/dev/gve/gve_rx_dqo.c
975

This is a great idea and I would much rather use a load-acquire as opposed to a full fence. Unfortunately, the generation is a bit in a bitfield and trying out the code above yielded "error: address of bit-field requested." As a workaround, I think we could fetch a 1- or 2-byte chunk from the bitfield and bitmask it, but this is trickier and I'd like to be able to test it for a while first. I'll be sure to include this in a subsequent patch.

sys/dev/gve/gve_rx_dqo.c
975

Oh, right, I was looking at the definition of cur_gen_bit by mistake. Postponing to a future patch makes perfect sense to me, thanks.

This revision was automatically updated to reflect the committed changes.