On 7/15/26 8:26 PM, Lucas Vargas Dias wrote:
> If logical router has more than one LRP as gateway router port
> and dynamic routing configured, dynamic-routing-port-name could be
> used to specify the LRP that will be used to dynamic routing.
> However, if all LRPs learning routes, routes from LRP without
> dynamic-routing-port-name must be flushed.
> This happens when LRPs are scheduled in the same chassis.
> 
> Signed-off-by: Lucas Vargas Dias <[email protected]>
> ---

Hi Lucas,

Thanks for this version and sorry for the delay in reviewing it.

>  controller/ovn-controller.c      |  15 ++++
>  controller/route-exchange.c      |  68 +++++++++++++--
>  controller/route-exchange.h      |   1 +
>  tests/multinode.at               | 142 +++++++++++++++++++++++++++++++
>  tests/ovn-inc-proc-graph-dump.at |   2 +
>  tests/system-ovn.at              | 133 +++++++++++++++++++++++++++++
>  6 files changed, 355 insertions(+), 6 deletions(-)
> 

[...]
> diff --git a/tests/system-ovn.at b/tests/system-ovn.at
> index 17b4dcb3d..8c31bd0c6 100644
> --- a/tests/system-ovn.at
> +++ b/tests/system-ovn.at
> @@ -21998,3 +21998,136 @@ OVS_TRAFFIC_VSWITCHD_STOP(["/failed to query port 
> patch-.*/d
>  
>  AT_CLEANUP
>  ])
> +
> +OVN_FOR_EACH_NORTHD([
> +AT_SETUP([dynamic-routing - BGP learned routes with router filter name and 
> multiple DGPs])
> +
> +# This test validates that BGP learned routes work correctly:
> +# 1. Routes added to the VRF appear in Learned_Route table
> +# 2. Remove routes learned in LRPs in same hypervisor when configure 
> dynamic-routing-port-name
> +# 3. Keep learned route just in LRP with dynamic-routing-port-name 
> configured.
> +#
> +# Topology:
> +#    +---------+
> +#    | public  |
> +#    +----+----+
> +#         |
> +#    +----+---+     +---------------+
> +#    | lr-frr |-----| lrp-dgp-dummy | (dynamic-routing-port-name NOT 
> configured (hv1))
> +#    +----+---+     +---------------+
> +#         |
> +#  +------+-----------+
> +#  |lrp-local-bgp-port| (dynamic-routing-port-name configured (hv1))
> +#  +------------------+
> +
> +ovn_start
> +OVS_TRAFFIC_VSWITCHD_START()
> +ADD_BR([br-int])
> +ADD_BR([br-ex])
> +
> +check ovs-ofctl add-flow br-ex action=normal
> +
> +# Set external-ids in br-int needed for ovn-controller
> +check ovs-vsctl \
> +    -- set Open_vSwitch . external-ids:system-id=hv1 \
> +    -- set Open_vSwitch . 
> external-ids:ovn-remote=unix:$ovs_base/ovn-sb/ovn-sb.sock \
> +    -- set Open_vSwitch . external-ids:ovn-encap-type=geneve \
> +    -- set Open_vSwitch . external-ids:ovn-encap-ip=169.0.0.1 \
> +    -- set bridge br-int fail-mode=secure other-config:disable-in-band=true
> +
> +# Configure bridge mappings for localnet.
> +check ovs-vsctl set Open_vSwitch . 
> external-ids:ovn-bridge-mappings=phys:br-ex
> +
> +vrf=10
> +VRF_RESERVE([$vrf])
> +
> +# Start ovn-controller.
> +start_daemon ovn-controller
> +
> +check ip link add vrf-$vrf type vrf table $vrf
> +on_exit "ip link del vrf-$vrf"
> +check ip link set vrf-$vrf up
> +
> +# Create public logical switch with localnet port.
> +check ovn-nbctl ls-add public
> +check ovn-nbctl lsp-add-localnet-port public ln_port phys
> +
> +# Create lr-frr with dynamic routing in VRF $vrf.
> +check ovn-nbctl lr-add lr-frr \
> +    -- set Logical_Router lr-frr \
> +        options:dynamic-routing=true \
> +        options:dynamic-routing-vrf-id=$vrf \
> +        options:dynamic-routing-redistribute=static
> +
> +check ovn-nbctl lrp-add lr-frr lrp-local-bgp-port 00:00:00:00:00:03 
> 20.0.0.3/24 \
> +    -- set Logical_Router_Port lrp-local-bgp-port 
> options:dynamic-routing-maintain-vrf=false \
> +    -- set Logical_Router_Port lrp-local-bgp-port 
> options:routing-protocol-redirect=local-bgp-port
> +
> +check ovn-nbctl lrp-set-gateway-chassis lrp-local-bgp-port hv1
> +check ovn-nbctl lsp-add-router-port public public-lr-frr lrp-local-bgp-port
> +
> +check ovn-nbctl lrp-add lr-frr lrp-dgp-dummy 00:00:00:00:00:04 20.0.1.3/24
> +check ovn-nbctl lrp-set-gateway-chassis lrp-dgp-dummy hv1
> +check ovn-nbctl ls-add ls-dummy
> +check ovn-nbctl lsp-add-router-port ls-dummy lsp-dummy lrp-dgp-dummy
> +
> +# Create local-bgp-port in VRF 10.
> +check ovs-vsctl add-port br-int local-bgp-port \
> +    -- set Interface local-bgp-port type=internal \
> +    -- set Interface local-bgp-port external_ids:iface-id=local-bgp-port
> +
> +check ovn-nbctl lsp-add public local-bgp-port \
> +    -- lsp-set-addresses local-bgp-port unknown
> +
> +# Configure local-bgp-port interface and add to VRF.
> +check ip link set local-bgp-port master vrf-$vrf
> +check ip link set local-bgp-port address 00:00:00:00:00:03
> +check ip addr add dev local-bgp-port 20.0.0.3/24
> +check ip link set local-bgp-port up
> +
> +# Wait for everything to be ready.
> +wait_for_ports_up
> +check ovn-nbctl --wait=hv sync
> +
> +# Check lrp-local-bgp-port has dynamic-routing option set.
> +check_row_count Port_Binding 1 logical_port=cr-lrp-local-bgp-port 
> 'options:dynamic-routing=true'
> +check_row_count Port_Binding 1 logical_port=cr-lrp-dgp-dummy 
> 'options:dynamic-routing=true'
> +
> +# Add static routes.
> +check ovn-nbctl lr-route-add lr-frr 10.10.2.1 20.0.0.42 lrp-local-bgp-port
> +
> +# Verify advertised routes exist.
> +AS_BOX([Advertised_Route])
> +wait_row_count Advertised_Route 1 ip_prefix=10.10.2.1
> +
> +# Add a route to the VRF (simulating BGP learning a route).
> +check ip route add 10.10.3.1 via 20.0.0.25 vrf vrf-$vrf proto zebra
> +
> +# Verify learned route appears in SB database.
> +check_row_count Learned_Route 2 ip_prefix=10.10.3.1

This is racy, there's no guarantee ovn-controller had a chance to run.
Let's use wait_row_count instead.

I took care of that and applied the patch to main and 26.03.

There are some conflicts when trying to cherry pick this to 25.09.  In
theory we could backport it there too because that branch is still
supported and this is a bug fix.  If you need it there, could you please
post a 25.09 specific backport patch?

Regards,
Dumitru

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

Reply via email to