/* rule. */
static void ofproto_rule_send_removed(struct rule *, uint8_t reason);
static bool rule_is_readonly(const struct rule *);
+static void ofproto_rule_insert__(struct ofproto *, struct rule *)
+ OVS_REQUIRES(ofproto_mutex);
static void ofproto_rule_remove__(struct ofproto *, struct rule *)
OVS_REQUIRES(ofproto_mutex);
return error;
}
- if (fm->hard_timeout || fm->idle_timeout) {
- list_insert(&ofproto->expirable, &rule->expirable);
- }
- cookies_insert(ofproto, rule);
- eviction_group_add_rule(rule);
- if (actions->has_meter) {
- meter_insert_rule(rule);
- }
+ ofproto_rule_insert__(ofproto, rule);
classifier_defer(&table->cls);
}
}
+/* Inserts 'rule' from the ofproto data structures BEFORE caller has inserted
+ * it to the classifier. */
+static void
+ofproto_rule_insert__(struct ofproto *ofproto, struct rule *rule)
+ OVS_REQUIRES(ofproto_mutex)
+{
+ const struct rule_actions *actions = rule_get_actions(rule);
+
+ if (rule->hard_timeout || rule->idle_timeout) {
+ list_insert(&ofproto->expirable, &rule->expirable);
+ }
+ cookies_insert(ofproto, rule);
+ eviction_group_add_rule(rule);
+ if (actions->has_meter) {
+ meter_insert_rule(rule);
+ }
+}
+
/* Removes 'rule' from the ofproto data structures AFTER caller has removed
* it from the classifier. */
static void