diff options
author | Han Zhou <zhouhan@gmail.com> | 2018-05-08 15:11:52 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2018-05-09 13:11:25 -0700 |
commit | 2c00b26f10090f972510eb17ee0f0be1e8dcc91b (patch) | |
tree | 088e718e856458944d1fd9930ac7bbb927b7ba8d /ovn | |
parent | 66842c003c035c1d19d976276040c4c0f175b832 (diff) | |
download | openvswitch-2c00b26f10090f972510eb17ee0f0be1e8dcc91b.tar.gz |
ovn-controller: Make the local-only flow generic.
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 <blp@ovn.org>
Suggested-at: https://mail.openvswitch.org/pipermail/ovs-dev/2018-May/346719.html
Signed-off-by: Han Zhou <hzhou8@ebay.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
Diffstat (limited to 'ovn')
-rw-r--r-- | ovn/controller/physical.c | 29 |
1 files changed, 14 insertions, 15 deletions
diff --git a/ovn/controller/physical.c b/ovn/controller/physical.c index 8c92c1d9b..fc8adcfef 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 |