History

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.

Eric Dumazet committed 7 years ago

Commit de7d5081 parent 0f030bd2 files · +19 −7Browse files

Showing the changes to include/linux (1 of 2 files). Show all

Unified · Split

include/linux/netdevice.h+2−0
@@ -2401,6 +2401,8 @@ struct pcpu_lstats { · 2400 unmodified lines
2401 struct u64_stats_sync syncp;2401 struct u64_stats_sync syncp;
2402} __aligned(2 * sizeof(u64));2402} __aligned(2 * sizeof(u64));
2403 2403
2404void dev_lstats_read(struct net_device *dev, u64 *packets, u64 *bytes);
2405
2404#define __netdev_alloc_pcpu_stats(type, gfp) \2406#define __netdev_alloc_pcpu_stats(type, gfp) \
2405({ \2407({ \
2406 typeof(type) __percpu *pcpu_stats = alloc_percpu_gfp(type, gfp);\2408 typeof(type) __percpu *pcpu_stats = alloc_percpu_gfp(type, gfp);\

Keyboard shortcuts

General

Show keyboard shortcuts
?
Focus the current search
/

Issues and pull requests

Open filters
f

Issues, pull requests and Inbox

Select next item
j↓
Select previous item
k↑
Open selected item
Enter
Dismiss filters or clear selection
Esc

Repository code

Go to file
t