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 <zhou...@gmail.com> --- ovn/controller/physical.c | 24 ++++++++++++------------ 1 file changed, 12 insertions(+), 12 deletions(-) diff --git a/ovn/controller/physical.c b/ovn/controller/physical.c index 657c3e2..1f11e48 100644 --- a/ovn/controller/physical.c +++ b/ovn/controller/physical.c @@ -384,6 +384,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. * ======================= * @@ -469,18 +481,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. */ -- 2.1.0 _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev