]> git.ipfire.org Git - thirdparty/linux.git/commit
gve: Consolidate and persist ethtool ring changes
authorAnkit Garg <nktgrg@google.com>
Fri, 17 Oct 2025 01:25:42 +0000 (18:25 -0700)
committerJakub Kicinski <kuba@kernel.org>
Tue, 21 Oct 2025 00:43:23 +0000 (17:43 -0700)
commitc30fd916c4d7760ccf654e52370b0a31be885789
tree79339d503619338d77d00c3d5783a86517d0bdff
parenta5cd3a60aa1d0366265638c43012e1ac1b3f6d6a
gve: Consolidate and persist ethtool ring changes

Refactor the ethtool ring parameter configuration logic to address two
issues: unnecessary queue resets and lost configuration changes when
the interface is down.

Previously, `gve_set_ringparam` could trigger multiple queue
destructions and recreations for a single command, as different settings
(e.g., header split, ring sizes) were applied one by one. Furthermore,
if the interface was down, any changes made via ethtool were discarded
instead of being saved for the next time the interface was brought up.

This patch centralizes the configuration logic. Individual functions
like `gve_set_hsplit_config` are modified to only validate and stage
changes in a temporary config struct.

The main `gve_set_ringparam` function now gathers all staged changes
and applies them as a single, combined configuration:
1.  If the interface is up, it calls `gve_adjust_config` once.
2.  If the interface is down, it saves the settings directly to the
    driver's private struct, ensuring they persist and are used when
    the interface is brought back up.

Signed-off-by: Ankit Garg <nktgrg@google.com>
Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
Reviewed-by: Jordan Rhee <jordanrhee@google.com>
Reviewed-by: Willem de Bruijn <willemb@google.com>
Signed-off-by: Joshua Washington <joshwash@google.com>
Link: https://patch.msgid.link/20251017012614.3631351-1-joshwash@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/google/gve/gve.h
drivers/net/ethernet/google/gve/gve_ethtool.c
drivers/net/ethernet/google/gve/gve_main.c