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>
*tcp_flags = 0;
memset(ovs_stats, 0, sizeof(*ovs_stats));
- for_each_node(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)) {
struct flow_stats *stats = rcu_dereference_ovsl(flow->stats[node]);
if (stats) {
{
int node;
- for_each_node(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)) {
struct flow_stats *stats = ovsl_dereference(flow->stats[node]);
if (stats) {
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);