Skip to content

Commit 721fbde

Browse files
simonartxavieralmusil
authored andcommitted
ovn-ic: Do not try to advertise auto-generated lla next_hops.
Since [1] we do not learn routes with auto-generated link-local next-hops. However, routes with auto-generated lla next hops were still created and deleted from ovn-ic-sb, causing high cpu usage on ovn-ic and ovn-ic-sb, as well as high traffic between AZs and ovn-ic-sb. Fix this by skipping route advertisement when the derived next-hop is an EUI-64 LLA (i.e. fe80::/64). Non-EUI-64 link-local addresses (e.g. fe80:10::1/64), are intentionally left unfiltered and continue to be advertised and learned normally. [1] cb0e2b3 ("ovn-ic: do not learn routes with link-local next-hops") Reported-at: https://issues.redhat.com/browse/FDP-2000 Assisted-by: Claude Sonnet 4.6, OpenCode Signed-off-by: Xavier Simonart <xsimonar@redhat.com> Signed-off-by: Ales Musil <amusil@redhat.com> (cherry picked from commit 82ba408)
1 parent 6369b07 commit 721fbde

2 files changed

Lines changed: 93 additions & 4 deletions

File tree

ic/ovn-ic.c

Lines changed: 2 additions & 4 deletions
Original file line numberDiff line numberDiff line change
@@ -1429,9 +1429,7 @@ get_nexthop_from_lport_addresses(bool is_v4,
14291429
return true;
14301430
}
14311431

1432-
/* ipv6 link local */
1433-
in6_generate_lla(laddr->ea, nexthop);
1434-
return true;
1432+
return false;
14351433
}
14361434

