net: ethernet: litex: add support for 64 bit stats
authorJisheng Zhang <jszhang@kernel.org>
Wed, 14 Jun 2023 16:20:35 +0000 (00:20 +0800)
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>
Thu, 27 Jul 2023 06:50:35 +0000 (08:50 +0200)
commit0d14264155226aea658fa332aa1baedc49e604d0
tree65c6c976aa8bf5b7b25ff87bdffe8e5204e1979f
parent86f9330a49d1464849482298dd34d361859183eb
net: ethernet: litex: add support for 64 bit stats

[ Upstream commit 18da174d865a87d47d2f33f5b0a322efcf067728 ]

Implement 64 bit per cpu stats to fix the overflow of netdev->stats
on 32 bit platforms. To simplify the code, we use net core
pcpu_sw_netstats infrastructure. One small drawback is some memory
overhead because litex uses just one queue, but we allocate the
counters per cpu.

Signed-off-by: Jisheng Zhang <jszhang@kernel.org>
Reviewed-by: Simon Horman <simon.horman@corigine.com>
Acked-by: Gabriel Somlo <gsomlo@gmail.com>
Link: https://lore.kernel.org/r/20230614162035.300-1-jszhang@kernel.org
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
Signed-off-by: Sasha Levin <sashal@kernel.org>
drivers/net/ethernet/litex/litex_liteeth.c