This is done to simplify and remove duplication of code. New function will be used in next patch.
Signed-off-by: Vladislav Odintsov <odiv...@gmail.com> --- controller/physical.c | 29 +++++++++++++---------------- 1 file changed, 13 insertions(+), 16 deletions(-) diff --git a/controller/physical.c b/controller/physical.c index ec861f49c..2925dcd1d 100644 --- a/controller/physical.c +++ b/controller/physical.c @@ -1704,6 +1704,13 @@ chassis_is_vtep(const struct sbrec_chassis *chassis) return smap_get_bool(&chassis->other_config, "is-vtep", false); } +static void +local_output_pb(int64_t tunnel_key, struct ofpbuf *ofpacts) +{ + put_load(tunnel_key, MFF_LOG_OUTPORT, 0, 32, ofpacts); + put_resubmit(OFTABLE_CHECK_LOOPBACK, ofpacts); +} + static void consider_mc_group(struct ovsdb_idl_index *sbrec_port_binding_by_name, enum mf_field_id mff_ovn_geneve, @@ -1773,13 +1780,9 @@ consider_mc_group(struct ovsdb_idl_index *sbrec_port_binding_by_name, if (!strcmp(port->type, "patch")) { if (ldp->is_transit_switch) { - put_load(port->tunnel_key, MFF_LOG_OUTPORT, 0, 32, - &ofpacts); - put_resubmit(OFTABLE_CHECK_LOOPBACK, &ofpacts); + local_output_pb(port->tunnel_key, &ofpacts); } else { - put_load(port->tunnel_key, MFF_LOG_OUTPORT, 0, 32, - &remote_ofpacts); - put_resubmit(OFTABLE_CHECK_LOOPBACK, &remote_ofpacts); + local_output_pb(port->tunnel_key, &remote_ofpacts); } } if (!strcmp(port->type, "remote")) { if (port->chassis) { @@ -1790,18 +1793,14 @@ consider_mc_group(struct ovsdb_idl_index *sbrec_port_binding_by_name, port->tunnel_key, &remote_ofpacts); } } else if (!strcmp(port->type, "localport")) { - put_load(port->tunnel_key, MFF_LOG_OUTPORT, 0, 32, - &remote_ofpacts); - put_resubmit(OFTABLE_CHECK_LOOPBACK, &remote_ofpacts); + local_output_pb(port->tunnel_key, &remote_ofpacts); } else if ((port->chassis == chassis || is_additional_chassis(port, chassis)) && (local_binding_get_primary_pb(local_bindings, lport_name) || !strcmp(port->type, "l3gateway"))) { - put_load(port->tunnel_key, MFF_LOG_OUTPORT, 0, 32, &ofpacts); - put_resubmit(OFTABLE_CHECK_LOOPBACK, &ofpacts); + local_output_pb(port->tunnel_key, &ofpacts); } else if (simap_contains(patch_ofports, port->logical_port)) { - put_load(port->tunnel_key, MFF_LOG_OUTPORT, 0, 32, &ofpacts); - put_resubmit(OFTABLE_CHECK_LOOPBACK, &ofpacts); + local_output_pb(port->tunnel_key, &ofpacts); } else if (!strcmp(port->type, "chassisredirect") && port->chassis == chassis) { const char *distributed_port = smap_get(&port->options, @@ -1812,9 +1811,7 @@ consider_mc_group(struct ovsdb_idl_index *sbrec_port_binding_by_name, distributed_port); if (distributed_binding && port->datapath == distributed_binding->datapath) { - put_load(distributed_binding->tunnel_key, MFF_LOG_OUTPORT, - 0, 32, &ofpacts); - put_resubmit(OFTABLE_CHECK_LOOPBACK, &ofpacts); + local_output_pb(distributed_binding->tunnel_key, &ofpacts); } } } else if (!get_localnet_port(local_datapaths, -- 2.36.1 _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev