FAILED: patch "[PATCH] gve: Fix backward stats when interface goes down or" failed to apply to 6.12-stable tree
Subsystems (3)
[email protected]
maintainerThe patch below does not apply to the 6.12-stable tree.
If someone wants it applied there, or to any other stable or longterm tree, then please email the backport, including the original git commit id to <[email protected]>.
To reproduce the conflict and resubmit, you may use the following commands:
git fetch https://git.kernel.org/pub/scm/linux/kernel/git/stable/linux.git/ linux-6.12.y
git checkout FETCH_HEAD
git cherry-pick -x 6752dfc316b94ce02998a79509df62a3aba51d1c
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<[email protected]>' --in-reply-to '2026112548-flannels-activism-bc1a@gregkh' --subject-prefix 'PATCH 6.12.y' 'HEAD^..'
Possible dependencies:
thanks,
greg k-h
------------------ original commit in Linus's tree ------------------
From 6752dfc316b94ce02998a79509df62a3aba51d1c Mon Sep 17 00:00:00 2001
From: Debarghya Kundu <[email protected]>
Date: Mon, 9 Nov 2026 18:20:34 +0000
Subject: [PATCH] gve: Fix backward stats when interface goes down or
configuration is adjusted
gve_get_base_stats() sets all the stats to 0, so the stats go backwards when interface goes down or configuration is adjusted. ndo_get_stats64 has the same problem, since gve_get_stats() only sums the live rings, which are freed when the interface goes down.
This issue was discovered and actually triggered by the drivers/net/stats.py selftest (check_down test case). Bringing down the interface caused statistics counters to reset to 0, triggering selftest assertion failures because netdevice stats must not go backwards.
Fix this by persisting baseline stats across queue teardown in gve_queues_mem_remove() and single-queue stop in gve_rx_queue_stop(). The baseline is reported by both ndo_get_stats64 and gve_get_base_stats().
Also report the live XDP TX ring counters in gve_get_base_stats(), as those rings are not exposed as netdev queues.
This change was tested using the DQO RDA queue format.
drivers/net/ethernet/google/gve/gve.h +7 -0
@@ -871,6 +871,10 @@ struct gve_ctrl_ops {int (*report_link_speed)(struct gve_priv *priv); }; +struct gve_ring_err_stats { +u64 rx_alloc_fails; +}; +struct gve_priv {struct net_device *dev;struct gve_tx_ring *tx;/* array of tx_cfg.num_queues */
@@ -960,11 +964,14 @@ struct gve_priv {/* Protects the priv->tx/priv->rx arrays, the in-place rewrite of * priv->rx[idx] and the queue counts against stats readers that do * not hold the netdev instance lock. +* Also protects base_net_stats and base_ring_err_stats. */ spinlock_t stats_lock;unsigned long service_task_flags;unsigned long state_flags; +struct gve_ring_err_stats base_ring_err_stats; +struct rtnl_link_stats64 base_net_stats;struct gve_stats_report *stats_report;u64 stats_report_len;dma_addr_t stats_report_bus;/* dma address for the stats report */
drivers/net/ethernet/google/gve/gve_main.c +105 -24
167 lines not on this page · raw message