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 --- This is not related to XDP, but an issue related to this was spotted while introducing ethtool stats support resulting in page pool stats pollution. Page pool stats support patch was later dropped from the series once realized its deprecation. --- drivers/net/ethernet/cadence/macb_main.c | 2 +- 1 file changed, 1 insertion(+), 1 deletion(-) diff --git a/drivers/net/ethernet/cadence/macb_main.c b/drivers/net/ethernet/cadence/macb_main.c index be0c8e101639..5829c1f773dd 100644 --- a/drivers/net/ethernet/cadence/macb_main.c +++ b/drivers/net/ethernet/cadence/macb_main.c @@ -3212,7 +3212,7 @@ static void gem_get_ethtool_stats(struct net_device *dev, spin_lock_irq(&bp->stats_lock); gem_update_stats(bp); memcpy(data, &bp->ethtool_stats, sizeof(u64) - * (GEM_STATS_LEN + QUEUE_STATS_LEN * MACB_MAX_QUEUES)); + * (GEM_STATS_LEN + QUEUE_STATS_LEN * bp->num_queues)); spin_unlock_irq(&bp->stats_lock); } -- 2.51.1