ovn: Adopt consistent naming, by renaming "Bindings" to "Binding".
authorBen Pfaff <blp@nicira.com>
Thu, 7 May 2015 23:09:41 +0000 (16:09 -0700)
committerBen Pfaff <blp@nicira.com>
Thu, 7 May 2015 23:29:46 +0000 (16:29 -0700)
The convention in OVSDB is to use singular names for database tables,
but Bindings was plural.

Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Justin Pettit <jpettit@nicira.com>
13 files changed:
ovn/controller/automake.mk
ovn/controller/binding.c [new file with mode: 0644]
ovn/controller/binding.h [new file with mode: 0644]
ovn/controller/bindings.c [deleted file]
ovn/controller/bindings.h [deleted file]
ovn/controller/ovn-controller.c
ovn/controller/physical.c
ovn/controller/pipeline.c
ovn/northd/ovn-northd.c
ovn/ovn-architecture.7.xml
ovn/ovn-nb.xml
ovn/ovn-sb.ovsschema
ovn/ovn-sb.xml

index 01bb287..12a3606 100644 (file)
@@ -1,7 +1,7 @@
 bin_PROGRAMS += ovn/controller/ovn-controller
 ovn_controller_ovn_controller_SOURCES = \
-       ovn/controller/bindings.c \
-       ovn/controller/bindings.h \
+       ovn/controller/binding.c \
+       ovn/controller/binding.h \
        ovn/controller/chassis.c \
        ovn/controller/chassis.h \
        ovn/controller/ofctrl.c \
