@@ -1702,6 +1702,9 @@ ovn_port_update_sbrec(const struct ovn_port *op,
sbrec_port_binding_set_parent_port(op->sb, NULL);
sbrec_port_binding_set_tag(op->sb, NULL, 0);
sbrec_port_binding_set_mac(op->sb, NULL, 0);
+
+ struct smap ids = SMAP_INITIALIZER(&ids);
+ sbrec_port_binding_set_external_ids(op->sb, &ids);
} else {
if (strcmp(op->nbsp->type, "router")) {
uint32_t queue_id = smap_get_int(
@@ -1794,6 +1797,14 @@ ovn_port_update_sbrec(const struct ovn_port *op,
sbrec_port_binding_set_tag(op->sb, op->nbsp->tag, op->nbsp->n_tag);
sbrec_port_binding_set_mac(op->sb, (const char **) op->nbsp->addresses,
op->nbsp->n_addresses);
+
+ struct smap ids = SMAP_INITIALIZER(&ids);
+ const char *name = smap_get(&op->nbsp->external_ids,
+ "neutron:port_name");
+ if (name && name[0]) {
+ smap_add(&ids, "name", name);
+ }
+ sbrec_port_binding_set_external_ids(op->sb, &ids);
}
}
@@ -5803,6 +5814,8 @@ main(int argc, char *argv[])
add_column_noalert(ovnsb_idl_loop.idl,
&sbrec_port_binding_col_nat_addresses);
ovsdb_idl_add_column(ovnsb_idl_loop.idl, &sbrec_port_binding_col_chassis);
+ add_column_noalert(ovnsb_idl_loop.idl,
+ &sbrec_port_binding_col_external_ids);
ovsdb_idl_add_table(ovnsb_idl_loop.idl, &sbrec_table_mac_binding);
add_column_noalert(ovnsb_idl_loop.idl, &sbrec_mac_binding_col_datapath);
add_column_noalert(ovnsb_idl_loop.idl, &sbrec_mac_binding_col_ip);
@@ -815,6 +815,22 @@
</column>
</group>
+ <group title="Naming">
+ <column name="external_ids" key="neutron:port_name">
+ <p>
+ This column gives an optional human-friendly name for the port. This
+ name has no special meaning or purpose other than to provide
+ convenience for human interaction with the northbound database.
+ </p>
+
+ <p>
+ Neutron copies this from its own port object's name. (Neutron ports
+ do are not assigned human-friendly names by default, so it will often
+ be empty.)
+ </p>
+ </column>
+ </group>
+
<group title="Common Columns">
<column name="external_ids">
See <em>External IDs</em> at the beginning of this document.
@@ -1,7 +1,7 @@
{
"name": "OVN_Southbound",
"version": "1.10.0",
- "cksum": "860871483 9898",
+ "cksum": "3551312875 10107",
"tables": {
"SB_Global": {
"columns": {
@@ -130,7 +130,11 @@
"max": "unlimited"}},
"nat_addresses": {"type": {"key": "string",
"min": 0,
- "max": "unlimited"}}},
+ "max": "unlimited"}},
+ "external_ids": {"type": {"key": "string",
+ "value": "string",
+ "min": 0,
+ "max": "unlimited"}}},
"indexes": [["datapath", "tunnel_key"], ["logical_port"]],
"isRoot": true},
"MAC_Binding": {
@@ -2082,6 +2082,29 @@ tcp.flags = RST;
</p>
</column>
</group>
+
+ <group title="Naming">
+ <column name="external_ids" key="name">
+ <p>
+ For a logical switch port, <code>ovn-northd</code> copies this from
+ <ref table="Logical_Switch_Port" db="OVN_Northbound"
+ column="external_ids" key="neutron:port_name"/> in the <ref
+ table="Logical_Switch_Port" db="OVN_Northbound"/> table in the
+ OVN_Northbound database, if it is a nonempty string.
+ </p>
+
+ <p>
+ For a logical switch port, <code>ovn-northd</code> does not currently
+ set this key.
+ </p>
+ </column>
+ </group>
+
+ <group title="Common Columns">
+ <column name="external_ids">
+ See <em>External IDs</em> at the beginning of this document.
+ </column>
+ </group>
</table>
<table name="MAC_Binding" title="IP to MAC bindings">
This makes it possible for southbound utilities to use friendlier names, which will happen in upcoming commits. Signed-off-by: Ben Pfaff <blp@ovn.org> --- ovn/northd/ovn-northd.c | 13 +++++++++++++ ovn/ovn-nb.xml | 16 ++++++++++++++++ ovn/ovn-sb.ovsschema | 8 ++++++-- ovn/ovn-sb.xml | 23 +++++++++++++++++++++++ 4 files changed, 58 insertions(+), 2 deletions(-)