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
F124786570: D48969.id150916.diff
Wed, Jul 30, 5:32 PM
Unknown Object (File)
Mon, Jul 28, 5:55 PM
Unknown Object (File)
Wed, Jul 23, 12:49 PM
Unknown Object (File)
Sun, Jul 6, 8:22 AM
Unknown Object (File)
Sat, Jul 5, 3:13 PM
Unknown Object (File)
Thu, Jul 3, 3:24 PM
Unknown Object (File)
Jun 29 2025, 7:20 AM
Unknown Object (File)
Jun 26 2025, 12:41 AM
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.