Skip to content

Commit

Permalink
ovn: Add type and options to logical port.
Browse files Browse the repository at this point in the history
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 <[email protected]>
Signed-off-by: Ben Pfaff <[email protected]>
  • Loading branch information
russellb authored and blp committed Jul 31, 2015
1 parent 7962b7f commit 1a76c93
Show file tree
Hide file tree
Showing 5 changed files with 57 additions and 0 deletions.
11 changes: 11 additions & 0 deletions ovn/northd/ovn-northd.c
Original file line number Diff line number Diff line change
Expand Up @@ -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. */

Expand All @@ -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
Expand Down Expand Up @@ -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);
Expand Down
6 changes: 6 additions & 0 deletions ovn/ovn-nb.ovsschema
Original file line number Diff line number Diff line change
Expand Up @@ -25,6 +25,12 @@
"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",
Expand Down
17 changes: 17 additions & 0 deletions ovn/ovn-nb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -108,6 +108,23 @@
</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
Expand Down
6 changes: 6 additions & 0 deletions ovn/ovn-sb.ovsschema
Original file line number Diff line number Diff line change
Expand Up @@ -48,6 +48,12 @@
"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,
Expand Down
17 changes: 17 additions & 0 deletions ovn/ovn-sb.xml
Original file line number Diff line number Diff line change
Expand Up @@ -673,6 +673,23 @@
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
Expand Down

0 comments on commit 1a76c93

Please sign in to comment.