diff options
| author | Jarno Rajahalme <[email protected]> | 2014-03-27 19:35:23 +0000 |
|---|---|---|
| committer | Jesse Gross <[email protected]> | 2014-05-16 20:40:29 +0000 |
| commit | 23dabf88abb48a866fdb19ee08ebcf1ddd9b1840 (patch) | |
| tree | cc835b9d88c36d7b3b0c296fb2617f9971c5bd7e /net/openvswitch/flow.c | |
| parent | openvswitch: Use ether_addr_copy (diff) | |
| download | kernel-23dabf88abb48a866fdb19ee08ebcf1ddd9b1840.tar.gz kernel-23dabf88abb48a866fdb19ee08ebcf1ddd9b1840.zip | |
openvswitch: Remove 5-tuple optimization.
The 5-tuple optimization becomes unnecessary with a later per-NUMA
node stats patch. Remove it first to make the changes easier to
grasp.
Signed-off-by: Jarno Rajahalme <[email protected]>
Signed-off-by: Jesse Gross <[email protected]>
Diffstat (limited to 'net/openvswitch/flow.c')
| -rw-r--r-- | net/openvswitch/flow.c | 30 |
1 files changed, 11 insertions, 19 deletions
diff --git a/net/openvswitch/flow.c b/net/openvswitch/flow.c index 332aa01492f1..aad7a8da70b1 100644 --- a/net/openvswitch/flow.c +++ b/net/openvswitch/flow.c @@ -66,10 +66,7 @@ void ovs_flow_stats_update(struct sw_flow *flow, struct sk_buff *skb) 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)) && @@ -110,16 +107,14 @@ void ovs_flow_stats_get(struct sw_flow *flow, struct ovs_flow_stats *ovs_stats, memset(ovs_stats, 0, sizeof(*ovs_stats)); local_bh_disable(); - if (!flow->stats.is_percpu) { - stats_read(flow->stats.stat, ovs_stats, used, tcp_flags); - } else { - for_each_possible_cpu(cpu) { - struct flow_stats *stats; - stats = per_cpu_ptr(flow->stats.cpu_stats, cpu); - stats_read(stats, ovs_stats, used, tcp_flags); - } + for_each_possible_cpu(cpu) { + struct flow_stats *stats; + + stats = per_cpu_ptr(flow->stats.cpu_stats, cpu); + stats_read(stats, ovs_stats, used, tcp_flags); } + local_bh_enable(); } @@ -138,13 +133,10 @@ void ovs_flow_stats_clear(struct sw_flow *flow) int cpu; local_bh_disable(); - if (!flow->stats.is_percpu) { - stats_reset(flow->stats.stat); - } else { - for_each_possible_cpu(cpu) { - stats_reset(per_cpu_ptr(flow->stats.cpu_stats, cpu)); - } - } + + for_each_possible_cpu(cpu) + stats_reset(per_cpu_ptr(flow->stats, cpu)); + local_bh_enable(); } |
