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>
This commit is contained in:

committed by
David S. Miller

parent
0f030bdb16
commit
de7d5084d8
@@ -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);\
|
||||
|
Reference in New Issue
Block a user