diff --git a/ovn/controller/binding.c b/ovn/controller/binding.c
new file mode 100644 (file)
index 0000000..ab6d9f9
--- /dev/null
@@ -0,0 +1,156 @@
+/* Copyright (c) 2015 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+#include <config.h>
+#include "binding.h"
+
+#include "lib/sset.h"
+#include "lib/util.h"
+#include "lib/vswitch-idl.h"
+#include "openvswitch/vlog.h"
+#include "ovn/lib/ovn-sb-idl.h"
+#include "ovn-controller.h"
+
+VLOG_DEFINE_THIS_MODULE(binding);
+
+void
+binding_init(struct controller_ctx *ctx)
+{
+    ovsdb_idl_add_table(ctx->ovs_idl, &ovsrec_table_open_vswitch);
+    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_open_vswitch_col_bridges);
+
+    ovsdb_idl_add_table(ctx->ovs_idl, &ovsrec_table_bridge);
+    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_bridge_col_name);
+    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_bridge_col_ports);
+
+    ovsdb_idl_add_table(ctx->ovs_idl, &ovsrec_table_port);
+    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_port_col_name);
+    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_port_col_interfaces);
+
+    ovsdb_idl_add_table(ctx->ovs_idl, &ovsrec_table_interface);
+    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_interface_col_name);
+    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_interface_col_external_ids);
+}
+
+static void
+get_local_iface_ids(struct controller_ctx *ctx, struct sset *lports)
+{
+    int i;
+
+    for (i = 0; i < ctx->br_int->n_ports; i++) {
+        const struct ovsrec_port *port_rec = ctx->br_int->ports[i];
+        const char *iface_id;
+        int j;
+
+        if (!strcmp(port_rec->name, ctx->br_int_name)) {
+            continue;
+        }
+
+        for (j = 0; j < port_rec->n_interfaces; j++) {
+            const struct ovsrec_interface *iface_rec;
+
+            iface_rec = port_rec->interfaces[j];
+            iface_id = smap_get(&iface_rec->external_ids, "iface-id");
+            if (!iface_id) {
+                continue;
+            }
+            sset_add(lports, iface_id);
+        }
+    }
+}
+
+void
+binding_run(struct controller_ctx *ctx)
+{
+    const struct sbrec_binding *binding_rec;
+    struct ovsdb_idl_txn *txn;
+    struct sset lports, all_lports;
+    const char *name;
+    int retval;
+
+    sset_init(&lports);
+    sset_init(&all_lports);
+    get_local_iface_ids(ctx, &lports);
+    sset_clone(&all_lports, &lports);
+
+    txn = ovsdb_idl_txn_create(ctx->ovnsb_idl);
+    ovsdb_idl_txn_add_comment(txn,
+                              "ovn-controller: updating bindings for '%s'",
+                              ctx->chassis_id);
+
+    SBREC_BINDING_FOR_EACH(binding_rec, ctx->ovnsb_idl) {
+        if (sset_find_and_delete(&lports, binding_rec->logical_port) ||
+                (binding_rec->parent_port && binding_rec->parent_port[0] &&
+                 sset_contains(&all_lports, binding_rec->parent_port))) {
+            if (!strcmp(binding_rec->chassis, ctx->chassis_id)) {
+                continue;
+            }
+            if (binding_rec->chassis[0]) {
+                VLOG_INFO("Changing chassis for lport %s from %s to %s",
+                          binding_rec->logical_port, binding_rec->chassis,
+                          ctx->chassis_id);
+            }
+            sbrec_binding_set_chassis(binding_rec, ctx->chassis_id);
+        } else if (!strcmp(binding_rec->chassis, ctx->chassis_id)) {
+            sbrec_binding_set_chassis(binding_rec, "");
+        }
+    }
+
+    retval = ovsdb_idl_txn_commit_block(txn);
+    if (retval == TXN_ERROR) {
+        VLOG_INFO("Problem committing binding information: %s",
+                  ovsdb_idl_txn_status_to_string(retval));
+    }
+
+    ovsdb_idl_txn_destroy(txn);
+
+    SSET_FOR_EACH (name, &lports) {
+        VLOG_DBG("No binding record for lport %s", name);
+    }
+    sset_destroy(&lports);
+    sset_destroy(&all_lports);
+}
+
+void
+binding_destroy(struct controller_ctx *ctx)
+{
+    int retval = TXN_TRY_AGAIN;
+
+    ovs_assert(ctx->ovnsb_idl);
+
+    while (retval != TXN_SUCCESS && retval != TXN_UNCHANGED) {
+        const struct sbrec_binding *binding_rec;
+        struct ovsdb_idl_txn *txn;
+
+        txn = ovsdb_idl_txn_create(ctx->ovnsb_idl);
+        ovsdb_idl_txn_add_comment(txn,
+                              "ovn-controller: removing all bindings for '%s'",
+                              ctx->chassis_id);
+
+        SBREC_BINDING_FOR_EACH(binding_rec, ctx->ovnsb_idl) {
+            if (!strcmp(binding_rec->chassis, ctx->chassis_id)) {
+                sbrec_binding_set_chassis(binding_rec, "");
+            }
+        }
+
+        retval = ovsdb_idl_txn_commit_block(txn);
+        if (retval == TXN_ERROR) {
+            VLOG_INFO("Problem removing bindings: %s",
+                      ovsdb_idl_txn_status_to_string(retval));
+        }
+
+        ovsdb_idl_txn_destroy(txn);
+    }
+}
diff --git a/ovn/controller/binding.h b/ovn/controller/binding.h
new file mode 100644 (file)
index 0000000..2611173
--- /dev/null
@@ -0,0 +1,26 @@
+/* Copyright (c) 2015 Nicira, Inc.
+ *
+ * Licensed under the Apache License, Version 2.0 (the "License");
+ * you may not use this file except in compliance with the License.
+ * You may obtain a copy of the License at:
+ *
+ *     http://www.apache.org/licenses/LICENSE-2.0
+ *
+ * Unless required by applicable law or agreed to in writing, software
+ * distributed under the License is distributed on an "AS IS" BASIS,
+ * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
+ * See the License for the specific language governing permissions and
+ * limitations under the License.
+ */
+
+
+#ifndef OVN_BINDING_H
+#define OVN_BINDING_H 1
+
+struct controller_ctx;
+
+void binding_init(struct controller_ctx *);
+void binding_run(struct controller_ctx *);
+void binding_destroy(struct controller_ctx *);
+
+#endif /* ovn/binding.h */
diff --git a/ovn/controller/bindings.c b/ovn/controller/bindings.c
deleted file mode 100644 (file)
index e5b4827..0000000
+++ /dev/null
@@ -1,156 +0,0 @@
-/* Copyright (c) 2015 Nicira, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-#include <config.h>
-#include "bindings.h"
-
-#include "lib/sset.h"
-#include "lib/util.h"
-#include "lib/vswitch-idl.h"
-#include "openvswitch/vlog.h"
-#include "ovn/lib/ovn-sb-idl.h"
-#include "ovn-controller.h"
-
-VLOG_DEFINE_THIS_MODULE(bindings);
-
-void
-bindings_init(struct controller_ctx *ctx)
-{
-    ovsdb_idl_add_table(ctx->ovs_idl, &ovsrec_table_open_vswitch);
-    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_open_vswitch_col_bridges);
-
-    ovsdb_idl_add_table(ctx->ovs_idl, &ovsrec_table_bridge);
-    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_bridge_col_name);
-    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_bridge_col_ports);
-
-    ovsdb_idl_add_table(ctx->ovs_idl, &ovsrec_table_port);
-    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_port_col_name);
-    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_port_col_interfaces);
-
-    ovsdb_idl_add_table(ctx->ovs_idl, &ovsrec_table_interface);
-    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_interface_col_name);
-    ovsdb_idl_add_column(ctx->ovs_idl, &ovsrec_interface_col_external_ids);
-}
-
-static void
-get_local_iface_ids(struct controller_ctx *ctx, struct sset *lports)
-{
-    int i;
-
-    for (i = 0; i < ctx->br_int->n_ports; i++) {
-        const struct ovsrec_port *port_rec = ctx->br_int->ports[i];
-        const char *iface_id;
-        int j;
-
-        if (!strcmp(port_rec->name, ctx->br_int_name)) {
-            continue;
-        }
-
-        for (j = 0; j < port_rec->n_interfaces; j++) {
-            const struct ovsrec_interface *iface_rec;
-
-            iface_rec = port_rec->interfaces[j];
-            iface_id = smap_get(&iface_rec->external_ids, "iface-id");
-            if (!iface_id) {
-                continue;
-            }
-            sset_add(lports, iface_id);
-        }
-    }
-}
-
-void
-bindings_run(struct controller_ctx *ctx)
-{
-    const struct sbrec_bindings *bindings_rec;
-    struct ovsdb_idl_txn *txn;
-    struct sset lports, all_lports;
-    const char *name;
-    int retval;
-
-    sset_init(&lports);
-    sset_init(&all_lports);
-    get_local_iface_ids(ctx, &lports);
-    sset_clone(&all_lports, &lports);
-
-    txn = ovsdb_idl_txn_create(ctx->ovnsb_idl);
-    ovsdb_idl_txn_add_comment(txn,
-                              "ovn-controller: updating bindings for '%s'",
-                              ctx->chassis_id);
-
-    SBREC_BINDINGS_FOR_EACH(bindings_rec, ctx->ovnsb_idl) {
-        if (sset_find_and_delete(&lports, bindings_rec->logical_port) ||
-                (bindings_rec->parent_port && bindings_rec->parent_port[0] &&
-                 sset_contains(&all_lports, bindings_rec->parent_port))) {
-            if (!strcmp(bindings_rec->chassis, ctx->chassis_id)) {
-                continue;
-            }
-            if (bindings_rec->chassis[0]) {
-                VLOG_INFO("Changing chassis for lport %s from %s to %s",
-                          bindings_rec->logical_port, bindings_rec->chassis,
-                          ctx->chassis_id);
-            }
-            sbrec_bindings_set_chassis(bindings_rec, ctx->chassis_id);
-        } else if (!strcmp(bindings_rec->chassis, ctx->chassis_id)) {
-            sbrec_bindings_set_chassis(bindings_rec, "");
-        }
-    }
-
-    retval = ovsdb_idl_txn_commit_block(txn);
-    if (retval == TXN_ERROR) {
-        VLOG_INFO("Problem committing bindings information: %s",
-                  ovsdb_idl_txn_status_to_string(retval));
-    }
-
-    ovsdb_idl_txn_destroy(txn);
-
-    SSET_FOR_EACH (name, &lports) {
-        VLOG_DBG("No binding record for lport %s", name);
-    }
-    sset_destroy(&lports);
-    sset_destroy(&all_lports);
-}
-
-void
-bindings_destroy(struct controller_ctx *ctx)
-{
-    int retval = TXN_TRY_AGAIN;
-
-    ovs_assert(ctx->ovnsb_idl);
-
-    while (retval != TXN_SUCCESS && retval != TXN_UNCHANGED) {
-        const struct sbrec_bindings *bindings_rec;
-        struct ovsdb_idl_txn *txn;
-
-        txn = ovsdb_idl_txn_create(ctx->ovnsb_idl);
-        ovsdb_idl_txn_add_comment(txn,
-                              "ovn-controller: removing all bindings for '%s'",
-                              ctx->chassis_id);
-
-        SBREC_BINDINGS_FOR_EACH(bindings_rec, ctx->ovnsb_idl) {
-            if (!strcmp(bindings_rec->chassis, ctx->chassis_id)) {
-                sbrec_bindings_set_chassis(bindings_rec, "");
-            }
-        }
-
-        retval = ovsdb_idl_txn_commit_block(txn);
-        if (retval == TXN_ERROR) {
-            VLOG_INFO("Problem removing bindings: %s",
-                      ovsdb_idl_txn_status_to_string(retval));
-        }
-
-        ovsdb_idl_txn_destroy(txn);
-    }
-}
diff --git a/ovn/controller/bindings.h b/ovn/controller/bindings.h
deleted file mode 100644 (file)
index 07681cd..0000000
+++ /dev/null
@@ -1,26 +0,0 @@
-/* Copyright (c) 2015 Nicira, Inc.
- *
- * Licensed under the Apache License, Version 2.0 (the "License");
- * you may not use this file except in compliance with the License.
- * You may obtain a copy of the License at:
- *
- *     http://www.apache.org/licenses/LICENSE-2.0
- *
- * Unless required by applicable law or agreed to in writing, software
- * distributed under the License is distributed on an "AS IS" BASIS,
- * WITHOUT WARRANTIES OR CONDITIONS OF ANY KIND, either express or implied.
- * See the License for the specific language governing permissions and
- * limitations under the License.
- */
-
-
-#ifndef OVN_BINDINGS_H
-#define OVN_BINDINGS_H 1
-
-struct controller_ctx;
-
-void bindings_init(struct controller_ctx *);
-void bindings_run(struct controller_ctx *);
-void bindings_destroy(struct controller_ctx *);
-
-#endif /* ovn/bindings.h */
index 1fd0161..8ef8c25 100644 (file)
@@ -40,7 +40,7 @@
 #include "util.h"
 
 #include "ofctrl.h"
