]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
net: enetc: correct the xdp_tx statistics
authorWei Fang <wei.fang@nxp.com>
Mon, 24 Feb 2025 11:12:46 +0000 (19:12 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 13 Mar 2025 11:50:59 +0000 (12:50 +0100)
commit 432a2cb3ee97a7c6ea578888fe81baad035b9307 upstream.

The 'xdp_tx' is used to count the number of XDP_TX frames sent, not the
number of Tx BDs.

Fixes: 7ed2bc80074e ("net: enetc: add support for XDP_TX")
Cc: stable@vger.kernel.org
Signed-off-by: Wei Fang <wei.fang@nxp.com>
Reviewed-by: Ioana Ciornei <ioana.ciornei@nxp.com>
Reviewed-by: Vladimir Oltean <vladimir.oltean@nxp.com>
Link: https://patch.msgid.link/20250224111251.1061098-4-wei.fang@nxp.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Greg Kroah-Hartman <gregkh@linuxfoundation.org>
drivers/net/ethernet/freescale/enetc/enetc.c

index b2a8b8136f83d3b45312e8f2d2e310ac10daf0bf..612872c8c8e3c35e09c038d5e5e1c9d36e4bec93 100644 (file)
@@ -1343,7 +1343,7 @@ static int enetc_clean_rx_ring_xdp(struct enetc_bdr *rx_ring,
                                enetc_xdp_drop(rx_ring, orig_i, i);
                                tx_ring->stats.xdp_tx_drops++;
                        } else {
-                               tx_ring->stats.xdp_tx += xdp_tx_bd_cnt;
+                               tx_ring->stats.xdp_tx++;
                                rx_ring->xdp.xdp_tx_in_flight += xdp_tx_bd_cnt;
                                xdp_tx_frm_cnt++;
                                /* The XDP_TX enqueue was successful, so we