]> git.ipfire.org Git - thirdparty/kernel/stable.git/commitdiff
eth: fbnic: Fix tx_dropped reporting
authorMohsin Bashir <mohsin.bashr@gmail.com>
Sat, 2 Aug 2025 02:46:35 +0000 (19:46 -0700)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Fri, 15 Aug 2025 14:39:27 +0000 (16:39 +0200)
[ Upstream commit 2972395d8fad7f4efc8555348f2f988d4941d797 ]

Correctly copy the tx_dropped stats from the fbd->hw_stats to the
rtnl_link_stats64 struct.

Fixes: 5f8bd2ce8269 ("eth: fbnic: add support for TMI stats")
Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
Reviewed-by: Simon Horman <horms@kernel.org>
Link: https://patch.msgid.link/20250802024636.679317-2-mohsin.bashr@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/meta/fbnic/fbnic_netdev.c

index 93717cf5bd8f47efd80aae87583a0b12f336beb5..76c0167319af6b9a95e294e7ffdca8f4864b76dc 100644 (file)
@@ -422,16 +422,16 @@ static void fbnic_get_stats64(struct net_device *dev,
        tx_packets = stats->packets;
        tx_dropped = stats->dropped;
 
-       stats64->tx_bytes = tx_bytes;
-       stats64->tx_packets = tx_packets;
-       stats64->tx_dropped = tx_dropped;
-
        /* Record drops from Tx HW Datapath */
        tx_dropped += fbd->hw_stats.tmi.drop.frames.value +
                      fbd->hw_stats.tti.cm_drop.frames.value +
                      fbd->hw_stats.tti.frame_drop.frames.value +
                      fbd->hw_stats.tti.tbi_drop.frames.value;
 
+       stats64->tx_bytes = tx_bytes;
+       stats64->tx_packets = tx_packets;
+       stats64->tx_dropped = tx_dropped;
+
        for (i = 0; i < fbn->num_tx_queues; i++) {
                struct fbnic_ring *txr = fbn->tx[i];