gve: fix TX drop when GSO MSS is too small for hw

The device has a strict requirement that the minimum MSS
(gso_size) for TSO/GSO packets must be at least 88 bytes. If a packet
below this threshold is pushed to the hardware, it can cause
hardware to silently drop the packet, leading to increased latency
and retransmissions.

Currently, this is validated too late in the transmit pipeline
(gve_prep_tso), leading to silent drops.

Fix this by moving the validation into the .ndo_features_check
callback (gve_features_check_dqo). If we detect a GSO packet with
a gso_size smaller than GVE_TX_MIN_TSO_MSS_DQO, we clear the GSO
feature flags for this packet.

Fixes: a57e5de476 ("gve: DQO: Add TX path")
Signed-off-by: Eddie Phillips <eddiephillips@google.com>
Signed-off-by: Eric Dumazet <edumazet@google.com>
Reviewed-by: Harshitha Ramamurthy <hramamurthy@google.com>
Link: https://patch.msgid.link/20260924004252.1196328-2-edumazet@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
This commit is contained in:
Eddie Phillips 2026-09-24 00:42:51 +00:00 committed by Jakub Kicinski
parent 83769c23fb
commit 3b430ea623

View File

@ -577,17 +577,6 @@ static int gve_prep_tso(struct sk_buff *skb)
int header_len;
int err;
/* Note: HW requires MSS (gso_size) to be <= 9728 and the total length
* of the TSO to be <= 262143.
*
* However, we don't validate these because:
* - Hypervisor enforces a limit of 9K MTU
* - Kernel will not produce a TSO larger than 64k
*/
if (unlikely(shinfo->gso_size < GVE_TX_MIN_TSO_MSS_DQO))
return -1;
/* Needed because we will modify header. */
err = skb_cow_head(skb, 0);
if (err < 0)
@ -925,6 +914,9 @@ static bool gve_can_send_tso(const struct sk_buff *skb)
int header_len;
int i;
if (unlikely(gso_size < GVE_TX_MIN_TSO_MSS_DQO))
return false;
/* Must match the header length programmed by gve_prep_tso(). */
if (skb_is_gso_tcp(skb))
header_len = skb_tcp_all_headers(skb);