Skip to content

Commit

Permalink
northd: Don't add lr_out_delivery default drop flow for each lrp.
Browse files Browse the repository at this point in the history
The default drop flow in lr_out_delivery stage is generated
for every router port of a logical router.  This results in the
lflow_table_add_lflow() to be called multiple times for the
same match and actions and the ovn_lflow to have multiple
dp_refcnts.  Fix this by generating this lflow only once for
each router.

Fixes: 27a92cc ("northd: make default drops explicit")
Acked-by: Han Zhou <hzhou@ovn.org>
Acked-by: Dumitru Ceara <dceara@redhat.com>
Signed-off-by: Numan Siddique <numans@ovn.org>
(cherry picked from commit ada1508)
  • Loading branch information
numansiddique committed Feb 14, 2024
1 parent 3e80bd1 commit 5263889
Showing 1 changed file with 8 additions and 6 deletions.
14 changes: 8 additions & 6 deletions northd/northd.c
Original file line number Diff line number Diff line change
Expand Up @@ -13470,9 +13470,6 @@ build_egress_delivery_flows_for_lrouter_port(
ds_put_format(match, "outport == %s", op->json_key);
ovn_lflow_add(lflows, op->od, S_ROUTER_OUT_DELIVERY, 100,
ds_cstr(match), "output;", lflow_ref);

ovn_lflow_add_default_drop(lflows, op->od, S_ROUTER_OUT_DELIVERY,
lflow_ref);
}

static void
Expand Down Expand Up @@ -14838,9 +14835,9 @@ lrouter_check_nat_entry(const struct ovn_datapath *od,
}

/* NAT, Defrag and load balancing. */
static void build_lr_nat_defrag_and_lb_default_flows(struct ovn_datapath *od,
struct lflow_table *lflows,
struct lflow_ref *lflow_ref)
static void build_lr_nat_defrag_and_lb_default_flows(
struct ovn_datapath *od, struct lflow_table *lflows,
struct lflow_ref *lflow_ref)
{
ovs_assert(od->nbr);

Expand Down Expand Up @@ -15592,6 +15589,11 @@ build_lswitch_and_lrouter_iterate_by_lr(struct ovn_datapath *od,

build_lr_nat_defrag_and_lb_default_flows(od, lsi->lflows, NULL);
build_lrouter_lb_affinity_default_flows(od, lsi->lflows, NULL);

/* Default drop rule in lr_out_delivery stage. See
* build_egress_delivery_flows_for_lrouter_port() which adds a rule
* for each router port. */
ovn_lflow_add_default_drop(lsi->lflows, od, S_ROUTER_OUT_DELIVERY, NULL);
}

/* Helper function to combine all lflow generation which is iterated by logical
Expand Down

0 comments on commit 5263889

Please sign in to comment.