public inbox for stable@vger.kernel.org
 help / color / mirror / Atom feed
* FAILED: patch "[PATCH] gve: Correct ethtool rx_dropped calculation" failed to apply to 6.6-stable tree
@ 2026-02-07 14:42 gregkh
  2026-02-07 18:43 ` [PATCH 6.6.y] gve: Correct ethtool rx_dropped calculation Sasha Levin
  0 siblings, 1 reply; 3+ messages in thread
From: gregkh @ 2026-02-07 14:42 UTC (permalink / raw)
  To: maxyuan, hramamurthy, jacob.e.keller, jordanrhee, joshwash, kuba,
	maolson
  Cc: stable


The patch below does not apply to the 6.6-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 <stable@vger.kernel.org>.

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.6.y
git checkout FETCH_HEAD
git cherry-pick -x c7db85d579a1dccb624235534508c75fbf2dfe46
# <resolve conflicts, build, test, etc.>
git commit -s
git send-email --to '<stable@vger.kernel.org>' --in-reply-to '2026020757-credibly-prologue-e2b8@gregkh' --subject-prefix 'PATCH 6.6.y' HEAD^..

Possible dependencies:



thanks,

greg k-h

------------------ original commit in Linus's tree ------------------

From c7db85d579a1dccb624235534508c75fbf2dfe46 Mon Sep 17 00:00:00 2001
From: Max Yuan <maxyuan@google.com>
Date: Mon, 2 Feb 2026 19:39:25 +0000
Subject: [PATCH] gve: Correct ethtool rx_dropped calculation

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 <maxyuan@google.com>
Reviewed-by: Jordan Rhee <jordanrhee@google.com>
Reviewed-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Matt Olson <maolson@google.com>
Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20260202193925.3106272-3-hramamurthy@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c
index 137dd7285bda..66ddc4413f8d 100644
--- a/drivers/net/ethernet/google/gve/gve_ethtool.c
+++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
@@ -152,10 +152,11 @@ gve_get_ethtool_stats(struct net_device *netdev,
 	u64 tmp_rx_pkts, tmp_rx_hsplit_pkt, tmp_rx_bytes, tmp_rx_hsplit_bytes,
 		tmp_rx_skb_alloc_fail, tmp_rx_buf_alloc_fail,
 		tmp_rx_desc_err_dropped_pkt, tmp_rx_hsplit_unsplit_pkt,
-		tmp_tx_pkts, tmp_tx_bytes;
+		tmp_tx_pkts, tmp_tx_bytes,
+		tmp_xdp_tx_errors, tmp_xdp_redirect_errors;
 	u64 rx_buf_alloc_fail, rx_desc_err_dropped_pkt, rx_hsplit_unsplit_pkt,
 		rx_pkts, rx_hsplit_pkt, rx_skb_alloc_fail, rx_bytes, tx_pkts, tx_bytes,
-		tx_dropped;
+		tx_dropped, xdp_tx_errors, xdp_redirect_errors;
 	int rx_base_stats_idx, max_rx_stats_idx, max_tx_stats_idx;
 	int stats_idx, stats_region_len, nic_stats_len;
 	struct stats *report_stats;
@@ -199,6 +200,7 @@ gve_get_ethtool_stats(struct net_device *netdev,
 	for (rx_pkts = 0, rx_bytes = 0, rx_hsplit_pkt = 0,
 	     rx_skb_alloc_fail = 0, rx_buf_alloc_fail = 0,
 	     rx_desc_err_dropped_pkt = 0, rx_hsplit_unsplit_pkt = 0,
+	     xdp_tx_errors = 0, xdp_redirect_errors = 0,
 	     ring = 0;
 	     ring < priv->rx_cfg.num_queues; ring++) {
 		if (priv->rx) {
@@ -216,6 +218,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
 					rx->rx_desc_err_dropped_pkt;
 				tmp_rx_hsplit_unsplit_pkt =
 					rx->rx_hsplit_unsplit_pkt;
+				tmp_xdp_tx_errors = rx->xdp_tx_errors;
+				tmp_xdp_redirect_errors =
+					rx->xdp_redirect_errors;
 			} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
 						       start));
 			rx_pkts += tmp_rx_pkts;
@@ -225,6 +230,8 @@ gve_get_ethtool_stats(struct net_device *netdev,
 			rx_buf_alloc_fail += tmp_rx_buf_alloc_fail;
 			rx_desc_err_dropped_pkt += tmp_rx_desc_err_dropped_pkt;
 			rx_hsplit_unsplit_pkt += tmp_rx_hsplit_unsplit_pkt;
+			xdp_tx_errors += tmp_xdp_tx_errors;
+			xdp_redirect_errors += tmp_xdp_redirect_errors;
 		}
 	}
 	for (tx_pkts = 0, tx_bytes = 0, tx_dropped = 0, ring = 0;
@@ -250,8 +257,8 @@ 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 +
+		    xdp_tx_errors + xdp_redirect_errors;
 	data[i++] = tx_dropped;
 	data[i++] = priv->tx_timeo_cnt;
 	data[i++] = rx_skb_alloc_fail;
@@ -330,6 +337,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
 				tmp_rx_buf_alloc_fail = rx->rx_buf_alloc_fail;
 				tmp_rx_desc_err_dropped_pkt =
 					rx->rx_desc_err_dropped_pkt;
+				tmp_xdp_tx_errors = rx->xdp_tx_errors;
+				tmp_xdp_redirect_errors =
+					rx->xdp_redirect_errors;
 			} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
 						       start));
 			data[i++] = tmp_rx_bytes;
@@ -340,8 +350,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
 			data[i++] = rx->rx_frag_alloc_cnt;
 			/* rx dropped packets */
 			data[i++] = tmp_rx_skb_alloc_fail +
-				tmp_rx_buf_alloc_fail +
-				tmp_rx_desc_err_dropped_pkt;
+				    tmp_rx_desc_err_dropped_pkt +
+				    tmp_xdp_tx_errors +
+				    tmp_xdp_redirect_errors;
 			data[i++] = rx->rx_copybreak_pkt;
 			data[i++] = rx->rx_copied_pkt;
 			/* stats from NIC */


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* [PATCH 6.6.y] gve: Correct ethtool rx_dropped calculation
  2026-02-07 14:42 FAILED: patch "[PATCH] gve: Correct ethtool rx_dropped calculation" failed to apply to 6.6-stable tree gregkh
@ 2026-02-07 18:43 ` Sasha Levin
  2026-02-08 12:12   ` Greg KH
  0 siblings, 1 reply; 3+ messages in thread
From: Sasha Levin @ 2026-02-07 18:43 UTC (permalink / raw)
  To: stable
  Cc: Max Yuan, Jordan Rhee, Joshua Washington, Matt Olson,
	Harshitha Ramamurthy, Jacob Keller, Jakub Kicinski, Sasha Levin

From: Max Yuan <maxyuan@google.com>

[ 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 <maxyuan@google.com>
Reviewed-by: Jordan Rhee <jordanrhee@google.com>
Reviewed-by: Joshua Washington <joshwash@google.com>
Reviewed-by: Matt Olson <maolson@google.com>
Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
Link: https://patch.msgid.link/20260202193925.3106272-3-hramamurthy@google.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
[ Adjust context ]
Signed-off-by: Sasha Levin <sashal@kernel.org>
---
 drivers/net/ethernet/google/gve/gve_ethtool.c | 26 ++++++++++++++-----
 1 file changed, 19 insertions(+), 7 deletions(-)

diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c
index 22317acf16ba4..997e1d7736a84 100644
--- a/drivers/net/ethernet/google/gve/gve_ethtool.c
+++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
@@ -156,9 +156,11 @@ gve_get_ethtool_stats(struct net_device *netdev,
 {
 	u64 tmp_rx_pkts, tmp_rx_bytes, tmp_rx_skb_alloc_fail,
 		tmp_rx_buf_alloc_fail, tmp_rx_desc_err_dropped_pkt,
-		tmp_tx_pkts, tmp_tx_bytes;
+		tmp_tx_pkts, tmp_tx_bytes,
+		tmp_xdp_tx_errors, tmp_xdp_redirect_errors;
 	u64 rx_buf_alloc_fail, rx_desc_err_dropped_pkt, rx_pkts,
-		rx_skb_alloc_fail, rx_bytes, tx_pkts, tx_bytes, tx_dropped;
+		rx_skb_alloc_fail, rx_bytes, tx_pkts, tx_bytes, tx_dropped,
+		xdp_tx_errors, xdp_redirect_errors;
 	int stats_idx, base_stats_idx, max_stats_idx;
 	struct stats *report_stats;
 	int *rx_qid_to_stats_idx;
@@ -186,7 +188,8 @@ gve_get_ethtool_stats(struct net_device *netdev,
 		return;
 	}
 	for (rx_pkts = 0, rx_bytes = 0, rx_skb_alloc_fail = 0,
-	     rx_buf_alloc_fail = 0, rx_desc_err_dropped_pkt = 0, ring = 0;
+	     rx_buf_alloc_fail = 0, rx_desc_err_dropped_pkt = 0,
+	     xdp_tx_errors = 0, xdp_redirect_errors = 0, ring = 0;
 	     ring < priv->rx_cfg.num_queues; ring++) {
 		if (priv->rx) {
 			do {
@@ -200,6 +203,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
 				tmp_rx_buf_alloc_fail = rx->rx_buf_alloc_fail;
 				tmp_rx_desc_err_dropped_pkt =
 					rx->rx_desc_err_dropped_pkt;
+				tmp_xdp_tx_errors = rx->xdp_tx_errors;
+				tmp_xdp_redirect_errors =
+					rx->xdp_redirect_errors;
 			} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
 						       start));
 			rx_pkts += tmp_rx_pkts;
@@ -207,6 +213,8 @@ gve_get_ethtool_stats(struct net_device *netdev,
 			rx_skb_alloc_fail += tmp_rx_skb_alloc_fail;
 			rx_buf_alloc_fail += tmp_rx_buf_alloc_fail;
 			rx_desc_err_dropped_pkt += tmp_rx_desc_err_dropped_pkt;
+			xdp_tx_errors += tmp_xdp_tx_errors;
+			xdp_redirect_errors += tmp_xdp_redirect_errors;
 		}
 	}
 	for (tx_pkts = 0, tx_bytes = 0, tx_dropped = 0, ring = 0;
@@ -231,8 +239,8 @@ 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 +
+		    xdp_tx_errors + xdp_redirect_errors;
 	data[i++] = tx_dropped;
 	data[i++] = priv->tx_timeo_cnt;
 	data[i++] = rx_skb_alloc_fail;
@@ -281,6 +289,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
 				tmp_rx_buf_alloc_fail = rx->rx_buf_alloc_fail;
 				tmp_rx_desc_err_dropped_pkt =
 					rx->rx_desc_err_dropped_pkt;
+				tmp_xdp_tx_errors = rx->xdp_tx_errors;
+				tmp_xdp_redirect_errors =
+					rx->xdp_redirect_errors;
 			} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
 						       start));
 			data[i++] = tmp_rx_bytes;
@@ -290,8 +301,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
 			data[i++] = rx->rx_frag_alloc_cnt;
 			/* rx dropped packets */
 			data[i++] = tmp_rx_skb_alloc_fail +
-				tmp_rx_buf_alloc_fail +
-				tmp_rx_desc_err_dropped_pkt;
+				    tmp_rx_desc_err_dropped_pkt +
+				    tmp_xdp_tx_errors +
+				    tmp_xdp_redirect_errors;
 			data[i++] = rx->rx_copybreak_pkt;
 			data[i++] = rx->rx_copied_pkt;
 			/* stats from NIC */
-- 
2.51.0


^ permalink raw reply related	[flat|nested] 3+ messages in thread

* Re: [PATCH 6.6.y] gve: Correct ethtool rx_dropped calculation
  2026-02-07 18:43 ` [PATCH 6.6.y] gve: Correct ethtool rx_dropped calculation Sasha Levin
