ibmvnic: Use ndo_get_stats64 to fix inaccurate SAR reporting
authorMingming Cao <mmc@linux.ibm.com>
Wed, 16 Jul 2025 15:21:15 +0000 (11:21 -0400)
committerJakub Kicinski <kuba@kernel.org>
Fri, 18 Jul 2025 01:55:44 +0000 (18:55 -0700)
commitefe28034ea27cd621e42c9be9a5af2c5ad0e2198
treef3bca5d0b4280f64350e65d516b0b1d46680adc5
parent0dce68479305e0307c8b2766ee1271ea7c9aaca8
ibmvnic: Use ndo_get_stats64 to fix inaccurate SAR reporting

VNIC testing on multi-core Power systems showed SAR stats drift
and packet rate inconsistencies under load.

Implements ndo_get_stats64 to provide safe aggregation of queue-level
atomic64 counters into rtnl_link_stats64 for use by tools like 'ip -s',
'ifconfig', and 'sar'. Switch to ndo_get_stats64 to align SAR reporting
with the standard kernel interface for retrieving netdev stats.

This removes redundant per-adapter stat updates, reduces overhead,
eliminates cacheline bouncing from hot path updates, and improves
the accuracy of reported packet rates.

Signed-off-by: Mingming Cao <mmc@linux.ibm.com>
Reviewed-by: Brian King <bjking1@linux.ibm.com>
Reviewed-by: Dave Marquardt <davemarq@linux.ibm.com>
Reviewed-by: Simon Horman <horms@kernel.org>
----
Changes since v3:
link to v3: https://www.spinics.net/lists/netdev/msg1107999.html
-- keep per queue counters as u64 (this patch) and drop off patch 1 in v3

Link: https://patch.msgid.link/20250716152115.61143-1-mmc@linux.ibm.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/ethernet/ibm/ibmvnic.c