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