Skip to content

Commit

Permalink
northd: Don't generate IPv6 prefix delegation flows if not configured.
Browse files Browse the repository at this point in the history
If the feature is not enabled, there is no need to create extra
logical flows per network for each router port.  These flows match on
exact IPv6 addresses and UDP ports contributing to increased number of
datapath flows generated in OVS on the nodes.  This turns into exact
matches in most cases potentially causing datapath flow explosion for
the traffic entering OVN network from multiple sources.

Flows removed from unrelated tests as a result.

Fixes: 5c1d2d2 ("northd: Add logical flows for dhcpv6 pfd parsing")
Reported-at: https://issues.redhat.com/browse/FDP-992
Signed-off-by: Ilya Maximets <i.maximets@ovn.org>
Acked-by: Ales Musil <amusil@redhat.com>
Signed-off-by: Dumitru Ceara <dceara@redhat.com>
(cherry picked from commit 3e177f7)
  • Loading branch information
igsilya authored and dceara committed Nov 21, 2024
1 parent 120ba7d commit 81ef857
Show file tree
Hide file tree
Showing 2 changed files with 7 additions and 3 deletions.
9 changes: 6 additions & 3 deletions northd/northd.c
Original file line number Diff line number Diff line change
Expand Up @@ -2196,6 +2196,9 @@ join_logical_ports(const struct sbrec_port_binding_table *sbrec_pb_table,
op->lrp_networks = lrp_networks;
op->od = od;

op->prefix_delegation = smap_get_bool(&op->nbrp->options,
"prefix_delegation", false);

for (size_t j = 0; j < op->lrp_networks.n_ipv4_addrs; j++) {
sset_add(&op->od->router_ips,
op->lrp_networks.ipv4_addrs[j].addr_s);
Expand Down Expand Up @@ -6610,8 +6613,8 @@ ovn_update_ipv6_opt_for_op(struct ovn_port *op)
smap_clone(&options, &op->sb->options);

/* enable IPv6 prefix delegation */
bool prefix_delegation = smap_get_bool(&op->nbrp->options,
"prefix_delegation", false);
bool prefix_delegation = op->prefix_delegation;

if (!lrport_is_enabled(op->nbrp)) {
prefix_delegation = false;
}
Expand Down Expand Up @@ -13675,7 +13678,7 @@ build_dhcpv6_reply_flows_for_lrouter_port(
struct lflow_ref *lflow_ref)
{
ovs_assert(op->nbrp);
if (op->l3dgw_port) {
if (!op->prefix_delegation || op->l3dgw_port) {
return;
}
for (size_t i = 0; i < op->lrp_networks.n_ipv6_addrs; i++) {
Expand Down
1 change: 1 addition & 0 deletions northd/northd.h
Original file line number Diff line number Diff line change
Expand Up @@ -573,6 +573,7 @@ struct ovn_port {
const struct nbrec_logical_router_port *nbrp; /* May be NULL. */

struct lport_addresses lrp_networks;
bool prefix_delegation; /* True if IPv6 prefix delegation enabled. */

/* Logical port multicast data. */
struct mcast_port_info mcast_info;
Expand Down

0 comments on commit 81ef857

Please sign in to comment.