[ovs-dev] [PATCH ovn] ovn-controller: Handle changes in requested-tnl-key

Mark Gray mark.d.gray at redhat.com
Fri Sep 11 15:26:48 UTC 2020

runtime_data_sb_datapath_binding_handler() only handles deletion of rows
in the Datapath_Binding table in OVN-SB. The user can update the
requested-tnl-key by the following command:

ovn-nbctl set logical_switch sw0 other_config:requested-tnl-key=<key>

This command modifies the tunnel_key column. This patch
ensures that an update of this column is handled by the
incremental processing engine by forcing a recompute
of the runtime_data node.

As it is expected that changing the requested-tnl-key is not updated
frequently, we do not attempt to make this update incrementally.

Signed-off-by: Mark Gray <mark.d.gray at redhat.com>
 controller/ovn-controller.c | 16 ++++++++++++++--
 1 file changed, 14 insertions(+), 2 deletions(-)

diff --git a/controller/ovn-controller.c b/controller/ovn-controller.c
index 995805470..106f8eae1 100644
--- a/controller/ovn-controller.c
+++ b/controller/ovn-controller.c
@@ -1362,8 +1362,8 @@ runtime_data_sb_port_binding_handler(struct
engine_node *node, void *data)
  static bool
-runtime_data_sb_datapath_binding_handler(struct engine_node *node
-                                         void *data OVS_UNUSED)
+runtime_data_sb_datapath_binding_handler(struct engine_node *node,
+                                         void *data)
     struct sbrec_datapath_binding_table *dp_table =
         (struct sbrec_datapath_binding_table *)EN_OVSDB_GET(
@@ -1378,6 +1378,18 @@ runtime_data_sb_datapath_binding_handler(struct
engine_node *node OVS_UNUSED,
                 return false;
+        /* Force recompute when the tunnel_key is updated. However,
+           don't update if the external_id column is updated as this
+           can be done when a logical switch or logical router is
+           added which does not recquire a recompute.
+        */
+        if (sbrec_datapath_binding_is_updated(dp,
+            !sbrec_datapath_binding_is_updated(dp,
+            return false;
+        }
      return true;

More information about the dev mailing list