]> git.baikalelectronics.ru Git - kernel.git/commit
net: core: add dev_get_tstats64 as a ndo_get_stats64 implementation
authorHeiner Kallweit <hkallweit1@gmail.com>
Sat, 7 Nov 2020 20:49:07 +0000 (21:49 +0100)
committerJakub Kicinski <kuba@kernel.org>
Tue, 10 Nov 2020 01:50:27 +0000 (17:50 -0800)
commit745cb01bf93ed61350fbc255670dfa0cd7522fea
tree1610d113acba3c22d5039df654e98e8eafe63d36
parent3d5fe69dddf74530c96bd561d1b752311dc29ffe
net: core: add dev_get_tstats64 as a ndo_get_stats64 implementation

It's a frequent pattern to use netdev->stats for the less frequently
accessed counters and per-cpu counters for the frequently accessed
counters (rx/tx bytes/packets). Add a default ndo_get_stats64()
implementation for this use case.

Reviewed-by: Florian Fainelli <f.fainelli@gmail.com>
Signed-off-by: Heiner Kallweit <hkallweit1@gmail.com>
Signed-off-by: Jakub Kicinski <kuba@kernel.org>
include/linux/netdevice.h
net/core/dev.c