ofproto: Send only one OFPT_FLOW_REMOVED message when a flow expires.
authorBen Pfaff <blp@nicira.com>
Fri, 18 Oct 2013 23:32:40 +0000 (16:32 -0700)
committerBen Pfaff <blp@nicira.com>
Mon, 21 Oct 2013 19:46:21 +0000 (12:46 -0700)
Commit 15aaf59932a3 (ofproto: Add global locking around flow table
changes.) introduced doubled messages for expirations.

Reported-by: John Hurley <john.hurley@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
AUTHORS
ofproto/ofproto.c

diff --git a/AUTHORS b/AUTHORS
index af34bfe..2d29e66 100644 (file)
--- a/AUTHORS
+++ b/AUTHORS
@@ -167,6 +167,7 @@ Jeongkeun Lee           jklee@hp.com
 Jian Qiu                swordqiu@gmail.com
 Joan Cirer              joan@ev0.net
 John Galgay             john@galgay.net
+John Hurley             john.hurley@netronome.com
 Kevin Mancuso           kevin.mancuso@rackspace.com
 Kiran Shanbhog          kiran@vmware.com
 Kirill Kabardin
index ea812ad..6eab14d 100644 (file)
@@ -1124,7 +1124,8 @@ ofproto_get_snoops(const struct ofproto *ofproto, struct sset *snoops)
 }
 
 static void
-ofproto_rule_delete__(struct ofproto *ofproto, struct rule *rule)
+ofproto_rule_delete__(struct ofproto *ofproto, struct rule *rule,
+                      uint8_t reason)
     OVS_REQUIRES(ofproto_mutex)
 {
     struct ofopgroup *group;
@@ -1132,7 +1133,7 @@ ofproto_rule_delete__(struct ofproto *ofproto, struct rule *rule)
     ovs_assert(!rule->pending);
 
     group = ofopgroup_create_unattached(ofproto);
-    delete_flow__(rule, group, OFPRR_DELETE);
+    delete_flow__(rule, group, reason);
     ofopgroup_submit(group);
 }
 
@@ -1187,7 +1188,7 @@ ofproto_flush__(struct ofproto *ofproto)
         ovs_rwlock_unlock(&table->cls.rwlock);
         CLS_CURSOR_FOR_EACH_SAFE (rule, next_rule, cr, &cursor) {
             if (!rule->pending) {
-                ofproto_rule_delete__(ofproto, rule);
+                ofproto_rule_delete__(ofproto, rule, OFPRR_DELETE);
             }
         }
     }
@@ -4213,8 +4214,7 @@ ofproto_rule_expire(struct rule *rule, uint8_t reason)
     ovs_assert(reason == OFPRR_HARD_TIMEOUT || reason == OFPRR_IDLE_TIMEOUT
                || reason == OFPRR_DELETE);
 
-    ofproto_rule_send_removed(rule, reason);
-    ofproto_rule_delete__(ofproto, rule);
+    ofproto_rule_delete__(ofproto, rule, reason);
 }
 
 /* Reduces '*timeout' to no more than 'max'.  A value of zero in either case