Skip to content

Commit ca83bb3

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 24be453 commit ca83bb3

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
@@ -3525,7 +3525,7 @@ static void gem_get_ethtool_stats(struct net_device *dev,
35253525
spin_lock_irq(&bp->stats_lock);
35263526
gem_update_stats(bp);
35273527
memcpy(data, &bp->ethtool_stats, sizeof(u64)
3528-
* (GEM_STATS_LEN + QUEUE_STATS_LEN * MACB_MAX_QUEUES));
3528+
* (GEM_STATS_LEN + QUEUE_STATS_LEN * bp->num_queues));
35293529
spin_unlock_irq(&bp->stats_lock);
35303530
}
35313531

0 commit comments

Comments
 (0)