-#include "bindings.h"
+#include "binding.h"
 #include "chassis.h"
 #include "physical.h"
 #include "pipeline.h"
@@ -184,7 +184,7 @@ main(int argc, char *argv[])
     ovsdb_idl_add_column(ctx.ovs_idl, &ovsrec_open_vswitch_col_external_ids);
 
     chassis_init(&ctx);
-    bindings_init(&ctx);
+    binding_init(&ctx);
     pipeline_init();
 
     get_initial_snapshot(ctx.ovs_idl);
@@ -229,7 +229,7 @@ main(int argc, char *argv[])
         ofctrl_clear_flows();
 
         chassis_run(&ctx);
-        bindings_run(&ctx);
+        binding_run(&ctx);
         pipeline_run(&ctx);
         physical_run(&ctx);
         ofctrl_run(&ctx);
@@ -249,7 +249,7 @@ main(int argc, char *argv[])
     unixctl_server_destroy(unixctl);
     pipeline_destroy(&ctx);
     ofctrl_destroy();
-    bindings_destroy(&ctx);
+    binding_destroy(&ctx);
     chassis_destroy(&ctx);
 
     ovsdb_idl_destroy(ctx.ovs_idl);
index 8d9f652..593899d 100644 (file)
@@ -90,8 +90,8 @@ physical_run(struct controller_ctx *ctx)
 
     /* Set up flows in table 0 for physical-to-logical translation and in table
      * 64 for logical-to-physical translation. */
