mirror of
https://github.com/torvalds/linux.git
synced 2025-12-07 20:06:24 +00:00
gve: Decouple header split from RX buffer length
Previously, enabling header split via `gve_set_hsplit_config` also implicitly changed the RX buffer length to 4K (if supported by the device). This coupled two settings that should be orthogonal; this patch removes that side effect. After this change, `gve_set_hsplit_config` only toggles the header split configuration. The RX buffer length is no longer affected and must be configured independently. 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/20251106192746.243525-2-joshwash@google.com Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
committed by
Jakub Kicinski
parent
71bc986cd1
commit
40fef85ceb
@@ -59,8 +59,6 @@
|
||||
|
||||
#define GVE_DEFAULT_RX_BUFFER_SIZE 2048
|
||||
|
||||
#define GVE_MAX_RX_BUFFER_SIZE 4096
|
||||
|
||||
#define GVE_XDP_RX_BUFFER_SIZE_DQO 4096
|
||||
|
||||
#define GVE_DEFAULT_RX_BUFFER_OFFSET 2048
|
||||
@@ -1249,7 +1247,6 @@ void gve_rx_free_rings_gqi(struct gve_priv *priv,
|
||||
struct gve_rx_alloc_rings_cfg *cfg);
|
||||
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,
|
||||
struct gve_rx_alloc_rings_cfg *rx_alloc_cfg);
|
||||
|
||||
@@ -606,8 +606,6 @@ static int gve_set_ringparam(struct net_device *netdev,
|
||||
} else {
|
||||
/* Set ring params for the next up */
|
||||
priv->header_split_enabled = rx_alloc_cfg.enable_header_split;
|
||||
priv->rx_cfg.packet_buffer_size =
|
||||
rx_alloc_cfg.packet_buffer_size;
|
||||
priv->tx_desc_cnt = tx_alloc_cfg.ring_size;
|
||||
priv->rx_desc_cnt = rx_alloc_cfg.ring_size;
|
||||
}
|
||||
|
||||
@@ -2041,14 +2041,6 @@ static void gve_tx_timeout(struct net_device *dev, unsigned int txqueue)
|
||||
priv->tx_timeo_cnt++;
|
||||
}
|
||||
|
||||
u16 gve_get_pkt_buf_size(const struct gve_priv *priv, bool enable_hsplit)
|
||||
{
|
||||
if (enable_hsplit && priv->max_rx_buffer_size >= GVE_MAX_RX_BUFFER_SIZE)
|
||||
return GVE_MAX_RX_BUFFER_SIZE;
|
||||
else
|
||||
return GVE_DEFAULT_RX_BUFFER_SIZE;
|
||||
}
|
||||
|
||||
/* Header split is only supported on DQ RDA queue format. If XDP is enabled,
|
||||
* header split is not allowed.
|
||||
*/
|
||||
@@ -2080,8 +2072,6 @@ int gve_set_hsplit_config(struct gve_priv *priv, u8 tcp_data_split,
|
||||
return 0;
|
||||
|
||||
rx_alloc_cfg->enable_header_split = enable_hdr_split;
|
||||
rx_alloc_cfg->packet_buffer_size =
|
||||
gve_get_pkt_buf_size(priv, enable_hdr_split);
|
||||
|
||||
return 0;
|
||||
}
|
||||
|
||||
Reference in New Issue
Block a user