struct flow_stats *stats;
__be16 tcp_flags = 0;
- if (!flow->stats.is_percpu)
- stats = flow->stats.stat;
- else
- stats = this_cpu_ptr(flow->stats.cpu_stats);
+ stats = this_cpu_ptr(flow->stats);
if ((flow->key.eth.type == htons(ETH_P_IP) ||
flow->key.eth.type == htons(ETH_P_IPV6)) &&
*tcp_flags = 0;
memset(ovs_stats, 0, sizeof(*ovs_stats));
- if (!flow->stats.is_percpu) {
- stats_read(flow->stats.stat, true, ovs_stats, used, tcp_flags);
- } else {
- cur_cpu = get_cpu();
+ cur_cpu = get_cpu();
- for_each_possible_cpu(cpu) {
- struct flow_stats *stats;
- bool lock_bh;
+ for_each_possible_cpu(cpu) {
+ struct flow_stats *stats;
+ bool lock_bh;
- stats = per_cpu_ptr(flow->stats.cpu_stats, cpu);
- lock_bh = (cpu == cur_cpu);
- stats_read(stats, lock_bh, ovs_stats, used, tcp_flags);
- }
- put_cpu();
+ stats = per_cpu_ptr(flow->stats, cpu);
+ lock_bh = (cpu == cur_cpu);
+ stats_read(stats, lock_bh, ovs_stats, used, tcp_flags);
}
+ put_cpu();
}
static void stats_reset(struct flow_stats *stats, bool lock_bh)
{
int cpu, cur_cpu;
- if (!flow->stats.is_percpu) {
- stats_reset(flow->stats.stat, true);
- } else {
- cur_cpu = get_cpu();
+ cur_cpu = get_cpu();
- for_each_possible_cpu(cpu) {
- bool lock_bh;
+ for_each_possible_cpu(cpu) {
+ bool lock_bh;
- lock_bh = (cpu == cur_cpu);
- stats_reset(per_cpu_ptr(flow->stats.cpu_stats, cpu), lock_bh);
- }
- put_cpu();
+ lock_bh = (cpu == cur_cpu);
+ stats_reset(per_cpu_ptr(flow->stats, cpu), lock_bh);
}
+ put_cpu();
}
static int check_header(struct sk_buff *skb, int len)