bareudp: Handle stats using NETDEV_PCPU_STAT_DSTATS.
authorGuillaume Nault <gnault@redhat.com>
Wed, 4 Dec 2024 12:11:32 +0000 (13:11 +0100)
committerJakub Kicinski <kuba@kernel.org>
Sat, 7 Dec 2024 01:56:53 +0000 (17:56 -0800)
commitc77200c074917d0fd51e5c029c50c76c07b6d310
treedf113a4a4aec8ba604782263cd4bb8614b68b468
parent6fa6de30224619f836f4cb1209b5af3f5319806e
bareudp: Handle stats using NETDEV_PCPU_STAT_DSTATS.

Bareudp uses the TSTATS infrastructure (dev_sw_netstats_*()) for RX
packet counters. It was also recently converted to use the device core
stats (dev_core_stats_*()) for RX and TX drops (see commit 788d5d655bc9
("bareudp: Use pcpu stats to update rx_dropped counter.")).

Since core stats are to be avoided in drivers, and for consistency with
VXLAN and Geneve, let's convert packet stats handling to DSTATS, which
can handle RX/TX stats and packet drops. Statistics that don't fit
DSTATS are still updated atomically with DEV_STATS_INC().

Signed-off-by: Guillaume Nault <gnault@redhat.com>
Link: https://patch.msgid.link/0f4f8448db3ff449ac6e939872b28cf3f8982da7.1733313925.git.gnault@redhat.com
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
drivers/net/bareudp.c