gve: Consolidate and persist ethtool ring changes
Subsystems (3)
Joshua Washington
maintainerPATCH 1/1 gve: Consolidate and persist ethtool ring changes
From: Ankit Garg <[email protected]>
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.
--- drivers/net/ethernet/google/gve/gve.h | 3 +- drivers/net/ethernet/google/gve/gve_ethtool.c | 86 +++++++++---------- drivers/net/ethernet/google/gve/gve_main.c | 17 ++-- 3 files changed, 51 insertions(+), 55 deletions(-)
drivers/net/ethernet/google/gve/gve.h +2 -1
@@ -1249,7 +1249,8 @@ void gve_rx_start_ring_gqi(struct gve_priv *priv, int idx);void gve_rx_stop_ring_gqi (struct gve_priv *priv,int idx);u16 gve_get_pkt_buf_size (const struct gve_priv *priv,bool enable_hplit);bool gve_header_split_supported (const struct gve_priv *priv); -int gve_set_hsplit_config (struct gve_priv *priv,u8 tcp_data_split); +int gve_set_hsplit_config (struct gve_priv *priv,u8 tcp_data_split, +struct gve_rx_alloc_rings_cfg *rx_alloc_cfg);/* rx buffer handling */ int gve_buf_ref_cnt (struct gve_rx_buf_state_dqo *bs); void gve_free_page_dqo(struct gve_priv *priv, struct gve_rx_buf_state_dqo *bs,
drivers/net/ethernet/google/gve/gve_ethtool.c +43 -43
111 lines not on this page · raw message
drivers/net/ethernet/google/gve/gve_main.c +6 -11
@@ -2058,12 +2058,10 @@ bool gve_header_split_supported(const struct gve_priv *priv) priv->queue_format ==GVE_DQO_RDA_FORMAT && !priv->xdp_prog; } -int gve_set_hsplit_config (struct gve_priv *priv,u8 tcp_data_split) +int gve_set_hsplit_config (struct gve_priv *priv,u8 tcp_data_split, +struct gve_rx_alloc_rings_cfg *rx_alloc_cfg) { -struct gve_tx_alloc_rings_cfg tx_alloc_cfg = {0 }; -struct gve_rx_alloc_rings_cfg rx_alloc_cfg = {0 };bool enable_hdr_split; -int err =0 ;if (tcp_data_split ==ETHTOOL_TCP_DATA_SPLIT_UNKNOWN )return 0 ;
@@ -2081,14 +2079,11 @@ int gve_set_hsplit_config(struct gve_priv *priv, u8 tcp_data_split)if (enable_hdr_split == priv->header_split_enabled)return 0 ; -gve_get_curr_alloc_cfgs (priv, &tx_alloc_cfg, &rx_alloc_cfg); - - rx_alloc_cfg.enable_header_split = enable_hdr_split; - rx_alloc_cfg.packet_buffer_size =gve_get_pkt_buf_size (priv, enable_hdr_split); + rx_alloc_cfg->enable_header_split = enable_hdr_split; + rx_alloc_cfg->packet_buffer_size = +gve_get_pkt_buf_size (priv, enable_hdr_split); -if (netif_running (priv->dev)) - err =gve_adjust_config (priv, &tx_alloc_cfg, &rx_alloc_cfg); -return err; +return 0 ; } static int gve_set_features(struct net_device *netdev,
Signature · 1 line
2.51.0.858.gf9c4a03a3a-goog
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Hello:
This patch was applied to netdev/net-next.git (main) by Jakub Kicinski <[email protected]>:
Quoted 6 lines · On Thu, 16 Oct 2025 18:25:42 -0700 you wrote:
From: Ankit Garg <[email protected]>
Refactor the ethtool ring parameter configuration logic to address two
issues: unnecessary queue resets and lost configuration changes when the interface is down.
Quoted 7 lines
Previously,
gve_set_ringparamcould 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.[...]
Here is the summary with links:
- [net-next] gve: Consolidate and persist ethtool ring changes
https://git.kernel.org/netdev/net-next/c/c30fd916c4d7
You are awesome, thank you!
Signature · 2 lines
Deet-doot-dot, I am a bot. https://korg.docs.kernel.org/patchwork/pwbot.html