]> git.proxmox.com Git - ovs.git/commitdiff
ovn: Add type and options to logical port.
authorRussell Bryant <rbryant@redhat.com>
Fri, 31 Jul 2015 17:14:42 +0000 (13:14 -0400)
committerBen Pfaff <blp@nicira.com>
Fri, 31 Jul 2015 23:08:34 +0000 (16:08 -0700)
We have started discussing the use of the logical port abstraction in
OVN to represent special types of connections into an OVN logical
switch.  This patch proposes some schema updates to reflect these
special types of logical ports.  A logical port can have a "type" and
a set of options specific to that type.

Some examples of logical port types would be "vtep" for connectivity
to a VTEP gateway or "localnet" for a connection to a locally
accessible network via an ovs bridge.  Actualy support for these (or
other) types will come in later patches.

Signed-off-by: Russell Bryant <rbryant@redhat.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
ovn/northd/ovn-northd.c
ovn/ovn-nb.ovsschema
ovn/ovn-nb.xml
ovn/ovn-sb.ovsschema
ovn/ovn-sb.xml

index 94e89ee75fa061587750443d0f0909e2d2b4e076..2a1913e2492b2f6e31c0ba71eb854796da9e2e09 100644 (file)
@@ -558,6 +558,12 @@ set_bindings(struct northd_context *ctx)
                     sbrec_binding_set_logical_datapath(binding,
                                                        *logical_datapath);
                 }
+                if (!strings_equal(binding->type, lport->type)) {
+                    sbrec_binding_set_type(binding, lport->type);
+                }
+                if (!smap_equal(&binding->options, &lport->options)) {
+                    sbrec_binding_set_options(binding, &lport->options);
+                }
             } else {
                 /* There is no binding for this logical port, so create one. */
 
@@ -578,6 +584,9 @@ set_bindings(struct northd_context *ctx)
                 sbrec_binding_set_tunnel_key(binding, tunnel_key);
                 sbrec_binding_set_logical_datapath(binding, *logical_datapath);
 
+                sbrec_binding_set_type(binding, lport->type);
+                sbrec_binding_set_options(binding, &lport->options);
+
                 /* 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 Binding record deleted
@@ -806,6 +815,8 @@ main(int argc, char *argv[])
     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_binding_col_type);
+    ovsdb_idl_add_column(ovnsb_idl, &sbrec_binding_col_options);
     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 508b6cdd0618289742c0c3d4aa3e42508bb55afb..f17b649f0a9ed1c0b1b8f787e53e792789dc0013 100644 (file)
         "Logical_Port": {
             "columns": {
                 "name": {"type": "string"},
+                "type": {"type": "string"},
+                "options": {
+                     "type": {"key": "string",
+                              "value": "string",
+                              "min": 0,
+                              "max": "unlimited"}},
                 "parent_name": {"type": {"key": "string", "min": 0, "max": 1}},
                 "tag": {
                      "type": {"key": {"type": "integer",
index 032e23ded6602cba4343e454380d428b6d74026a..fac6ad07038b21f3f64115409aeea7a913517517 100644 (file)
       </p>
     </column>
 
+    <column name="type">
+      <p>
+      Specify a type for this logical port.  Logical ports can be used to model
+      other types of connectivity into an OVN logical switch.  Leaving this column
+      blank maintains the default logical port behavior.
+      </p>
+
+      <p>
+      There are no other logical port types implemented yet.
+      </p>
+    </column>
+
+    <column name="options">
+        This column provides key/value settings specific to the logical port
+        <ref column="type"/>.
+    </column>
+
     <column name="parent_name">
       When <ref column="name"/> identifies the interface of a container
       spawned inside a tenant VM, this column represents the VM interface
index f255006b934a2b50c069c0ffb2b48b388357bee1..e50e67143e89cedafe91e7a01bb29898eb9a656b 100644 (file)
             "columns": {
                 "logical_datapath": {"type": "uuid"},
                 "logical_port": {"type": "string"},
+                "type": {"type": "string"},
+                "options": {
+                     "type": {"key": "string",
+                              "value": "string",
+                              "min": 0,
+                              "max": "unlimited"}},
                 "tunnel_key": {
                      "type": {"key": {"type": "integer",
                                       "minInteger": 1,
index 52fe969d5a88b3f6f92d7bc12b2131c399d8ca32..468cbe80c9711a30121d0b0b669a15744745402a 100644 (file)
       prescribe a particular format for the logical port ID.
     </column>
 
+    <column name="type">
+      <p>
+      A type for this logical port.  Logical ports can be used to model
+      other types of connectivity into an OVN logical switch.  Leaving this column
+      blank maintains the default logical port behavior.
+      </p>
+
+      <p>
+      There are no other logical port types implemented yet.
+      </p>
+    </column>
+
+    <column name="options">
+        This column provides key/value settings specific to the logical port
+        <ref column="type"/>.
+    </column>
+
     <column name="tunnel_key">
       <p>
         A number that represents the logical port in the key (e.g. VXLAN VNI or