From ad9ca2fc4ab3f2380a9034a8c276b49cf58411fe Mon Sep 17 00:00:00 2001 From: Ben Pfaff Date: Fri, 18 Oct 2013 16:32:40 -0700 Subject: [PATCH] ofproto: Send only one OFPT_FLOW_REMOVED message when a flow expires. Commit 15aaf59932a3 (ofproto: Add global locking around flow table changes.) introduced doubled messages for expirations. Reported-by: John Hurley Signed-off-by: Ben Pfaff Acked-by: Justin Pettit --- AUTHORS | 1 + ofproto/ofproto.c | 10 +++++----- 2 files changed, 6 insertions(+), 5 deletions(-) diff --git a/AUTHORS b/AUTHORS index 5afaa29b6..11da939a5 100644 --- a/AUTHORS +++ b/AUTHORS @@ -173,6 +173,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 diff --git a/ofproto/ofproto.c b/ofproto/ofproto.c index f44a7c4fa..f67e1fb7e 100644 --- a/ofproto/ofproto.c +++ b/ofproto/ofproto.c @@ -1139,7 +1139,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; @@ -1147,7 +1148,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); } @@ -1202,7 +1203,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); } } } @@ -4322,8 +4323,7 @@ ofproto_rule_expire(struct rule *rule, uint8_t reason) ovs_assert(reason == OFPRR_HARD_TIMEOUT || reason == OFPRR_IDLE_TIMEOUT || reason == OFPRR_DELETE || reason == OFPRR_GROUP_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 -- 2.47.0