]> git.ipfire.org Git - thirdparty/linux.git/commitdiff
eth: fbnic: fix `tx_dropped` counting
authorMohsin Bashir <mohsin.bashr@gmail.com>
Sat, 3 May 2025 02:01:45 +0000 (19:01 -0700)
committerPaolo Abeni <pabeni@redhat.com>
Tue, 6 May 2025 09:07:36 +0000 (11:07 +0200)
Fix the tracking of rtnl_link_stats.tx_dropped. The counter
`tmi.drop.frames` is being double counted whereas, the counter
`tti.cm_drop.frames` is being skipped.

Fixes: f2957147ae7a ("eth: fbnic: add support for TTI HW stats")
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Mohsin Bashir <mohsin.bashr@gmail.com>
Reviewed-by: Joe Damato <jdamato@fastly.com>
Link: https://patch.msgid.link/20250503020145.1868252-1-mohsin.bashr@gmail.com
Signed-off-by: Paolo Abeni <pabeni@redhat.com>
drivers/net/ethernet/meta/fbnic/fbnic_netdev.c

index d699f58dda211482952074c67104ba440d12d24e..f994cbf1857ddb119eaf49f591806bc54bdc35e5 100644 (file)
@@ -425,9 +425,9 @@ static void fbnic_get_stats64(struct net_device *dev,
 
        /* 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 +
-                     fbd->hw_stats.tmi.drop.frames.value;
+                     fbd->hw_stats.tti.tbi_drop.frames.value;
 
        for (i = 0; i < fbn->num_tx_queues; i++) {
                struct fbnic_ring *txr = fbn->tx[i];