diff options
author | Eric Dumazet | 2019-11-07 16:27:14 -0800 |
---|---|---|
committer | David S. Miller | 2019-11-07 20:03:08 -0800 |
commit | de7d5084d82794a8e83afb994fcb07f82da3cd7b (patch) | |
tree | 6fac49846721fd5f09d7770276707e39283537ab /include/linux/netdevice.h | |
parent | 0f030bdb16dc1282e58c5825e5662e351142f605 (diff) |
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/linux/netdevice.h')
-rw-r--r-- | include/linux/netdevice.h | 2 |
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);\ |