@ 2026-02-08 12:12   ` Greg KH
  0 siblings, 0 replies; 3+ messages in thread
From: Greg KH @ 2026-02-08 12:12 UTC (permalink / raw)
  To: Sasha Levin
  Cc: stable, Max Yuan, Jordan Rhee, Joshua Washington, Matt Olson,
	Harshitha Ramamurthy, Jacob Keller, Jakub Kicinski

On Sat, Feb 07, 2026 at 01:43:05PM -0500, Sasha Levin wrote:
> From: Max Yuan <maxyuan@google.com>
> 
> [ 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 <maxyuan@google.com>
> Reviewed-by: Jordan Rhee <jordanrhee@google.com>
> Reviewed-by: Joshua Washington <joshwash@google.com>
> Reviewed-by: Matt Olson <maolson@google.com>
> Signed-off-by: Harshitha Ramamurthy <hramamurthy@google.com>
> Reviewed-by: Jacob Keller <jacob.e.keller@intel.com>
> Link: https://patch.msgid.link/20260202193925.3106272-3-hramamurthy@google.com
> Signed-off-by: Jakub Kicinski <kuba@kernel.org>
> [ Adjust context ]
> Signed-off-by: Sasha Levin <sashal@kernel.org>
> ---
>  drivers/net/ethernet/google/gve/gve_ethtool.c | 26 ++++++++++++++-----
>  1 file changed, 19 insertions(+), 7 deletions(-)
> 
> diff --git a/drivers/net/ethernet/google/gve/gve_ethtool.c b/drivers/net/ethernet/google/gve/gve_ethtool.c
> index 22317acf16ba4..997e1d7736a84 100644
> --- a/drivers/net/ethernet/google/gve/gve_ethtool.c
> +++ b/drivers/net/ethernet/google/gve/gve_ethtool.c
> @@ -156,9 +156,11 @@ gve_get_ethtool_stats(struct net_device *netdev,
>  {
>  	u64 tmp_rx_pkts, tmp_rx_bytes, tmp_rx_skb_alloc_fail,
>  		tmp_rx_buf_alloc_fail, tmp_rx_desc_err_dropped_pkt,
> -		tmp_tx_pkts, tmp_tx_bytes;
> +		tmp_tx_pkts, tmp_tx_bytes,
> +		tmp_xdp_tx_errors, tmp_xdp_redirect_errors;
>  	u64 rx_buf_alloc_fail, rx_desc_err_dropped_pkt, rx_pkts,
> -		rx_skb_alloc_fail, rx_bytes, tx_pkts, tx_bytes, tx_dropped;
> +		rx_skb_alloc_fail, rx_bytes, tx_pkts, tx_bytes, tx_dropped,
> +		xdp_tx_errors, xdp_redirect_errors;
>  	int stats_idx, base_stats_idx, max_stats_idx;
>  	struct stats *report_stats;
>  	int *rx_qid_to_stats_idx;
> @@ -186,7 +188,8 @@ gve_get_ethtool_stats(struct net_device *netdev,
>  		return;
>  	}
>  	for (rx_pkts = 0, rx_bytes = 0, rx_skb_alloc_fail = 0,
> -	     rx_buf_alloc_fail = 0, rx_desc_err_dropped_pkt = 0, ring = 0;
> +	     rx_buf_alloc_fail = 0, rx_desc_err_dropped_pkt = 0,
> +	     xdp_tx_errors = 0, xdp_redirect_errors = 0, ring = 0;
>  	     ring < priv->rx_cfg.num_queues; ring++) {
>  		if (priv->rx) {
>  			do {
> @@ -200,6 +203,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
>  				tmp_rx_buf_alloc_fail = rx->rx_buf_alloc_fail;
>  				tmp_rx_desc_err_dropped_pkt =
>  					rx->rx_desc_err_dropped_pkt;
> +				tmp_xdp_tx_errors = rx->xdp_tx_errors;
> +				tmp_xdp_redirect_errors =
> +					rx->xdp_redirect_errors;
>  			} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
>  						       start));
>  			rx_pkts += tmp_rx_pkts;
> @@ -207,6 +213,8 @@ gve_get_ethtool_stats(struct net_device *netdev,
>  			rx_skb_alloc_fail += tmp_rx_skb_alloc_fail;
>  			rx_buf_alloc_fail += tmp_rx_buf_alloc_fail;
>  			rx_desc_err_dropped_pkt += tmp_rx_desc_err_dropped_pkt;
> +			xdp_tx_errors += tmp_xdp_tx_errors;
> +			xdp_redirect_errors += tmp_xdp_redirect_errors;
>  		}
>  	}
>  	for (tx_pkts = 0, tx_bytes = 0, tx_dropped = 0, ring = 0;
> @@ -231,8 +239,8 @@ 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 +
> +		    xdp_tx_errors + xdp_redirect_errors;
>  	data[i++] = tx_dropped;
>  	data[i++] = priv->tx_timeo_cnt;
>  	data[i++] = rx_skb_alloc_fail;
> @@ -281,6 +289,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
>  				tmp_rx_buf_alloc_fail = rx->rx_buf_alloc_fail;
>  				tmp_rx_desc_err_dropped_pkt =
>  					rx->rx_desc_err_dropped_pkt;
> +				tmp_xdp_tx_errors = rx->xdp_tx_errors;
> +				tmp_xdp_redirect_errors =
> +					rx->xdp_redirect_errors;
>  			} while (u64_stats_fetch_retry(&priv->rx[ring].statss,
>  						       start));
>  			data[i++] = tmp_rx_bytes;
> @@ -290,8 +301,9 @@ gve_get_ethtool_stats(struct net_device *netdev,
>  			data[i++] = rx->rx_frag_alloc_cnt;
>  			/* rx dropped packets */
>  			data[i++] = tmp_rx_skb_alloc_fail +
> -				tmp_rx_buf_alloc_fail +
> -				tmp_rx_desc_err_dropped_pkt;
> +				    tmp_rx_desc_err_dropped_pkt +
> +				    tmp_xdp_tx_errors +
> +				    tmp_xdp_redirect_errors;
>  			data[i++] = rx->rx_copybreak_pkt;
>  			data[i++] = rx->rx_copied_pkt;
>  			/* stats from NIC */
> -- 
> 2.51.0
> 
> 

Does not apply after I added your other backport :(

Can you rebase this one on top of that one?

thanks,

greg k-h

^ permalink raw reply	[flat|nested] 3+ messages in thread

end of thread, other threads:[~2026-02-08 12:12 UTC | newest]

Thread overview: 3+ messages (download: mbox.gz follow: Atom feed
-- links below jump to the message on this page --
2026-02-07 14:42 FAILED: patch "[PATCH] gve: Correct ethtool rx_dropped calculation" failed to apply to 6.6-stable tree gregkh
2026-02-07 18:43 ` [PATCH 6.6.y] gve: Correct ethtool rx_dropped calculation Sasha Levin
2026-02-08 12:12   ` Greg KH

This is a public inbox, see mirroring instructions
for how to clone and mirror all data and code used for this inbox