Skip to content

Commit ad21f66

Browse files
committed
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/[email protected] Signed-off-by: Jakub Kicinski <[email protected]>
2 parents e407fce + 53abd9c commit ad21f66

File tree

1 file changed

+6
-4
lines changed

1 file changed

+6
-4
lines changed

drivers/net/ethernet/meta/fbnic/fbnic_netdev.c

Lines changed: 6 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -422,15 +422,17 @@ static void fbnic_get_stats64(struct net_device *dev,
422422
tx_packets = stats->packets;
423423
tx_dropped = stats->dropped;
424424

425-
stats64->tx_bytes = tx_bytes;
426-
stats64->tx_packets = tx_packets;
427-
stats64->tx_dropped = tx_dropped;
428-
429425
/* Record drops from Tx HW Datapath */
426+
spin_lock(&fbd->hw_stats_lock);
430427
tx_dropped += fbd->hw_stats.tmi.drop.frames.value +
431428
fbd->hw_stats.tti.cm_drop.frames.value +
432429
fbd->hw_stats.tti.frame_drop.frames.value +
433430
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;
434436

435437
for (i = 0; i < fbn->num_tx_queues; i++) {
436438
struct fbnic_ring *txr = fbn->tx[i];

0 commit comments

Comments
 (0)