]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
gve: Fix RX_BUFFERS_POSTED stat to report per-queue fill_cnt
authorAlok Tiwari <alok.a.tiwari@oracle.com>
Tue, 27 May 2025 13:08:16 +0000 (06:08 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 27 Jun 2025 10:04:07 +0000 (11:04 +0100)
[ Upstream commit f41a94aade120dc60322865f363cee7865f2df01 ]

Previously, the RX_BUFFERS_POSTED stat incorrectly reported the
fill_cnt from RX queue 0 for all queues, resulting in inaccurate
per-queue statistics.
Fix this by correctly indexing priv->rx[idx].fill_cnt for each RX queue.

Fixes: 24aeb56f2d38 ("gve: Add Gvnic stats AQ command and ethtool show/set-priv-flags.")
Signed-off-by: Alok Tiwari <alok.a.tiwari@oracle.com>
Link: https://patch.msgid.link/20250527130830.1812903-1-alok.a.tiwari@oracle.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/google/gve/gve_main.c

index b76d1d019a81d68907db3f2f8bbee1118a6b1ab5..f458a97dd7910c7d4105d89e2a9346aa246936ba 100644 (file)
@@ -1086,7 +1086,7 @@ void gve_handle_report_stats(struct gve_priv *priv)
                        };
                        stats[stats_idx++] = (struct stats) {
                                .stat_name = cpu_to_be32(RX_BUFFERS_POSTED),
-                               .value = cpu_to_be64(priv->rx[0].fill_cnt),
+                               .value = cpu_to_be64(priv->rx[idx].fill_cnt),
                                .queue_id = cpu_to_be32(idx),
                        };
                }