Signed-off-by: Han Zhou <hzh...@ebay.com> --- ovn/controller/ovn-controller.c | 37 ++++++++++++++++++++++++++++++++++++- ovn/controller/physical.c | 23 +++++++++++++++++++++++ ovn/controller/physical.h | 8 +++++++- 3 files changed, 66 insertions(+), 2 deletions(-)
diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c index 1b0bfda..ddf6a95 100644 --- a/ovn/controller/ovn-controller.c +++ b/ovn/controller/ovn-controller.c @@ -943,6 +943,41 @@ flow_output_sb_port_binding_handler(struct engine_node *node) return true; } +static bool +flow_output_sb_multicast_group_handler(struct engine_node *node) +{ + struct controller_ctx *ctx = (struct controller_ctx *)node->context; + struct ed_type_runtime_data *data = + (struct ed_type_runtime_data *)engine_get_input( + "runtime_data", node)->data; + struct hmap *local_datapaths = &data->local_datapaths; + struct simap *ct_zones = &data->ct_zones; + const struct ovsrec_bridge *br_int = get_br_int(ctx); + + const char *chassis_id = get_chassis_id(ctx->ovs_idl); + + + const struct sbrec_chassis *chassis = NULL; + if (chassis_id) { + chassis = get_chassis(ctx->ovnsb_idl, chassis_id); + } + + ovs_assert(br_int && chassis); + + struct ed_type_flow_output *fod = + (struct ed_type_flow_output *)node->data; + struct ovn_desired_flow_table *flow_table = &fod->flow_table; + + enum mf_field_id mff_ovn_geneve = ofctrl_get_mf_field_id(); + physical_handle_mc_group_changes(flow_table, + ctx, mff_ovn_geneve, + chassis, ct_zones, + local_datapaths); + node->changed = true; + return true; + +} + int main(int argc, char *argv[]) { @@ -1025,7 +1060,7 @@ main(int argc, char *argv[]) engine_add_input(&en_flow_output, &en_sb_chassis, NULL); engine_add_input(&en_flow_output, &en_sb_encap, NULL); - engine_add_input(&en_flow_output, &en_sb_multicast_group, NULL); + engine_add_input(&en_flow_output, &en_sb_multicast_group, flow_output_sb_multicast_group_handler); engine_add_input(&en_flow_output, &en_sb_datapath_binding, NULL); engine_add_input(&en_flow_output, &en_sb_port_binding, flow_output_sb_port_binding_handler); engine_add_input(&en_flow_output, &en_sb_mac_binding, NULL); diff --git a/ovn/controller/physical.c b/ovn/controller/physical.c index 9fbcac0..5a55df7 100644 --- a/ovn/controller/physical.c +++ b/ovn/controller/physical.c @@ -937,6 +937,29 @@ physical_handle_port_binding_changes(struct ovn_desired_flow_table *flow_table, } void +physical_handle_mc_group_changes(struct ovn_desired_flow_table *flow_table, + struct controller_ctx *ctx, + enum mf_field_id mff_ovn_geneve, + const struct sbrec_chassis *chassis, + const struct simap *ct_zones, + struct hmap *local_datapaths) +{ + const struct sbrec_multicast_group *mc; + SBREC_MULTICAST_GROUP_FOR_EACH_TRACKED (mc, ctx->ovnsb_idl) { + if (sbrec_multicast_group_is_deleted(mc)) { + ofctrl_remove_flows(flow_table, &mc->header_.uuid); + } else { + if (!sbrec_multicast_group_is_new(mc)) { + ofctrl_remove_flows(flow_table, &mc->header_.uuid); + } + consider_mc_group(flow_table, mff_ovn_geneve, ct_zones, + local_datapaths, chassis, mc); + } + } +} + + +void physical_run(struct ovn_desired_flow_table *flow_table, struct controller_ctx *ctx, enum mf_field_id mff_ovn_geneve, const struct ovsrec_bridge *br_int, diff --git a/ovn/controller/physical.h b/ovn/controller/physical.h index cb55d94..50c1879 100644 --- a/ovn/controller/physical.h +++ b/ovn/controller/physical.h @@ -61,5 +61,11 @@ void physical_handle_port_binding_changes( struct hmap *local_datapaths, struct chassis_index *chassis_index, struct sset *active_tunnels); - +void physical_handle_mc_group_changes( + struct ovn_desired_flow_table *flow_table, + struct controller_ctx *ctx, + enum mf_field_id mff_ovn_geneve, + const struct sbrec_chassis *chassis, + const struct simap *ct_zones, + struct hmap *local_datapaths); #endif /* ovn/physical.h */ -- 2.1.0 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev