The flow that handles MLF_LOCAL_ONLY flag is now added for each
multicast group, but in fact it can be more generic and only one
is needed rather than per mc group.

Suggested-by: Ben Pfaff <[email protected]>
Suggested-at: 
https://mail.openvswitch.org/pipermail/ovs-dev/2018-May/346719.html
Signed-off-by: Han Zhou <[email protected]>
---
 ovn/controller/physical.c | 29 ++++++++++++++---------------
 1 file changed, 14 insertions(+), 15 deletions(-)

diff --git a/ovn/controller/physical.c b/ovn/controller/physical.c
index 8c92c1d..fc8adcf 100644
--- a/ovn/controller/physical.c
+++ b/ovn/controller/physical.c
@@ -1006,21 +1006,6 @@ 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) {
-        /* Table 32, priority 150.
-         * =======================
-         *
-         * Multicast packets that should not be sent to other hypervisors.
-         */
-        struct match match = MATCH_CATCHALL_INITIALIZER;
-        match_set_metadata(&match, htonll(mc->datapath->tunnel_key));
-        match_set_reg(&match, MFF_LOG_OUTPORT - MFF_REG0, mc->tunnel_key);
-        match_set_reg_masked(&match, MFF_LOG_FLAGS - MFF_REG0,
-                             MLF_LOCAL_ONLY, MLF_LOCAL_ONLY);
-        ofpbuf_clear(&ofpacts);
-        put_resubmit(OFTABLE_LOCAL_OUTPUT, &ofpacts);
-        ofctrl_add_flow(flow_table, OFTABLE_REMOTE_OUTPUT, 150, 0, &match,
-                        &ofpacts);
-
         consider_mc_group(mff_ovn_geneve, ct_zones, local_datapaths, chassis,
                           mc, &ofpacts, &remote_ofpacts, flow_table);
     }
@@ -1122,6 +1107,20 @@ physical_run(struct controller_ctx *ctx, enum 
mf_field_id mff_ovn_geneve,
     /* Table 32, priority 150.
      * =======================
      *
+     * Packets that should not be sent to other hypervisors.
+     */
+    match_init_catchall(&match);
+    match_set_reg_masked(&match, MFF_LOG_FLAGS - MFF_REG0,
+                         MLF_LOCAL_ONLY, MLF_LOCAL_ONLY);
+    /* Resubmit to table 33. */
+    ofpbuf_clear(&ofpacts);
+    put_resubmit(OFTABLE_LOCAL_OUTPUT, &ofpacts);
+    ofctrl_add_flow(flow_table, OFTABLE_REMOTE_OUTPUT, 150, 0,
+                    &match, &ofpacts);
+
+    /* Table 32, priority 150.
+     * =======================
+     *
      * Handles packets received from ports of type "localport".  These ports
      * are present on every hypervisor.  Traffic that originates at one should
      * never go over a tunnel to a remote hypervisor, so resubmit them to table
-- 
2.1.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to