ovn-controller: Loopback prevention flows for local ports only.
authorHan Zhou <zhouhan@gmail.com>
Tue, 29 Mar 2016 23:55:11 +0000 (16:55 -0700)
committerBen Pfaff <blp@ovn.org>
Wed, 30 Mar 2016 23:44:26 +0000 (16:44 -0700)
Currently in physical_run() we added per-port loopback prevention
flows for all lports. The flows are actually required only for
local ports on the chassis. This change greatly reduces number of
flows in table 34.

Signed-off-by: Han Zhou <zhouhan@gmail.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
ovn/controller/physical.c

index 531df92..795db31 100644 (file)
@@ -416,6 +416,18 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve,
             ofctrl_add_flow(flow_table, OFTABLE_LOCAL_OUTPUT, 100, &match,
                             &ofpacts);
 
+            /* Table 34, Priority 100.
+             * =======================
+             *
+             * Drop packets whose logical inport and outport are the same. */
+            match_init_catchall(&match);
+            ofpbuf_clear(&ofpacts);
+            match_set_metadata(&match, htonll(binding->datapath->tunnel_key));
+            match_set_reg(&match, MFF_LOG_INPORT - MFF_REG0, binding->tunnel_key);
+            match_set_reg(&match, MFF_LOG_OUTPORT - MFF_REG0, binding->tunnel_key);
+            ofctrl_add_flow(flow_table, OFTABLE_DROP_LOOPBACK, 100,
+                            &match, &ofpacts);
+
             /* Table 64, Priority 100.
              * =======================
              *
@@ -501,18 +513,6 @@ physical_run(struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve,
             ofctrl_add_flow(flow_table, OFTABLE_REMOTE_OUTPUT, 100,
                             &match, &ofpacts);
         }
-
-        /* Table 34, Priority 100.
-         * =======================
-         *
-         * Drop packets whose logical inport and outport are the same. */
-        match_init_catchall(&match);
-        ofpbuf_clear(&ofpacts);
-        match_set_metadata(&match, htonll(binding->datapath->tunnel_key));
-        match_set_reg(&match, MFF_LOG_INPORT - MFF_REG0, binding->tunnel_key);
-        match_set_reg(&match, MFF_LOG_OUTPORT - MFF_REG0, binding->tunnel_key);
-        ofctrl_add_flow(flow_table, OFTABLE_DROP_LOOPBACK, 100,
-                        &match, &ofpacts);
     }
 
     /* Handle output to multicast groups, in tables 32 and 33. */