]> www.infradead.org Git - users/jedix/linux-maple.git/commit
net: core: Implement dstats-type stats collections
authorJeremy Kerr <jk@codeconstruct.com.au>
Fri, 7 Jun 2024 10:25:25 +0000 (18:25 +0800)
committerJakub Kicinski <kuba@kernel.org>
Wed, 12 Jun 2024 02:24:56 +0000 (19:24 -0700)
commit94b601bc4f8528262b2b83194b7fd3fc2a6da75a
treef5d6816a8ed5f6f68d2fe667e516cb43a0d34042
parentfa59dc2f6fc616fde3941f62ccd4adcaa21ccd47
net: core: Implement dstats-type stats collections

We currently have dev_get_tstats64() for collecting per-cpu stats of
type pcpu_sw_netstats ("tstats"). However, tstats doesn't allow for
accounting tx/rx drops. We do have a stats variant that does have stats
for dropped packets: struct pcpu_dstats, but there are no core helpers
for using those stats.

The VRF driver uses dstats, by providing its own collation/fetch
functions to do so.

This change adds a common implementation for dstats-type collection,
used when pcpu_stat_type == NETDEV_PCPU_STAT_DSTAT. This is based on the
VRF driver's existing stats collator (plus the unused tx_drops stat from
there). We will switch the VRF driver to use this in the next change.

Signed-off-by: Jeremy Kerr <jk@codeconstruct.com.au>
Reviewed-by: Simon Horman <horms@kernel.org>
Reviewed-by: David Ahern <dsahern@kernel.org>
Link: https://lore.kernel.org/r/20240607-dstats-v3-2-cc781fe116f7@codeconstruct.com.au
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
net/core/dev.c