[ovs-dev] [PATCH v7 5/6] [ovn-controller] Persist logical_datapaths

Ryan Moats rmoats at us.ibm.com
Fri Feb 19 17:25:11 UTC 2016


From: RYAN D. MOATS <rmoats at us.ibm.com>

Persist logical_datapaths across runs so that a change can be used
as a trigger to reset incremental flow processing.

Signed-off-by: RYAN D. MOATS <rmoats at us.ibm.com>
---
 ovn/controller/ovn-controller.c |   14 +-------------
 1 files changed, 1 insertions(+), 13 deletions(-)

diff --git a/ovn/controller/ovn-controller.c b/ovn/controller/ovn-controller.c
index 5a4174e..c34dce9 100644
--- a/ovn/controller/ovn-controller.c
+++ b/ovn/controller/ovn-controller.c
@@ -206,6 +206,7 @@ main(int argc, char *argv[])
     int retval;
 
     struct hmap flow_table = HMAP_INITIALIZER(&flow_table);
+    struct hmap local_datapaths = HMAP_INITIALIZER(&local_datapaths);
 
     ovs_cmdl_proctitle_init(argc, argv);
     set_program_name(argv[0]);
@@ -282,7 +283,6 @@ main(int argc, char *argv[])
 
         /* Contains bare "struct hmap_node"s whose hash values are the tunnel_key
          * of datapaths with at least one local port binding. */
-        struct hmap local_datapaths = HMAP_INITIALIZER(&local_datapaths);
 
         const struct ovsrec_bridge *br_int = get_br_int(&ctx);
         const char *chassis_id = get_chassis_id(ctx.ovs_idl);
@@ -309,18 +309,6 @@ main(int argc, char *argv[])
             ofctrl_put(&flow_table);
         }
 
-        /* local_datapaths contains bare hmap_node instances.
-         * We use this wrapper so that we can make use of
-         * HMAP_FOR_EACH_SAFE to tear down the hmap. */
-        struct {
-            struct hmap_node node;
-        } *cur_node, *next_node;
-        HMAP_FOR_EACH_SAFE (cur_node, next_node, node, &local_datapaths) {
-            hmap_remove(&local_datapaths, &cur_node->node);
-            free(cur_node);
-        }
-        hmap_destroy(&local_datapaths);
-
         unixctl_server_run(unixctl);
 
         unixctl_server_wait(unixctl);
-- 
1.7.1




More information about the dev mailing list