diff mbox series

[ovs-dev,v4,1/2] controller: Recompute routes when the local datapaths change.

Message ID 20260806092600.3443597-2-gujun4990@outlook.com
State New
Headers show
Series controller: Avoid logical flow recompute on patch port changes. | expand

Checks

Context Check Description
ovsrobot/apply-robot warning apply and check: warning
ovsrobot/github-robot-_Build_and_Test success github build: passed
ovsrobot/github-robot-_ovn-kubernetes success github build: passed

Commit Message

Jun Gu Aug. 6, 2026, 9:25 a.m. UTC
route_runtime_data_handler() only requests a recompute for a tracked
datapath that already takes part in route exchange, or for a tracked
lport that is route-exchange relevant.  A datapath that has just become
local is neither, yet it contributes its router peer ports to the
local_datapath of every logical router it is attached to, and route_run()
walks exactly those peer ports to decide which routers take part in route
exchange.

So binding the first local port of a logical switch that is attached to a
dynamic-routing logical router leaves en_route unprocessed.  en_route is
the only input that makes en_route_exchange run, and en_route_exchange is
the only place that calls route_table_notify_update().  The netlink route
table watches therefore stay empty and routes learned from the VRF are
never reported in the Learned_Route table, with nothing in the log.

This is currently masked in most topologies: if the logical switch has a
localnet port, ovn-controller creates the peer OVS patch port when the
datapath becomes local, and the resulting ovs interface change is not
handled by binding_handle_ovs_interface_changes(), which recomputes
runtime_data and, transitively, en_route.  Dropping the localnet port
from the "dynamic-routing - BGP learned routes" system test is enough to
reproduce the failure on current main.

Request a recompute whenever a datapath is added to or removed from the
local datapaths.

Fixes: ccb0b6b9109c ("controller: Introduce route node.")
Assisted-by: Claude Opus 4.8, Claude Code
Signed-off-by: Jun Gu <gujun4990@outlook.com>
---
 controller/ovn-controller.c | 9 +++++++++
 1 file changed, 9 insertions(+)

Comments

0-day Robot Aug. 7, 2026, 6:03 p.m. UTC | #1
Bleep bloop.  Greetings Jun Gu, I am a robot and I have tried out your patch.
Thanks for your contribution.

I encountered some error that I wasn't expecting.  See the details below.


checkpatch:
WARNING: Comment with 'xxx' marker
#58 FILE: controller/ovn-controller.c:5419:
            /* XXX: Until we get I-P support for route exchange we need to

Lines checked: 69, Warnings: 1, Errors: 0


Please check this out.  If you feel there has been an error, please email aconole@redhat.com

Thanks,
0-day Robot
diff mbox series

Patch

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index ea9952a19..26bf756dd 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -5400,6 +5400,9 @@  route_runtime_data_handler(struct engine_node *node, void *data)
      * 2. A route-exchange relevant port went form local to remote or the
      *    other way round.
      * 3. A tracked_port went from local to remote or the other way round.
+     * 4. A datapath became local or stopped being local.  Such a datapath
+     *    contributes peer ports to the router datapaths it is connected to,
+     *    so it can make a router start or stop taking part in route exchange.
      * */
     struct tracked_datapath *t_dp;
     HMAP_FOR_EACH (t_dp, node, &rt_data->tracked_dp_bindings) {
@@ -5412,6 +5415,12 @@  route_runtime_data_handler(struct engine_node *node, void *data)
             return EN_UNHANDLED;
         }
 
+        if (t_dp->tracked_type != TRACKED_RESOURCE_UPDATED) {
+            /* XXX: Until we get I-P support for route exchange we need to
+             * request recompute. */
+            return EN_UNHANDLED;
+        }
+
         struct shash_node *shash_node;
         SHASH_FOR_EACH (shash_node, &t_dp->lports) {
             struct tracked_lport *lport = shash_node->data;