Cited commit stopped adding gateway router datapaths to local_datapaths
on non-gateway chassis.  As a side effect, the l3gateway router port
binding configured with 'ipv6_ra_send_periodic' is no longer visible in
the IDL cache on non-gateway chassis when ovn-monitor-all is disabled.

Those chassis cannot generate periodic RAs for their local VIFs.

We need to always monitor ports with 'ipv6_ra_send_periodic=true', so
they are visible to all chassis regardless of whether the router
datapath is local.  This shouldn't have a big performance impact as
the router datapath is still not local, we just have a few more port
bindings sent to ovn-controller from the database.

VIFs get duplicate RAs (locally generated + from other nodes via the
localnet) and it's hard to distinguish them in the test.  So, in order
to properly test the local-only RA generation we need to split the
localnet network into two disjoint segments.  This way there is no
duplication and we can definitively say if RAs are properly generated
by both chassis.

This test topology represents a localnet with two segments that do not
route RAs between each other, which may be the case in practice as
our current documentation says that there should be L3 routing between
segments of the same localnet, but RAs are not supposed to be routable.

Note, however, that we're currently sending duplicate RAs from both
nodes into the physical network, i.e., RAs are sent out to localnet
on both chassis.  This is a separate unrelated issue that will be
addressed in the next commit.

Fixes: 5ad811ce4008 ("controller: Optimize adding 'dps' to the local 
datapaths.")
Assisted-by: claude-opus-4.6, OpenCode
Signed-off-by: Ilya Maximets <[email protected]>
---
 controller/ovn-controller.c |  7 +++++++
 tests/ovn.at                | 25 +++++++++++++++++--------
 2 files changed, 24 insertions(+), 8 deletions(-)

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index 552e87b53..5f63c5fec 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -327,6 +327,13 @@ update_sb_monitors(struct ovsdb_idl *ovnsb_idl,
         const struct smap l3 = SMAP_CONST1(&l3, "l3gateway-chassis", id);
         sbrec_port_binding_add_clause_options(&pb, OVSDB_F_INCLUDES, &l3);
 
+        /* Also monitor ports with periodic RA enabled so that all chassis
+         * can generate RAs for their local VIFs, even when the port is an
+         * l3gateway bound to a different chassis. */
+        const struct smap ra =
+            SMAP_CONST1(&ra, "ipv6_ra_send_periodic", "true");
+        sbrec_port_binding_add_clause_options(&pb, OVSDB_F_INCLUDES, &ra);
+
         sbrec_controller_event_add_clause_chassis(&ce, OVSDB_F_EQ,
                                                   &chassis->header_.uuid);
         sbrec_igmp_group_add_clause_chassis(&igmp, OVSDB_F_EQ,
diff --git a/tests/ovn.at b/tests/ovn.at
index b70236c68..4f8037576 100644
--- a/tests/ovn.at
+++ b/tests/ovn.at
@@ -18052,16 +18052,25 @@ CHECK_SCAPY
 ovn_start
 
 net_add n1
+# Separate localnet networks per chassis.
+net_add n-phys1
+net_add n-phys2
+
 sim_add hv1
-sim_add hv2
 as hv1
 check ovs-vsctl add-br br-phys
-check ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys:br-phys
 ovn_attach n1 br-phys 192.168.0.2
+check ovs-vsctl add-br br-ln
+check ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys1:br-ln
+net_attach n-phys1 br-ln
+
+sim_add hv2
 as hv2
 check ovs-vsctl add-br br-phys
-check ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys:br-phys
 ovn_attach n1 br-phys 192.168.0.3
+check ovs-vsctl add-br br-ln
+check ovs-vsctl set open . external-ids:ovn-bridge-mappings=phys2:br-ln
+net_attach n-phys2 br-ln
 
 check ovn-nbctl lr-add ro
 check ovn-nbctl lrp-add ro ro-sw 00:00:00:00:00:01
@@ -18073,7 +18082,9 @@ check ovn-nbctl lrp-set-gateway-chassis ro-sw hv1
 ])
 
 check ovn-nbctl ls-add sw
-check ovn-nbctl lsp-add-localnet-port sw ln phys
+# Two localnet ports, each mapped to a different physical network.
+check ovn-nbctl lsp-add-localnet-port sw ln1 phys1
+check ovn-nbctl lsp-add-localnet-port sw ln2 phys2
 
 check ovn-nbctl lsp-add-router-port sw sw-ro ro-sw
 check ovn-nbctl lsp-add sw sw-p1
@@ -18147,11 +18158,9 @@ ra_test() {
     rm -f expected
 }
 
-# Check that RAs are sent to vifs.
+# Check that RAs are sent to VIFs and localnet ports.
 ra_test vif1
-
-# Check that RAs are received on br-phys.
-ra_test br-phys
+ra_test br-ln
 
 OVN_CLEANUP([hv1],[hv2])
 AT_CLEANUP
-- 
2.54.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to