diff options
author | Eric Dumazet <edumazet@google.com> | 2023-09-21 08:52:16 +0000 |
---|---|---|
committer | David S. Miller <davem@davemloft.net> | 2023-10-01 16:33:01 +0100 |
commit | 0b068c714ca9479d2783cc333fff5bc2d4a6d45c (patch) | |
tree | d3458ee59ddd5407e55d99538d821706190d49ca /include | |
parent | a63df366d0915a85d31498d295e6ae81815badde (diff) | |
download | lwn-0b068c714ca9479d2783cc333fff5bc2d4a6d45c.tar.gz lwn-0b068c714ca9479d2783cc333fff5bc2d4a6d45c.zip |
net: add DEV_STATS_READ() helper
Companion of DEV_STATS_INC() & DEV_STATS_ADD().
This is going to be used in the series.
Use it in macsec_get_stats64().
Signed-off-by: Eric Dumazet <edumazet@google.com>
Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'include')
-rw-r--r-- | include/linux/netdevice.h | 1 |
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h index 7e520c14eb8c..e070a4540fba 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5236,5 +5236,6 @@ extern struct net_device *blackhole_netdev; #define DEV_STATS_INC(DEV, FIELD) atomic_long_inc(&(DEV)->stats.__##FIELD) #define DEV_STATS_ADD(DEV, FIELD, VAL) \ atomic_long_add((VAL), &(DEV)->stats.__##FIELD) +#define DEV_STATS_READ(DEV, FIELD) atomic_long_read(&(DEV)->stats.__##FIELD) #endif /* _LINUX_NETDEVICE_H */ |