patch 'net/ice: fix Rx packets statistics underflow' has been queued to stable release 25.11.3

Kevin Traynor ktraynor at redhat.com
Tue Jul 28 17:56:39 CEST 2026


Hi,

FYI, your patch has been queued to stable release 25.11.3

Note it hasn't been pushed to http://dpdk.org/browse/dpdk-stable yet.
It will be pushed if I get no objections before 08/01/26. So please
shout if anyone has objections.

Also note that after the patch there's a diff of the upstream commit vs the
patch applied to the branch. This will indicate if there was any rebasing
needed to apply to the stable branch. If there were code changes for rebasing
(ie: not only metadata diffs), please double check that the rebase was
correctly done.

Queued patches are on a temporary branch at:
https://github.com/kevintraynor/dpdk-stable

This queued commit can be viewed at:
https://github.com/kevintraynor/dpdk-stable/commit/657a3b1069ee0e0d209e19ab6274d272cd5e0fea

Thanks.

Kevin

---
>From 657a3b1069ee0e0d209e19ab6274d272cd5e0fea Mon Sep 17 00:00:00 2001
From: Ciara Loftus <ciara.loftus at intel.com>
Date: Thu, 25 Jun 2026 09:36:17 +0000
Subject: [PATCH] net/ice: fix Rx packets statistics underflow

[ upstream commit 403af2bebf29472495a060a91fc207779742101f ]

The number of Rx packets is computed as the sum of the unicast,
multicast and broadcast packet counters, minus the discarded packet
count:

    ipackets = rx_unicast + rx_multicast + rx_broadcast - rx_discards

The unicast, multicast and broadcast counters already include the
packets that were subsequently dropped, so subtracting rx_discards
yields only the packets delivered to the application. However, each of
these counters is read from a separate hardware register, and the reads
happen at slightly different instants. Under load, rx_discards (read
last) can momentarily exceed the sum of the unicast, multicast and
broadcast counters (read earlier). As ipackets is unsigned, the
subtraction then wraps to a huge bogus value, reported to the
application as an enormous Rx packet count and packet rate.

Read the rx_discards register before the unicast, multicast and
broadcast registers. As all of these counters only ever increase, and
the unicast, multicast and broadcast counters always include the
discarded packets, sampling rx_discards first guarantees it can never
exceed the later sum of the other three, so the subtraction can never
underflow.

Fixes: a37bde56314d ("net/ice: support statistics")

Signed-off-by: Ciara Loftus <ciara.loftus at intel.com>
Acked-by: Bruce Richardson <bruce.richardson at intel.com>
---
 drivers/net/intel/ice/ice_ethdev.c | 11 +++++++++--
 1 file changed, 9 insertions(+), 2 deletions(-)

diff --git a/drivers/net/intel/ice/ice_ethdev.c b/drivers/net/intel/ice/ice_ethdev.c
index c683c6cc67..3a2ed78305 100644
--- a/drivers/net/intel/ice/ice_ethdev.c
+++ b/drivers/net/intel/ice/ice_ethdev.c
@@ -6481,4 +6481,13 @@ ice_update_vsi_stats(struct ice_vsi *vsi)
 	int idx = rte_le_to_cpu_16(vsi->vsi_id);
 
+	/*
+	 * Unicast/multicast/broadcast counters include discarded packets. Received packets is
+	 * calculated by deducting discards from unicast/multicast/broadcast. To prevent a
+	 * potential underflow, read discards first to guarantee it is smaller than
+	 * unicast/multicast/broadcast.
+	 */
+	ice_stat_update_32(hw, GLV_RDPC(idx), vsi->offset_loaded,
+			   &oes->rx_discards, &nes->rx_discards);
+
 	ice_stat_update_40(hw, GLV_GORCH(idx), GLV_GORCL(idx),
 			   vsi->offset_loaded, &oes->rx_bytes,
@@ -6507,6 +6516,4 @@ ice_update_vsi_stats(struct ice_vsi *vsi)
 			  nes->rx_broadcast) * RTE_ETHER_CRC_LEN;
 
-	ice_stat_update_32(hw, GLV_RDPC(idx), vsi->offset_loaded,
-			   &oes->rx_discards, &nes->rx_discards);
 	/* GLV_REPC not supported */
 	/* GLV_RMPC not supported */
-- 
2.55.0

---
  Diff of the applied patch vs upstream commit (please double-check if non-empty:
---
--- -	2026-07-28 16:54:52.816798906 +0100
+++ 0069-net-ice-fix-Rx-packets-statistics-underflow.patch	2026-07-28 16:54:50.827728968 +0100
@@ -1 +1 @@
-From 403af2bebf29472495a060a91fc207779742101f Mon Sep 17 00:00:00 2001
+From 657a3b1069ee0e0d209e19ab6274d272cd5e0fea Mon Sep 17 00:00:00 2001
@@ -5,0 +6,2 @@
+[ upstream commit 403af2bebf29472495a060a91fc207779742101f ]
+
@@ -30 +31,0 @@
-Cc: stable at dpdk.org
@@ -39 +40 @@
-index 99305b604b..022d92a2f6 100644
+index c683c6cc67..3a2ed78305 100644
@@ -42 +43 @@
-@@ -6456,4 +6456,13 @@ ice_update_vsi_stats(struct ice_vsi *vsi)
+@@ -6481,4 +6481,13 @@ ice_update_vsi_stats(struct ice_vsi *vsi)
@@ -56 +57 @@
-@@ -6482,6 +6491,4 @@ ice_update_vsi_stats(struct ice_vsi *vsi)
+@@ -6507,6 +6516,4 @@ ice_update_vsi_stats(struct ice_vsi *vsi)



More information about the stable mailing list