gve: deduplicate xdp info and xsk pool registration logic
authorJoshua Washington <joshwash@google.com>
Thu, 17 Jul 2025 15:28:35 +0000 (08:28 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 22 Jul 2025 09:35:49 +0000 (11:35 +0200)
commitd57ae093c887180b72c575724c1779f5ca0f5b5b
tree24d361bfbe2e4d771d7602fa265150f3773a44cc
parent3fc894728fb3a0d9282e81247b68c07468fe2985
gve: deduplicate xdp info and xsk pool registration logic

The XDP registration path currently has a lot of reused logic, leading
changes to the codepaths to be unnecessarily complex. gve_reg_xsk_pool
extracts the logic of registering an XSK pool with a queue into a method
that can be used by both XDP_SETUP_XSK_POOL and gve_reg_xdp_info.
gve_unreg_xdp_info is used to undo XDP info registration in the error
path instead of explicitly unregistering the XDP info, as it is more
complete and idempotent.

This patch will be followed by other changes to the XDP registration
logic, and will simplify those changes due to the use of common methods.

Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
Signed-off-by: Jeroen de Borst <jeroendb@google.com>
Link: https://patch.msgid.link/20250717152839.973004-2-jeroendb@google.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/google/gve/gve_main.c