mirror of
https://github.com/Fishwaldo/Star64_linux.git
synced 2025-07-12 01:22:11 +00:00
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>
This commit is contained in:
parent
8c63ff09bd
commit
23dabf88ab
7 changed files with 31 additions and 112 deletions
|
@ -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();
|
||||
}
|
||||
|
||||
|
|
Loading…
Add table
Add a link
Reference in a new issue