Linux kernel mirror (for testing) git.kernel.org/pub/scm/linux/kernel/git/torvalds/linux.git
kernel os linux

Merge branch 'eth-fbnic-fix-drop-stats-support'

Mohsin Bashir says:

====================
eth: fbnic: Fix drop stats support

Fix hardware drop stats support on the TX path of fbnic by addressing two
issues: ensure that tx_dropped stats are correctly copied to the
rtnl_link_stats64 struct, and protect the copying of drop stats from
fdb->hw_stats to the local variable with the hw_stats_lock to
ensure consistency.
====================

Link: https://patch.msgid.link/20250802024636.679317-1-mohsin.bashr@gmail.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>

+6 -4
+6 -4
drivers/net/ethernet/meta/fbnic/fbnic_netdev.c
··· 422 422 tx_packets = stats->packets; 423 423 tx_dropped = stats->dropped; 424 424 425 - stats64->tx_bytes = tx_bytes; 426 - stats64->tx_packets = tx_packets; 427 - stats64->tx_dropped = tx_dropped; 428 - 429 425 /* Record drops from Tx HW Datapath */ 426 + spin_lock(&fbd->hw_stats_lock); 430 427 tx_dropped += fbd->hw_stats.tmi.drop.frames.value + 431 428 fbd->hw_stats.tti.cm_drop.frames.value + 432 429 fbd->hw_stats.tti.frame_drop.frames.value + 433 430 fbd->hw_stats.tti.tbi_drop.frames.value; 431 + spin_unlock(&fbd->hw_stats_lock); 432 + 433 + stats64->tx_bytes = tx_bytes; 434 + stats64->tx_packets = tx_packets; 435 + stats64->tx_dropped = tx_dropped; 434 436 435 437 for (i = 0; i < fbn->num_tx_queues; i++) { 436 438 struct fbnic_ring *txr = fbn->tx[i];