-cls_rule_make_invisible_in_version(const struct cls_rule *rule_,
- long long version, long long lookup_version)
-{
- struct cls_match *rule = rule_->cls_match;
-
- /* XXX: Adjust when versioning is actually used. */
- ovs_assert(version >= rule_->version && version >= lookup_version);
-
- /* Normally, we call this when deleting a rule that is already visible to
- * lookups. However, sometimes a bundle transaction will add a rule and
- * then delete it before the rule has ever become visible. If we set such
- * a rule to become invisible in a future 'version', it would become
- * visible to all prior versions. So, in this case we must set the rule
- * visibility to 0 (== never visible). */
- if (cls_match_visible_in_version(rule, lookup_version)) {
- /* Make invisible starting at 'version'. */
- atomic_store_relaxed(&rule->visibility, -version);
- } else {
- /* Rule has not yet been visible to lookups, make invisible in all
- * version. */
- atomic_store_relaxed(&rule->visibility, 0);
- }
+cls_rule_make_invisible_in_version(const struct cls_rule *rule,
+ cls_version_t remove_version)
+{
+ ovs_assert(remove_version >= rule->cls_match->add_version);
+
+ cls_match_set_remove_version(rule->cls_match, remove_version);