Skip to content

Commit 3e1f045

Browse files
vlrplnbuchwitz
authored andcommitted
net: macb: use the current queue number for stats
gem_get_ethtool_stats calculates the size of the statistics data to copy always considering maximum number of queues. The patch makes sure the statistics are copied only for the active queues as returned in the string set count op. Signed-off-by: Paolo Valerio <pvalerio@redhat.com>
1 parent c8741bc commit 3e1f045

File tree

1 file changed

+1
-1
lines changed

1 file changed

+1
-1
lines changed

drivers/net/ethernet/cadence/macb_main.c

Lines changed: 1 addition & 1 deletion
Original file line numberDiff line numberDiff line change
@@ -3529,7 +3529,7 @@ static void gem_get_ethtool_stats(struct net_device *dev,
35293529
spin_lock_irq(&bp->stats_lock);
35303530
gem_update_stats(bp);
35313531
memcpy(data, &bp->ethtool_stats, sizeof(u64)
3532-
* (GEM_STATS_LEN + QUEUE_STATS_LEN * MACB_MAX_QUEUES));
3532+
* (GEM_STATS_LEN + QUEUE_STATS_LEN * bp->num_queues));
35333533
spin_unlock_irq(&bp->stats_lock);
35343534
}
35353535

0 commit comments

Comments
 (0)