summaryrefslogtreecommitdiff
path: root/ovn
diff options
context:
space:
mode:
authorRyan Moats <rmoats@us.ibm.com>2016-07-28 18:10:16 +0000
committerBen Pfaff <blp@ovn.org>2016-07-28 12:52:56 -0700
commit1a58344bb3e6ea6e0a57ac2453d883564033e8e4 (patch)
tree043b78076a5b99ad9caa26ede1d539c2b24a1a55 /ovn
parent9132729ea161682e9d6b59da33d86eb7cbe7b0f5 (diff)
downloadopenvswitch-1a58344bb3e6ea6e0a57ac2453d883564033e8e4.tar.gz
ovn-controller: Clean up cases that lead to duplicate OF flows.
In physical_run, there are multiple places where OF flows can be produced each cycle. Because the desired flow table may not have been completely cleared first, remove flows created during previous runs before creating new flows. This avoid collisions. Signed-off-by: Ryan Moats <rmoats@us.ibm.com> Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r--ovn/controller/physical.c13
1 files changed, 13 insertions, 0 deletions
diff --git a/ovn/controller/physical.c b/ovn/controller/physical.c
index e5df4f2ee..ee1da4fa1 100644
--- a/ovn/controller/physical.c
+++ b/ovn/controller/physical.c
@@ -750,6 +750,10 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve,
const struct sbrec_port_binding *binding;
if (full_binding_processing) {
SBREC_PORT_BINDING_FOR_EACH (binding, ctx->ovnsb_idl) {
+ /* Because it is possible in the above code to enter this
+ * for loop without having cleared the flow table first, we
+ * should clear the old flows to avoid collisions. */
+ ofctrl_remove_flows(&binding->header_.uuid);
consider_port_binding(mff_ovn_geneve, ct_zones, local_datapaths,
patched_datapaths, binding, &ofpacts);
}
@@ -773,12 +777,21 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve,
struct ofpbuf remote_ofpacts;
ofpbuf_init(&remote_ofpacts, 0);
SBREC_MULTICAST_GROUP_FOR_EACH (mc, ctx->ovnsb_idl) {
+ /* As multicast groups are always reprocessed each time,
+ * the first step is to clean the old flows for the group
+ * so that we avoid warning messages on collisions. */
+ ofctrl_remove_flows(&mc->header_.uuid);
consider_mc_group(mff_ovn_geneve, ct_zones,
local_datapaths, mc, &ofpacts, &remote_ofpacts);
}
ofpbuf_uninit(&remote_ofpacts);
+ /* Because flows using the hard-coded uuid are recalculated each
+ * cycle, let's first remove the old flows to avoid duplicate flow
+ * warnings. */
+ ofctrl_remove_flows(hc_uuid);
+
/* Table 0, priority 100.
* ======================
*