diff options
author | Eric Dumazet <edumazet@google.com> | 2023-09-21 11:52:16 +0300 |
---|---|---|
committer | Greg Kroah-Hartman <gregkh@linuxfoundation.org> | 2023-11-20 13:06:46 +0300 |
commit | e897dcbd5fbcf8f6d9bc62406c04ca9459ab4092 (patch) | |
tree | 460ebf4410710b323924a86c5449c85c7e80ec64 /include | |
parent | 98e8a5a370da0f8b68a0ac6229a4e3c174082423 (diff) | |
download | linux-e897dcbd5fbcf8f6d9bc62406c04ca9459ab4092.tar.xz |
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')
-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 e814ce78a196..3380668478e8 100644 --- a/include/linux/netdevice.h +++ b/include/linux/netdevice.h @@ -5286,5 +5286,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 */ |