From: Han Zhou Date: Tue, 29 Mar 2016 23:55:11 +0000 (-0700) Subject: ovn-controller: Loopback prevention flows for local ports only. X-Git-Url: http://git.cascardo.eti.br/?a=commitdiff_plain;h=d1a997a29b2128b5424403cae49b87d02492a117;p=cascardo%2Fovs.git ovn-controller: Loopback prevention flows for local ports only. 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 Signed-off-by: Ben Pfaff --- diff --git a/ovn/controller/physical.c b/ovn/controller/physical.c index 531df924c..795db31e2 100644 --- a/ovn/controller/physical.c +++ b/ovn/controller/physical.c @@ -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. */