From 2d04a2aff72ccfebbfc576a6de360062ef071232 Mon Sep 17 00:00:00 2001 From: Joe Stringer Date: Tue, 3 Jun 2014 21:09:59 +1200 Subject: [PATCH] ofproto: Remove ofproto_refresh_rule(). The only user of this function was removed in the previous patch, so remove it. Signed-off-by: Joe Stringer Acked-by: Alex Wang --- ofproto/ofproto-dpif.c | 12 ----------- ofproto/ofproto-provider.h | 2 -- ofproto/ofproto.c | 41 -------------------------------------- 3 files changed, 55 deletions(-) diff --git a/ofproto/ofproto-dpif.c b/ofproto/ofproto-dpif.c index 7f59b94e8..db01196eb 100644 --- a/ofproto/ofproto-dpif.c +++ b/ofproto/ofproto-dpif.c @@ -365,18 +365,6 @@ ofproto_dpif_flow_mod(struct ofproto_dpif *ofproto, ofproto_flow_mod(&ofproto->up, fm); } -/* Resets the modified time for 'rule' or an equivalent rule. If 'rule' is not - * in the classifier, but an equivalent rule is, unref 'rule' and ref the new - * rule. Otherwise if 'rule' is no longer installed in the classifier, - * reinstall it. - * - * Returns the rule whose modified time has been reset. */ -struct rule_dpif * -ofproto_dpif_refresh_rule(struct rule_dpif *rule) -{ - return rule_dpif_cast(ofproto_refresh_rule(&rule->up)); -} - /* Appends 'pin' to the queue of "packet ins" to be sent to the controller. * Takes ownership of 'pin' and pin->packet. */ void diff --git a/ofproto/ofproto-provider.h b/ofproto/ofproto-provider.h index 639b501e9..1978a2002 100644 --- a/ofproto/ofproto-provider.h +++ b/ofproto/ofproto-provider.h @@ -1716,8 +1716,6 @@ BUILD_ASSERT_DECL(OFPROTO_POSTPONE < OFPERR_OFS); int ofproto_flow_mod(struct ofproto *, struct ofputil_flow_mod *) OVS_EXCLUDED(ofproto_mutex); -struct rule *ofproto_refresh_rule(struct rule *rule) - OVS_EXCLUDED(ofproto_mutex); void ofproto_add_flow(struct ofproto *, const struct match *, unsigned int priority, const struct ofpact *ofpacts, size_t ofpacts_len) diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index 608ddada7..f8ca930e3 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -1976,47 +1976,6 @@ ofproto_flow_mod(struct ofproto *ofproto, struct ofputil_flow_mod *fm) return handle_flow_mod__(ofproto, NULL, fm, NULL); } -/* Resets the modified time for 'rule' or an equivalent rule. If 'rule' is not - * in the classifier, but an equivalent rule is, unref 'rule' and ref the new - * rule. Otherwise if 'rule' is no longer installed in the classifier, - * reinstall it. - * - * Returns the rule whose modified time has been reset. */ -struct rule * -ofproto_refresh_rule(struct rule *rule) -{ - const struct oftable *table = &rule->ofproto->tables[rule->table_id]; - const struct cls_rule *cr = &rule->cr; - struct rule *r; - - /* do_add_flow() requires that the rule is not installed. We lock the - * ofproto_mutex here so that another thread cannot add the flow before - * we get a chance to add it.*/ - ovs_mutex_lock(&ofproto_mutex); - - fat_rwlock_rdlock(&table->cls.rwlock); - r = rule_from_cls_rule(classifier_find_rule_exactly(&table->cls, cr)); - if (r != rule) { - ofproto_rule_ref(r); - } - fat_rwlock_unlock(&table->cls.rwlock); - - if (!r) { - do_add_flow(rule->ofproto, NULL, NULL, 0, rule); - } else if (r != rule) { - ofproto_rule_unref(rule); - rule = r; - } - ovs_mutex_unlock(&ofproto_mutex); - - /* Refresh the modified time for the rule. */ - ovs_mutex_lock(&rule->mutex); - rule->modified = MAX(rule->modified, time_msec()); - ovs_mutex_unlock(&rule->mutex); - - return rule; -} - /* Searches for a rule with matching criteria exactly equal to 'target' in * ofproto's table 0 and, if it finds one, deletes it. * -- 2.20.1