Skip to content

Commit

Permalink
northd: move snat_type out of vip loop
Browse files Browse the repository at this point in the history
Move snat_type out of vip loop in build_lrouter_lb_flows() since there
is no vip dependency.

Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Lorenzo Bianconi <lorenzo.bianconi@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
  • Loading branch information
LorenzoBianconi authored and numansiddique committed Jul 5, 2021
1 parent 27f2b08 commit df3320f
Showing 1 changed file with 5 additions and 9 deletions.
14 changes: 5 additions & 9 deletions northd/ovn-northd.c
Expand Up @@ -8867,10 +8867,13 @@ build_lrouter_lb_flows(struct hmap *lflows, struct ovn_datapath *od,
ovn_northd_lb_find(lbs, &nb_lb->header_.uuid);
ovs_assert(lb);

bool lb_skip_snat = smap_get_bool(&nb_lb->options, "skip_snat", false);
if (lb_skip_snat) {
enum lb_snat_type snat_type = NO_FORCE_SNAT;
if (smap_get_bool(&nb_lb->options, "skip_snat", false)) {
ovn_lflow_add(lflows, od, S_ROUTER_OUT_SNAT, 120,
"flags.skip_snat_for_lb == 1 && ip", "next;");
snat_type = SKIP_SNAT;
} else if (lb_force_snat_ip || od->lb_force_snat_router_ip) {
snat_type = FORCE_SNAT;
}

for (size_t j = 0; j < lb->n_vips; j++) {
Expand Down Expand Up @@ -8934,13 +8937,6 @@ build_lrouter_lb_flows(struct hmap *lflows, struct ovn_datapath *od,
ds_put_format(match, " && is_chassis_resident(%s)",
od->l3redirect_port->json_key);
}

enum lb_snat_type snat_type = NO_FORCE_SNAT;
if (lb_skip_snat) {
snat_type = SKIP_SNAT;
} else if (lb_force_snat_ip || od->lb_force_snat_router_ip) {
snat_type = FORCE_SNAT;
}
add_router_lb_flow(lflows, od, match, actions, prio,
snat_type, lb_vip, proto, nb_lb,
meter_groups, nat_entries);
Expand Down

0 comments on commit df3320f

Please sign in to comment.