From mboxrd@z Thu Jan 1 00:00:00 1970 Received: from smtp.kernel.org (aws-us-west-2-korg-mail-1.web.codeaurora.org [10.30.226.201]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by smtp.subspace.kernel.org (Postfix) with ESMTPS id 203A51F1534 for ; Sat, 7 Feb 2026 19:30:49 +0000 (UTC) Authentication-Results: smtp.subspace.kernel.org; arc=none smtp.client-ip=10.30.226.201 ARC-Seal:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770492650; cv=none; b=EM/v3pfZYpHYVEPQXjlPxabANeE1OmHtHvKjiS4HSXiC5I4ZahhghBPg+BLZc22i5RcveG5nrGoDKJueZj0W+8D0pksGF3pucfaxLzExABku48g6buJLWj5z7Ij3QyhkZhha7keusAh8/L0GCaKbSEChq3lT8U1ohOimIo0z/AY= ARC-Message-Signature:i=1; a=rsa-sha256; d=subspace.kernel.org; s=arc-20240116; t=1770492650; c=relaxed/simple; bh=0+iaJgs8YqGj41tYOCInOeewHU0XnhPkINv4divu7rs=; h=From:To:Cc:Subject:Date:Message-ID:In-Reply-To:References: MIME-Version; b=FSWSRW0KxLmi53+nS+Lkd0y6T0iBd0sCPbi087bQHD33RwtApI0ybmH8PJQyXaREzgxbbQBdXBqXtTiq0RYHtzgwDwSsGnM/Slcg2bvGXvdhRHekbUcwljPmbbQiHyi1NN5TKrLnVFS27cD3Rsmp9ToowRlSKr1OxQZwkLbpsuQ= ARC-Authentication-Results:i=1; smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b=HddROkPE; arc=none smtp.client-ip=10.30.226.201 Authentication-Results: smtp.subspace.kernel.org; dkim=pass (2048-bit key) header.d=kernel.org header.i=@kernel.org header.b="HddROkPE" Received: by smtp.kernel.org (Postfix) with ESMTPSA id B8950C116D0; Sat, 7 Feb 2026 19:30:48 +0000 (UTC) DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/simple; d=kernel.org; s=k20201202; t=1770492649; bh=0+iaJgs8YqGj41tYOCInOeewHU0XnhPkINv4divu7rs=; h=From:To:Cc:Subject:Date:In-Reply-To:References:From; b=HddROkPEHaaz4tEMkNwgAT+OJRBEPTTXSr9vVt7sWgOPZLk3SXdAbXDytpO3urDmS efOIsXjJ4+/Fkfb0Z15hghJ1+tqihVSzG6CPb8GuC/ms7cV9jz3NLSaBF4iJd4Sh/N AznpTyem/cyu+g7Hk4y7iVO/tXuOA3bp+wT1Ijifb0X/PKjCmFI+h33Ib3hUK5zex0 jIZJ3u/apEDHBizwDt+WTePnp4qQ1ySY8iwZ8Kdt6/7FNzLqEACBkhw5wEn//9PNp5 eS3VKT0pb01Z4zgEgTbKqV4/VOvOt1XQ627YGzfulPZOtIRvSJc8KwOYvHExiCt/vV 5x+Jx5X3mplBw== From: Sasha Levin To: stable@vger.kernel.org Cc: Max Yuan , Jordan Rhee , Joshua Washington , Matt Olson , Harshitha Ramamurthy , Jacob Keller , Jakub Kicinski , Sasha Levin Subject: [PATCH 5.15.y] gve: Correct ethtool rx_dropped calculation Date: Sat, 7 Feb 2026 14:30:47 -0500 Message-ID: <20260207193047.526604-1-sashal@kernel.org> X-Mailer: git-send-email 2.51.0 In-Reply-To: <2026020703-paralegal-scribing-9adf@gregkh> References: <2026020703-paralegal-scribing-9adf@gregkh> Precedence: bulk X-Mailing-List: stable@vger.kernel.org List-Id: List-Subscribe: List-Unsubscribe: MIME-Version: 1.0 Content-Transfer-Encoding: 8bit From: Max Yuan [ Upstream commit c7db85d579a1dccb624235534508c75fbf2dfe46 ] The gve driver's "rx_dropped" statistic, exposed via `ethtool -S`, incorrectly includes `rx_buf_alloc_fail` counts. These failures represent an inability to allocate receive buffers, not true packet drops where a received packet is discarded. This misrepresentation can lead to inaccurate diagnostics. This patch rectifies the ethtool "rx_dropped" calculation. It removes `rx_buf_alloc_fail` from the total and adds `xdp_tx_errors` and `xdp_redirect_errors`, which represent legitimate packet drops within the XDP path. Cc: stable@vger.kernel.org Fixes: 433e274b8f7b ("gve: Add stats for gve.") Signed-off-by: Max Yuan Reviewed-by: Jordan Rhee Reviewed-by: Joshua Washington Reviewed-by: Matt Olson Signed-off-by: Harshitha Ramamurthy Reviewed-by: Jacob Keller Link: https://patch.msgid.link/20260202193925.3106272-3-hramamurthy@google.com Signed-off-by: Jakub Kicinski [ removed rx_buf_alloc_fail from rx_dropped calculation ] Signed-off-by: Sasha Levin --- drivers/net/ethernet/google/gve/gve_ethtool.c | 4 +--- 1 file changed, 1 insertion(+), 3 deletions(-) diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c index 1f8cc722aae30..ca9397e16aaf4 100644 --- a/drivers/net/ethernet/google/gve/gve_ethtool.c +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c @@ -211,8 +211,7 @@ gve_get_ethtool_stats(struct net_device *netdev, data[i++] = rx_bytes; data[i++] = tx_bytes; /* total rx dropped packets */ - data[i++] = rx_skb_alloc_fail + rx_buf_alloc_fail + - rx_desc_err_dropped_pkt; + data[i++] = rx_skb_alloc_fail + rx_desc_err_dropped_pkt; /* Skip tx_dropped */ i++; @@ -267,7 +266,6 @@ gve_get_ethtool_stats(struct net_device *netdev, data[i++] = tmp_rx_bytes; /* rx dropped packets */ data[i++] = tmp_rx_skb_alloc_fail + - tmp_rx_buf_alloc_fail + tmp_rx_desc_err_dropped_pkt; data[i++] = rx->rx_copybreak_pkt; data[i++] = rx->rx_copied_pkt; -- 2.51.0