.. | .. |
---|
6 | 6 | #include <linux/socket.h> |
---|
7 | 7 | #include <linux/rtnetlink.h> |
---|
8 | 8 | #include <linux/pkt_sched.h> |
---|
| 9 | +#include <net/net_seq_lock.h> |
---|
| 10 | + |
---|
| 11 | +/* Note: this used to be in include/uapi/linux/gen_stats.h */ |
---|
| 12 | +struct gnet_stats_basic_packed { |
---|
| 13 | + __u64 bytes; |
---|
| 14 | + __u64 packets; |
---|
| 15 | +}; |
---|
9 | 16 | |
---|
10 | 17 | struct gnet_stats_basic_cpu { |
---|
11 | 18 | struct gnet_stats_basic_packed bstats; |
---|
12 | 19 | struct u64_stats_sync syncp; |
---|
13 | | -}; |
---|
| 20 | +} __aligned(2 * sizeof(u64)); |
---|
14 | 21 | |
---|
15 | 22 | struct net_rate_estimator; |
---|
16 | 23 | |
---|
.. | .. |
---|
36 | 43 | spinlock_t *lock, struct gnet_dump *d, |
---|
37 | 44 | int padattr); |
---|
38 | 45 | |
---|
39 | | -int gnet_stats_copy_basic(const seqcount_t *running, |
---|
| 46 | +int gnet_stats_copy_basic(net_seqlock_t *running, |
---|
40 | 47 | struct gnet_dump *d, |
---|
41 | 48 | struct gnet_stats_basic_cpu __percpu *cpu, |
---|
42 | 49 | struct gnet_stats_basic_packed *b); |
---|
43 | | -void __gnet_stats_copy_basic(const seqcount_t *running, |
---|
| 50 | +void __gnet_stats_copy_basic(net_seqlock_t *running, |
---|
44 | 51 | struct gnet_stats_basic_packed *bstats, |
---|
| 52 | + struct gnet_stats_basic_cpu __percpu *cpu, |
---|
| 53 | + struct gnet_stats_basic_packed *b); |
---|
| 54 | +int gnet_stats_copy_basic_hw(net_seqlock_t *running, |
---|
| 55 | + struct gnet_dump *d, |
---|
45 | 56 | struct gnet_stats_basic_cpu __percpu *cpu, |
---|
46 | 57 | struct gnet_stats_basic_packed *b); |
---|
47 | 58 | int gnet_stats_copy_rate_est(struct gnet_dump *d, |
---|
.. | .. |
---|
60 | 71 | struct gnet_stats_basic_cpu __percpu *cpu_bstats, |
---|
61 | 72 | struct net_rate_estimator __rcu **rate_est, |
---|
62 | 73 | spinlock_t *lock, |
---|
63 | | - seqcount_t *running, struct nlattr *opt); |
---|
| 74 | + net_seqlock_t *running, struct nlattr *opt); |
---|
64 | 75 | void gen_kill_estimator(struct net_rate_estimator __rcu **ptr); |
---|
65 | 76 | int gen_replace_estimator(struct gnet_stats_basic_packed *bstats, |
---|
66 | 77 | struct gnet_stats_basic_cpu __percpu *cpu_bstats, |
---|
67 | 78 | struct net_rate_estimator __rcu **ptr, |
---|
68 | 79 | spinlock_t *lock, |
---|
69 | | - seqcount_t *running, struct nlattr *opt); |
---|
| 80 | + net_seqlock_t *running, struct nlattr *opt); |
---|
70 | 81 | bool gen_estimator_active(struct net_rate_estimator __rcu **ptr); |
---|
71 | 82 | bool gen_estimator_read(struct net_rate_estimator __rcu **ptr, |
---|
72 | 83 | struct gnet_stats_rate_est64 *sample); |
---|