summaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2023-09-21 08:52:16 +0000
committerGreg Kroah-Hartman <gregkh@linuxfoundation.org>2023-11-20 11:56:54 +0100
commit1589a9ab256679d2f32a465f1a6bb0e0520b9d55 (patch)
tree35c4fe460318bb4988c0d861cd57ace2fa846863 /include
parentd2683d7e949b22a154d0c38d62bd3e6e3dac55b3 (diff)
downloadlinux-stable-1589a9ab256679d2f32a465f1a6bb0e0520b9d55.tar.gz
linux-stable-1589a9ab256679d2f32a465f1a6bb0e0520b9d55.tar.bz2
linux-stable-1589a9ab256679d2f32a465f1a6bb0e0520b9d55.zip
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.h1
1 files changed, 1 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index b828c7a75be2..48134407b70f 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -5230,5 +5230,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 */