linux/drivers/net/ethernet/google/gve
Eddie Phillips b65352a1ba gve: fix Rx queue stall on alloc failure
When the system is under extreme memory pressure, page allocations can
fail during the Rx buffer refill loop. If the number of buffers posted
to hardware falls below a critical low threshold and the refill loop
exits due to allocation failures, the queue can stall:

1. The device drops incoming packets because there are no descriptors.
2. Since no packets are processed, no Rx completions are generated.
3. Because no completions occur, NAPI is never scheduled, preventing
   the refill loop from running again even after memory is freed.

This results in a permanent queue stall.

Resolve this by introducing a starvation recovery timer for each Rx queue.
If the number of buffers posted to hardware falls below a critical low
threshold, start a timer to periodically reschedule NAPI. Once NAPI runs
and successfully refills the queue above the threshold, the timer is
not rescheduled.

The threshold is set to 32 because a single maximum-sized Receive Segment
Coalescing (RSC) packet can consume up to 19 descriptors in the Rx path.
Lower thresholds (such as 8 or 16) would be insufficient to process a
complete maximum-sized RSC packet, risking packet drops or unexpected
hardware behavior under memory pressure. Setting the threshold to 32
guarantees a safe margin to handle at least one full RSC packet.

Cc: stable@vger.kernel.org
Fixes: 9b8dd5e5ea ("gve: DQO: Add RX path")
Reviewed-by: Jordan Rhee <jordanrhee@google.com>
Signed-off-by: Eddie Phillips <eddiephillips@google.com>
Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
Reviewed-by: Przemek Kitszel <przemyslaw.kitszel@intel.com>
Link: https://patch.msgid.link/20260709211906.3322883-1-hramamurthy@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
2026-07-21 14:45:27 -07:00
..
gve_adminq.c Revert "Merge branch 'gve-add-support-for-ptp-gettimex64'" 2026-05-20 15:12:16 -07:00
gve_adminq.h Revert "Merge branch 'gve-add-support-for-ptp-gettimex64'" 2026-05-20 15:12:16 -07:00
gve_buffer_mgmt_dqo.c gve: Update QPL page registration logic 2026-02-28 08:58:29 -08:00
gve_desc_dqo.h gve: Check valid ts bit on RX descriptor before hw timestamping 2025-10-15 09:04:58 -07:00
gve_desc.h gve: trivial spell fix Recive to Receive 2023-07-14 10:28:17 +01:00
gve_dqo.h gve: Prepare bpf_xdp_metadata_rx_timestamp support 2025-11-18 15:52:43 +01:00
gve_ethtool.c net: ethtool: keep rtnl_lock for ops using ethtool_op_get_link() 2026-06-25 10:18:34 -07:00
gve_flow_rule.c Convert 'alloc_obj' family to use the new default GFP_KERNEL argument 2026-02-21 17:09:51 -08:00
gve_main.c net: convert netmem_tx flag to enum 2026-05-18 18:49:06 -07:00
gve_ptp.c Revert "Merge branch 'gve-add-support-for-ptp-gettimex64'" 2026-05-20 15:12:16 -07:00
gve_register.h gve: Deprecate adminq_pfn for pci revision 0x1. 2023-11-29 08:32:36 -08:00
gve_rx_dqo.c gve: fix Rx queue stall on alloc failure 2026-07-21 14:45:27 -07:00
gve_rx.c gve: Update QPL page registration logic 2026-02-28 08:58:29 -08:00
gve_tx_dqo.c gve: add support for UDP GSO for DQO format 2026-03-09 19:17:52 -07:00
gve_tx.c gve: Update QPL page registration logic 2026-02-28 08:58:29 -08:00
gve_utils.c gve: defer interrupt enabling until NAPI registration 2025-12-29 19:09:49 +01:00
gve_utils.h gve: Add header split data path 2024-03-04 10:03:32 +00:00
gve.h gve: fix Rx queue stall on alloc failure 2026-07-21 14:45:27 -07:00
Makefile gve: Add initial PTP device support 2025-06-16 15:27:24 -07:00