-    const struct sbrec_bindings *binding;
-    SBREC_BINDINGS_FOR_EACH (binding, ctx->ovnsb_idl) {
+    const struct sbrec_binding *binding;
+    SBREC_BINDING_FOR_EACH (binding, ctx->ovnsb_idl) {
         /* Find the Openflow port for the logical port, as 'ofport'.  If it's
          * on a remote chassis, this is the OpenFlow port for the tunnel to
          * that chassis (and set 'local' to false).  Otherwise, if it's on the
index 6df5485..58412e6 100644 (file)
@@ -143,7 +143,7 @@ symtab_init(void)
  * practical for use in an OpenFlow flow table than a UUID.
  *
  * 'ports' maps 'logical_port' names to 'tunnel_key' values in the OVN_SB
- * Bindings table within the logical datapath. */
+ * Binding table within the logical datapath. */
 struct logical_datapath {
     struct hmap_node hmap_node; /* Indexed on 'uuid'. */
     struct uuid uuid;           /* The logical_datapath's UUID. */
@@ -204,7 +204,7 @@ ldp_free(struct logical_datapath *ldp)
     free(ldp);
 }
 
-/* Iterates through all of the records in the Bindings table, updating the
+/* Iterates through all of the records in the Binding table, updating the
  * table of logical_datapaths to match the values found in active Bindings. */
 static void
 ldp_run(struct controller_ctx *ctx)
@@ -214,8 +214,8 @@ ldp_run(struct controller_ctx *ctx)
         simap_clear(&ldp->ports);
     }
 
-    const struct sbrec_bindings *binding;
-    SBREC_BINDINGS_FOR_EACH (binding, ctx->ovnsb_idl) {
+    const struct sbrec_binding *binding;
+    SBREC_BINDING_FOR_EACH (binding, ctx->ovnsb_idl) {
         struct logical_datapath *ldp;
 
         ldp = ldp_lookup(&binding->logical_datapath);
index 0b5becf..cfad6be 100644 (file)
@@ -416,7 +416,7 @@ build_pipeline(struct northd_context *ctx)
 }
 \f
 static bool
-parents_equal(const struct sbrec_bindings *binding,
+parents_equal(const struct sbrec_binding *binding,
               const struct nbrec_logical_port *lport)
 {
     if (!!binding->parent_port != !!lport->parent_name) {
@@ -434,7 +434,7 @@ parents_equal(const struct sbrec_bindings *binding,
 }
 
 static bool
-tags_equal(const struct sbrec_bindings *binding,
+tags_equal(const struct sbrec_binding *binding,
            const struct nbrec_logical_port *lport)
 {
     if (binding->n_tag != lport->n_tag) {
@@ -447,7 +447,7 @@ tags_equal(const struct sbrec_bindings *binding,
 struct binding_hash_node {
     struct hmap_node lp_node; /* In 'lp_map', by binding->logical_port. */
     struct hmap_node tk_node; /* In 'tk_map', by binding->tunnel_key. */
-    const struct sbrec_bindings *binding;
+    const struct sbrec_binding *binding;
 };
 
 static bool
@@ -485,14 +485,14 @@ choose_tunnel_key(const struct hmap *tk_hmap)
 
 /*
  * When a change has occurred in the OVN_Northbound database, we go through and
- * make sure that the contents of the Bindings table in the OVN_Southbound
+ * make sure that the contents of the Binding table in the OVN_Southbound
  * database are up to date with the logical ports defined in the
  * OVN_Northbound database.
  */
 static void
 set_bindings(struct northd_context *ctx)
 {
-    const struct sbrec_bindings *binding;
+    const struct sbrec_binding *binding;
     const struct nbrec_logical_port *lport;
 
     /*
@@ -513,7 +513,7 @@ set_bindings(struct northd_context *ctx)
     struct hmap lp_hmap = HMAP_INITIALIZER(&lp_hmap);
     struct hmap tk_hmap = HMAP_INITIALIZER(&tk_hmap);
 
-    SBREC_BINDINGS_FOR_EACH(binding, ctx->ovnsb_idl) {
+    SBREC_BINDING_FOR_EACH(binding, ctx->ovnsb_idl) {
         struct binding_hash_node *hash_node = xzalloc(sizeof *hash_node);
         hash_node->binding = binding;
         hmap_insert(&lp_hmap, &hash_node->lp_node,
@@ -548,17 +548,17 @@ set_bindings(struct northd_context *ctx)
 
             if (!macs_equal(binding->mac, binding->n_mac,
                         lport->macs, lport->n_macs)) {
-                sbrec_bindings_set_mac(binding,
+                sbrec_binding_set_mac(binding,
                         (const char **) lport->macs, lport->n_macs);
             }
             if (!parents_equal(binding, lport)) {
-                sbrec_bindings_set_parent_port(binding, lport->parent_name);
+                sbrec_binding_set_parent_port(binding, lport->parent_name);
             }
             if (!tags_equal(binding, lport)) {
-                sbrec_bindings_set_tag(binding, lport->tag, lport->n_tag);
+                sbrec_binding_set_tag(binding, lport->tag, lport->n_tag);
             }
             if (!uuid_equals(&binding->logical_datapath, &logical_datapath)) {
-                sbrec_bindings_set_logical_datapath(binding,
+                sbrec_binding_set_logical_datapath(binding,
                                                     logical_datapath);
             }
         } else {
@@ -569,21 +569,21 @@ set_bindings(struct northd_context *ctx)
                 continue;
             }
 
-            binding = sbrec_bindings_insert(ctx->ovnsb_txn);
-            sbrec_bindings_set_logical_port(binding, lport->name);
-            sbrec_bindings_set_mac(binding,
+            binding = sbrec_binding_insert(ctx->ovnsb_txn);
+            sbrec_binding_set_logical_port(binding, lport->name);
+            sbrec_binding_set_mac(binding,
                     (const char **) lport->macs, lport->n_macs);
             if (lport->parent_name && lport->n_tag > 0) {
-                sbrec_bindings_set_parent_port(binding, lport->parent_name);
-                sbrec_bindings_set_tag(binding, lport->tag, lport->n_tag);
+                sbrec_binding_set_parent_port(binding, lport->parent_name);
+                sbrec_binding_set_tag(binding, lport->tag, lport->n_tag);
             }
 
-            sbrec_bindings_set_tunnel_key(binding, tunnel_key);
-            sbrec_bindings_set_logical_datapath(binding, logical_datapath);
+            sbrec_binding_set_tunnel_key(binding, tunnel_key);
+            sbrec_binding_set_logical_datapath(binding, logical_datapath);
 
             /* Add the tunnel key to the tk_hmap so that we don't try to use it
              * for another port.  (We don't want it in the lp_hmap because that
-             * would just get the Bindings record deleted later.) */
+             * would just get the Binding record deleted later.) */
             struct binding_hash_node *hash_node = xzalloc(sizeof *hash_node);
             hash_node->binding = binding;
             hmap_insert(&tk_hmap, &hash_node->tk_node,
@@ -594,7 +594,7 @@ set_bindings(struct northd_context *ctx)
     struct binding_hash_node *hash_node;
     HMAP_FOR_EACH (hash_node, lp_node, &lp_hmap) {
         hmap_remove(&lp_hmap, &hash_node->lp_node);
-        sbrec_bindings_delete(hash_node->binding);
+        sbrec_binding_delete(hash_node->binding);
     }
     hmap_destroy(&lp_hmap);
 
@@ -617,14 +617,14 @@ ovnnb_db_changed(struct northd_context *ctx)
 
 /*
  * The only change we get notified about is if the 'chassis' column of the
- * 'Bindings' table changes.  When this column is not empty, it means we need to
+ * 'Binding' table changes.  When this column is not empty, it means we need to
  * set the corresponding logical port as 'up' in the northbound DB.
  */
 static void
 ovnsb_db_changed(struct northd_context *ctx)
 {
     struct hmap lports_hmap;
-    const struct sbrec_bindings *binding;
+    const struct sbrec_binding *binding;
     const struct nbrec_logical_port *lport;
 
     struct lport_hash_node {
@@ -643,7 +643,7 @@ ovnsb_db_changed(struct northd_context *ctx)
                 hash_string(lport->name, 0));
     }
 
-    SBREC_BINDINGS_FOR_EACH(binding, ctx->ovnsb_idl) {
+    SBREC_BINDING_FOR_EACH(binding, ctx->ovnsb_idl) {
         lport = NULL;
         HMAP_FOR_EACH_WITH_HASH(hash_node, node,
                 hash_string(binding->logical_port, 0), &lports_hmap) {
@@ -787,14 +787,14 @@ main(int argc, char *argv[])
      * has to care about, so we'll enable monitoring those directly. */
     ctx.ovnsb_idl = ovnsb_idl = ovsdb_idl_create(ovnsb_db,
             &sbrec_idl_class, false, true);
-    ovsdb_idl_add_table(ovnsb_idl, &sbrec_table_bindings);
-    ovsdb_idl_add_column(ovnsb_idl, &sbrec_bindings_col_logical_port);
-    ovsdb_idl_add_column(ovnsb_idl, &sbrec_bindings_col_chassis);
-    ovsdb_idl_add_column(ovnsb_idl, &sbrec_bindings_col_mac);
-    ovsdb_idl_add_column(ovnsb_idl, &sbrec_bindings_col_tag);
-    ovsdb_idl_add_column(ovnsb_idl, &sbrec_bindings_col_parent_port);
-    ovsdb_idl_add_column(ovnsb_idl, &sbrec_bindings_col_logical_datapath);
-    ovsdb_idl_add_column(ovnsb_idl, &sbrec_bindings_col_tunnel_key);
+    ovsdb_idl_add_table(ovnsb_idl, &sbrec_table_binding);
+    ovsdb_idl_add_column(ovnsb_idl, &sbrec_binding_col_logical_port);
+    ovsdb_idl_add_column(ovnsb_idl, &sbrec_binding_col_chassis);
+    ovsdb_idl_add_column(ovnsb_idl, &sbrec_binding_col_mac);
+    ovsdb_idl_add_column(ovnsb_idl, &sbrec_binding_col_tag);
+    ovsdb_idl_add_column(ovnsb_idl, &sbrec_binding_col_parent_port);
+    ovsdb_idl_add_column(ovnsb_idl, &sbrec_binding_col_logical_datapath);
+    ovsdb_idl_add_column(ovnsb_idl, &sbrec_binding_col_tunnel_key);
     ovsdb_idl_add_column(ovnsb_idl, &sbrec_pipeline_col_logical_datapath);
     ovsdb_idl_omit_alert(ovnsb_idl, &sbrec_pipeline_col_logical_datapath);
     ovsdb_idl_add_column(ovnsb_idl, &sbrec_pipeline_col_table_id);
index 3673259..5d95e26 100644 (file)
       software gateway.  Northbound, it connects to the OVN Southbound
       Database to learn about OVN configuration and status and to
       populate the PN table and the <code>Chassis</code> column in
-      <code>Bindings</code> table with the hypervisor's status.
+      <code>Binding</code> table with the hypervisor's status.
       Southbound, it connects to <code>ovs-vswitchd</code>(8) as an
       OpenFlow controller, for control over network traffic, and to the
       local <code>ovsdb-server</code>(1) to allow it to monitor and
       flow to recognize that packets destined to the new port's MAC
       address should be delivered to it, and update the flow that
       delivers broadcast and multicast packets to include the new port.
-      It also creates a record in the <code>Bindings</code> table and
+      It also creates a record in the <code>Binding</code> table and
       populates all its columns except the column that identifies the
       <code>chassis</code>.
     </li>
       Interface.  In response, it updates the local hypervisor's OpenFlow
       tables so that packets to and from the VIF are properly handled.
       Afterward, in the OVN Southbound DB, it updates the
-      <code>Bindings</code> table's <code>chassis</code> column for the
+      <code>Binding</code> table's <code>chassis</code> column for the
       row that links the logical port from
       <code>external-ids</code>:<code>iface-id</code> to the hypervisor.
     </li>
       Some CMS systems, including OpenStack, fully start a VM only when its
       networking is ready.  To support this, <code>ovn-northd</code> notices
       the <code>chassis</code> column updated for the row in
-      <code>Bindings</code> table and pushes this upward by updating the
+      <code>Binding</code> table and pushes this upward by updating the
       <ref column="up" table="Logical_Port" db="OVN_NB"/> column in the OVN
       Northbound database's <ref table="Logical_Port" db="OVN_NB"/> table to
       indicate that the VIF is now up.  The CMS, if it uses this feature, can
     <li>
       On every hypervisor but the one where the VIF resides,
       <code>ovn-controller</code> notices the completely populated row in the
-      <code>Bindings</code> table.  This provides <code>ovn-controller</code>
+      <code>Binding</code> table.  This provides <code>ovn-controller</code>
       the physical location of the logical port, so each instance updates the
       OpenFlow tables of its switch (based on logical datapath flows in the OVN
       DB <code>Pipeline</code> table) so that packets to and from the VIF can
       On the hypervisor where the VM was powered off,
       <code>ovn-controller</code> notices that the VIF was deleted.  In
       response, it removes the <code>Chassis</code> column content in the
-      <code>Bindings</code> table for the logical port.
+      <code>Binding</code> table for the logical port.
     </li>
 
     <li>
       On every hypervisor, <code>ovn-controller</code> notices the empty
-      <code>Chassis</code> column in the <code>Bindings</code> table's row
+      <code>Chassis</code> column in the <code>Binding</code> table's row
       for the logical port.  This means that <code>ovn-controller</code> no
       longer knows the physical location of the logical port, so each instance
       updates its OpenFlow table to reflect that.
       <code>ovn-northd</code> receives the OVN Northbound update and in turn
       updates the OVN Southbound database accordingly, by removing or
       updating the rows from the OVN Southbound database
-      <code>Pipeline</code> table and <code>Bindings</code> table that
+      <code>Pipeline</code> table and <code>Binding</code> table that
       were related to the now-destroyed VIF.
     </li>
 
       in the previous step.  <code>ovn-controller</code> updates OpenFlow tables
       to reflect the update, although there may not be much to do, since the VIF
       had already become unreachable when it was removed from the
-      <code>Bindings</code> table in a previous step.
+      <code>Binding</code> table in a previous step.
     </li>
   </ol>
 
       In turn, it makes the corresponding updates to the OVN Southbound
       database, by adding rows to the OVN Southbound database's
       <code>Pipeline</code> table to reflect the new port and also by
-      creating a new row in the <code>Bindings</code> table and
+      creating a new row in the <code>Binding</code> table and
       populating all its columns except the column that identifies the
       <code>chassis</code>.
     </li>
 
     <li>
       On every hypervisor, <code>ovn-controller</code> subscribes to the
-      changes in the <code>Bindings</code> table.  When a new row is created
+      changes in the <code>Binding</code> table.  When a new row is created
       by <code>ovn-northd</code> that includes a value in
-      <code>parent_port</code> column of <code>Bindings</code> table, the
+      <code>parent_port</code> column of <code>Binding</code> table, the
       <code>ovn-controller</code> in the hypervisor whose OVN integration bridge
       has that same value in <var>vif-id</var> in
       <code>external-ids</code>:<code>iface-id</code>
       updates the local hypervisor's OpenFlow tables so that packets to and
       from the VIF with the particular VLAN <code>tag</code> are properly
       handled.  Afterward it updates the <code>chassis</code> column of
-      the <code>Bindings</code> to reflect the physical location.
+      the <code>Binding</code> to reflect the physical location.
     </li>
 
     <li>
       One can only start the application inside the container after the
       underlying network is ready.  To support this, <code>ovn-northd</code>
-      notices the updated <code>chassis</code> column in <code>Bindings</code>
+      notices the updated <code>chassis</code> column in <code>Binding</code>
       table and updates the <ref column="up" table="Logical_Port"
       db="OVN_NB"/> column in the OVN Northbound database's
       <ref table="Logical_Port" db="OVN_NB"/> table to indicate that the
       updates the OVN Southbound database accordingly, by removing or
       updating the rows from the OVN Southbound database
       <code>Pipeline</code> table that were related to the now-destroyed
-      CIF.  It also deletes the row in the <code>Bindings</code> table
+      CIF.  It also deletes the row in the <code>Binding</code> table
       for that CIF.
     </li>
 
index 2c6f7f8..b15aeac 100644 (file)
       This column is populated by <code>ovn-northd</code>, rather than by
       the CMS plugin as is most of this database.  When a logical port is bound
       to a physical location in the OVN Southbound database <ref
-      db="OVN_Southbound" table="Bindings"/> table, <code>ovn-northd</code>
+      db="OVN_Southbound" table="Binding"/> table, <code>ovn-northd</code>
       sets this column to <code>true</code>; otherwise, or if the port
       becomes unbound later, it sets it to <code>false</code>.  This
       allows the CMS to wait for a VM's (or container's) networking to
index a29e986..699bfc5 100644 (file)
@@ -45,7 +45,7 @@
                 "match": {"type": "string"},
                 "actions": {"type": "string"}},
             "isRoot": true},
-        "Bindings": {
+        "Binding": {
             "columns": {
                 "logical_datapath": {"type": "uuid"},
                 "logical_port": {"type": "string"},
index bc3a20e..334d11a 100644 (file)
@@ -80,7 +80,7 @@
   <h3>Bindings data</h3>
 
   <p>
-    The Bindings tables contain the current placement of logical components
+    The Binding tables contain the current placement of logical components
     (such as VMs and VIFs) onto chassis and the bindings between logical ports
     and MACs.
   </p>
@@ -98,7 +98,7 @@
   </p>
 
   <p>
-    The <ref table="Bindings"/> table is currently the only Bindings table.
+    The <ref table="Binding"/> table is currently the only binding data.
   </p>
 
   <table name="Chassis" title="Physical Network Hypervisor and Gateway Information">
     <column name="logical_datapath">
       The logical datapath to which the logical flow belongs.  A logical
       datapath implements a logical pipeline among the ports in the <ref
-      table="Bindings"/> table associated with it.  (No table represents a
+      table="Binding"/> table associated with it.  (No table represents a
       logical datapath.)  In practice, the pipeline in a given logical datapath
       implements either a logical switch or a logical router, and
       <code>ovn-northd</code> reuses the UUIDs for those logical entities from
         String constants have the same syntax as quoted strings in JSON (thus,
         they are Unicode strings).  String constants are used for naming
         logical ports.  Thus, the useful values are <ref
-        column="logical_port"/> names from the <ref column="Bindings"/> and
-        <ref column="Gateway"/> table in a logical flow's <ref
+        column="logical_port"/> names from the <ref column="Binding"/> and
+        <ref column="Gateway"/> tables in a logical flow's <ref
        column="logical_datapath"/>.
       </p>
 
     </column>
   </table>
 
-  <table name="Bindings" title="Physical-Logical Bindings">
+  <table name="Binding" title="Physical-Logical Bindings">
     <p>
       Each row in this table identifies the physical location of a logical
       port.