for (i = 0; i < ofproto->n_tables; i++) {
unsigned long missed, matched;
- atomic_read(&ofproto->tables[i].n_matched, &matched);
+ atomic_read_relaxed(&ofproto->tables[i].n_matched, &matched);
+ atomic_read_relaxed(&ofproto->tables[i].n_missed, &missed);
+
stats[i].matched_count = matched;
- atomic_read(&ofproto->tables[i].n_missed, &missed);
stats[i].lookup_count = matched + missed;
}
}
take_ref);
if (stats) {
struct oftable *tbl = &ofproto->up.tables[next_id];
- atomic_ulong *stat = *rule ? &tbl->n_matched : &tbl->n_missed;
unsigned long orig;
- atomic_add(stat, stats->n_packets, &orig);
+
+ atomic_add_relaxed(*rule ? &tbl->n_matched : &tbl->n_missed,
+ stats->n_packets, &orig);
}
if (*rule) {
return RULE_DPIF_LOOKUP_VERDICT_MATCH;
sprintf(f->name, "table%d", i);
f->metadata_match = OVS_BE64_MAX;
f->metadata_write = OVS_BE64_MAX;
- atomic_read(&ofproto->tables[i].miss_config, &f->miss_config);
+ atomic_read_relaxed(&ofproto->tables[i].miss_config, &f->miss_config);
f->max_entries = 1000000;
bitmap_set_multiple(f->nonmiss.next, i + 1,
ofproto_table_get_miss_config(const struct ofproto *ofproto, uint8_t table_id)
{
enum ofputil_table_miss value;
- atomic_read(&ofproto->tables[table_id].miss_config, &value);
+
+ atomic_read_relaxed(&ofproto->tables[table_id].miss_config, &value);
return value;
}
if (tm->table_id == OFPTT_ALL) {
int i;
for (i = 0; i < ofproto->n_tables; i++) {
- atomic_store(&ofproto->tables[i].miss_config, tm->miss_config);
+ atomic_store_relaxed(&ofproto->tables[i].miss_config,
+ tm->miss_config);
}
} else {
- atomic_store(&ofproto->tables[tm->table_id].miss_config,
- tm->miss_config);
+ atomic_store_relaxed(&ofproto->tables[tm->table_id].miss_config,
+ tm->miss_config);
}
}
return 0;