summaryrefslogtreecommitdiff
path: root/net/openvswitch/flow.c
diff options
context:
space:
mode:
authorJarno Rajahalme <jrajahalme@nicira.com>2014-03-27 23:35:23 +0400
committerJesse Gross <jesse@nicira.com>2014-05-17 00:40:29 +0400
commit23dabf88abb48a866fdb19ee08ebcf1ddd9b1840 (patch)
treecc835b9d88c36d7b3b0c296fb2617f9971c5bd7e /net/openvswitch/flow.c
parent8c63ff09bddf944ab0033fea97aacfadfffa76de (diff)
downloadlinux-23dabf88abb48a866fdb19ee08ebcf1ddd9b1840.tar.xz
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 <jrajahalme@nicira.com> Signed-off-by: Jesse Gross <jesse@nicira.com>
Diffstat (limited to 'net/openvswitch/flow.c')
-rw-r--r--net/openvswitch/flow.c32
1 files changed, 12 insertions, 20 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();
}