summaryrefslogtreecommitdiffstats
path: root/net/openvswitch/flow_table.c
diff options
context:
space:
mode:
authorThadeu Lima de Souza Cascardo <cascardo@redhat.com>2016-09-15 19:11:52 -0300
committerDavid S. Miller <davem@davemloft.net>2016-09-18 22:14:01 -0400
commit40773966ccf1985a1b2bb570a03cbeaf1cbd4e00 (patch)
treef94c6d8663b6e6131e6c06fde5849b719e7d3e2a /net/openvswitch/flow_table.c
parent829ff34868075ad57822783718de64acff4df303 (diff)
downloadlinux-40773966ccf1985a1b2bb570a03cbeaf1cbd4e00.tar.gz
linux-40773966ccf1985a1b2bb570a03cbeaf1cbd4e00.tar.bz2
linux-40773966ccf1985a1b2bb570a03cbeaf1cbd4e00.zip
openvswitch: fix flow stats accounting when node 0 is not possible
On a system with only node 1 as possible, all statistics is going to be accounted on node 0 as it will have a single writer. However, when getting and clearing the statistics, node 0 is not going to be considered, as it's not a possible node. Tested that statistics are not zero on a system with only node 1 possible. Also compile-tested with CONFIG_NUMA off. Signed-off-by: Thadeu Lima de Souza Cascardo <cascardo@redhat.com> Acked-by: Pravin B Shelar <pshelar@ovn.org> Signed-off-by: David S. Miller <davem@davemloft.net>
Diffstat (limited to 'net/openvswitch/flow_table.c')
-rw-r--r--net/openvswitch/flow_table.c5
1 files changed, 3 insertions, 2 deletions
diff --git a/net/openvswitch/flow_table.c b/net/openvswitch/flow_table.c
index d073fff82fdb..957a3c31dbb0 100644
--- a/net/openvswitch/flow_table.c
+++ b/net/openvswitch/flow_table.c
@@ -148,8 +148,9 @@ static void flow_free(struct sw_flow *flow)
kfree(flow->id.unmasked_key);
if (flow->sf_acts)
ovs_nla_free_flow_actions((struct sw_flow_actions __force *)flow->sf_acts);
- for_each_node(node)
- if (flow->stats[node])
+ /* We open code this to make sure node 0 is always considered */
+ for (node = 0; node < MAX_NUMNODES; node = next_node(node, node_possible_map))
+ if (node != 0 && flow->stats[node])
kmem_cache_free(flow_stats_cache,
(struct flow_stats __force *)flow->stats[node]);
kmem_cache_free(flow_cache, flow);