14371435
static bool
@@ -1758,7 +1756,7 @@ add_lb_vip_to_routes_ad(struct hmap *routes_ad, const char *vip_key,
17581756
if (!get_nexthop_from_lport_addresses(IN6_IS_ADDR_V4MAPPED(&vip_ip),
17591757
nexthop_addresses,
17601758
&nexthop)) {
1761-
VLOG_WARN_RL(&rl, "Route ad: failed to get nexthop for lb vip");
1759+
VLOG_DBG("Route ad: failed to get nexthop for lb vip %s", vip_key);
17621760
goto out;
17631761
}
17641762

tests/ovn-ic.at

Lines changed: 91 additions & 0 deletions
Original file line numberDiff line numberDiff line change
@@ -4700,7 +4700,98 @@ OVS_WAIT_FOR_OUTPUT([ovn_as az1 ovn-nbctl lr-route-list lr11 | grep 192.168 |
47004700
])
47014701

47024702
OVN_CLEANUP_IC([az1], [az2])
4703+
AT_CLEANUP
4704+
])
4705+
4706+
OVN_FOR_EACH_NORTHD([
4707+
AT_SETUP([interconnection - LLA])
4708+
AT_KEYWORDS([LLA])
4709+
# Logical network:
4710+
#┌──────────────────────────────────────────────────┬────────────────────────────────────────────────────┐
4711+
#│ AZ1 │ AZ2 │
4712+
#├──────────────────────────────────────────────────┼────────────────────────────────────────────────────┤
4713+
#│ LS11-LR11 (fd11::254) - LR11 - (2001:db8::1) ── TS1 ── (2001:db8::2) - LR12 - (fd12::254) - LR12-LS12 │
4714+
#│ LS21-LR21 (fd21::254) - LR21 - (fe80:10::1) ─────┼──── (fe80:10::2) - LR22 - (fd22::254) - LR22-LS22 │
4715+
#└──────────────────────────────────────────────────┴────────────────────────────────────────────────────┘
4716+
# LR11/LR12: trigger nexthop filtering: they have a global IPv6 address on the TS port that gets removed,
4717+
# causing their stub subnet (fd1x::/64), static route (fd99::/64), and lb vip (fd31::100)
4718+
# to have no valid nexthop and not be advertised to IC-SB.
4719+
# LR21/LR22: verify non-EUI-64 LLA nexthops (fe80:10::x) work correctly; their subnets (fd2x::/64) are advertised and learned.
4720+
4721+
ovn_init_ic_db
4722+
net_add n1
4723+
4724+
for i in 1 2; do
4725+
ovn_start az$i
4726+
sim_add hv$i
4727+
as hv$i
4728+
check ovs-vsctl add-br br-phys
4729+
ovn_az_attach az$i n1 br-phys 192.168.$i.1 16
4730+
ovn_as az$i
4731+
check ovs-vsctl set open . external-ids:ovn-is-interconn=true
4732+
check ovn-nbctl set nb_global . options:ic-route-learn=true
4733+
check ovn-nbctl set nb_global . options:ic-route-learn-lb=true
4734+
check ovn-nbctl set nb_global . options:ic-route-adv=true
4735+
check ovn-nbctl set nb_global . options:ic-route-adv-lb=true
4736+
done
4737+
4738+
check ovn-ic-nbctl ts-add ts1
4739+
check ovn_as az1 ovn-nbctl wait-until logical_switch ts1
4740+
check ovn_as az2 ovn-nbctl wait-until logical_switch ts1
4741+
4742+
for i in 1 2; do
4743+
ovn_as az$i
4744+
check ovn-nbctl lr-add lr1$i \
4745+
-- lrp-add lr1$i lr1$i-ts1 00:aa:aa:aa:aa:1$i 2001:db8::$i/64 \
4746+
-- lrp-add lr1$i lr1$i-ls1$i 00:00:00:00:0$i:fe fd1$i::254/64 \
4747+
-- lsp-add-router-port ts1 ts1-lr1$i lr1$i-ts1
4748+
check ovn-nbctl lr-add lr2$i \
4749+
-- lrp-add lr2$i lr2$i-ts1 aa:aa:aa:aa:aa:2$i fe80:10::$i/64 \
4750+
-- lsp-add-router-port ts1 ts1-lr2$i lr2$i-ts1
4751+
4752+
check ovn-nbctl --wait=sb lrp-add lr2$i lr2$i-ls2$i 00:00:00:00:0$i:0$i fd2$i::254/64
4753+
4754+
done
4755+
4756+
wait_for_ports_up
4757+
check ovn-ic-nbctl --wait=sb sync
4758+
check ovn_as az1 ovn-nbctl --wait=hv sync
4759+
check ovn_as az2 ovn-nbctl --wait=hv sync
4760+
4761+
# Non-EUI-64 LLA nexthops must be advertised to IC-SB and learned normally.
4762+
OVS_WAIT_UNTIL([ovn_as az1 ovn-nbctl lr-route-list lr21 | grep learned | \
4763+
grep fd22::])
4764+
AT_CHECK([ovn_as az1 ovn-nbctl lr-route-list lr21 | awk '/learned/{print $1, $2}'], [0], [dnl
4765+
fd22::/64 fe80:10::2
4766+
])
4767+
OVS_WAIT_UNTIL([ovn_as az2 ovn-nbctl lr-route-list lr22 | grep learned | \
4768+
grep fd21::])
4769+
AT_CHECK([ovn_as az2 ovn-nbctl lr-route-list lr22 | awk '/learned/{print $1, $2}'], [0], [dnl
4770+
fd21::/64 fe80:10::1
4771+
])
4772+
4773+
check ovn_as az1 ovn-nbctl remove logical_router_port lr11-ts1 networks "2001\:db8\:\:1/64"
47034774

4775+
check ovn_as az1 ovn-nbctl lr-route-add lr11 fd99::/64 2001:db8::2
4776+
4777+
check ovn_as az1 ovn-nbctl lb-add lb_v6 [[fd31::100]]:80 "[[fd31::1]]:80"
4778+
check ovn_as az1 ovn-nbctl lr-lb-add lr11 lb_v6
4779+
4780+
check ovn-ic-nbctl --wait=sb sync
4781+
4782+
# ic-sb route should not contain lla next hops.
4783+
# Such routes used to be created and deleted in ic-sb.
4784+
# Do not use OVS_WAIT_WHILE or WAIT_UNTIL as the wrong (lla) route appears and disappears.
4785+
for i in $(seq 1 50); do
4786+
AT_CHECK([ovn-ic-sbctl list route | grep "fe80:" | sort], [0], [dnl
4787+
nexthop : "fe80:10::1"
4788+
nexthop : "fe80:10::2"
4789+
])
4790+
done
4791+
4792+
OVN_CLEANUP_SBOX([hv1])
4793+
OVN_CLEANUP_SBOX([hv2])
4794+
OVN_CLEANUP_IC([az1], [az2])
47044795
AT_CLEANUP
47054796
])
47064797

0 commit comments

Comments
 (0)