diff options
| author | Eric Dumazet <edumazet@google.com> | 2023-09-21 08:52:16 +0000 |
|---|---|---|
| committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-11-20 10:29:17 +0100 |
| commit | 1d5224e02a1c0be7da369ffac531c392f262b162 (patch) | |
| tree | 4622164ad1945e4655788df826d5accc02a0e072 /include/linux | |
| parent | 403877118d1f2c07e893df95ac27e2567bf26af3 (diff) | |
net: add DEV_STATS_READ() helper
[ Upstream commit 0b068c714ca9479d2783cc333fff5bc2d4a6d45c ]
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>
Stable-dep-of: ff672b9ffeb3 ("ipvlan: properly track tx_errors")
Signed-off-by: Sasha Levin <sashal@kernel.org>
Diffstat (limited to 'include/linux')
| -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 744017475b1d..ac87fcc4d44b 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -4853,5 +4853,6 @@ do { \ #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 */ |
