aboutsummaryrefslogtreecommitdiffstats
path: root/include
diff options
context:
space:
mode:
authorEric Dumazet <edumazet@google.com>2019-11-07 16:27:14 -0800
committerDavid S. Miller <davem@davemloft.net>2019-11-07 20:03:08 -0800
commitde7d5084d82794a8e83afb994fcb07f82da3cd7b (patch)
tree6fac49846721fd5f09d7770276707e39283537ab /include
parentMerge branch 'net-Demote-MTU-change-prints-to-debug' (diff)
downloadlinux-dev-de7d5084d82794a8e83afb994fcb07f82da3cd7b.tar.xz
linux-dev-de7d5084d82794a8e83afb994fcb07f82da3cd7b.zip
net: provide dev_lstats_read() helper
Many network drivers use hand-coded implementation of the same thing, let's factorize things so that u64_stats_t adoption is done once. 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.h2
1 files changed, 2 insertions, 0 deletions
diff --git a/include/linux/netdevice.h b/include/linux/netdevice.h
index 1f140a6b66df..75561992c31f 100644
--- a/include/linux/netdevice.h
+++ b/include/linux/netdevice.h
@@ -2401,6 +2401,8 @@ struct pcpu_lstats {
struct u64_stats_sync syncp;
} __aligned(2 * sizeof(u64));
+void dev_lstats_read(struct net_device *dev, u64 *packets, u64 *bytes);
+
#define __netdev_alloc_pcpu_stats(type, gfp) \
({ \
typeof(type) __percpu *pcpu_stats = alloc_percpu_gfp(type, gfp);\