diff mbox

[ovs-dev,19/23] ovn-nb: Change how router ports work.

Message ID 1444450838-12150-8-git-send-email-blp@nicira.com
State Accepted
Headers show

Commit Message

Ben Pfaff Oct. 10, 2015, 4:20 a.m. UTC
Signed-off-by: Ben Pfaff <blp@nicira.com>
---
 ovn/TODO             | 14 --------------
 ovn/ovn-nb.ovsschema |  8 ++------
 ovn/ovn-nb.xml       | 49 +++++++++++++++++++++++++------------------------
 3 files changed, 27 insertions(+), 44 deletions(-)

Comments

Justin Pettit Oct. 16, 2015, 1:26 a.m. UTC | #1
> On Oct 9, 2015, at 9:20 PM, Ben Pfaff <blp@nicira.com> wrote:
> 
> Signed-off-by: Ben Pfaff <blp@nicira.com>

Acked-by: Justin Pettit <jpettit@nicira.com>

--Justin
Ben Pfaff Oct. 16, 2015, 8:50 p.m. UTC | #2
On Thu, Oct 15, 2015 at 06:26:54PM -0700, Justin Pettit wrote:
> 
> > On Oct 9, 2015, at 9:20 PM, Ben Pfaff <blp@nicira.com> wrote:
> > 
> > Signed-off-by: Ben Pfaff <blp@nicira.com>
> 
> Acked-by: Justin Pettit <jpettit@nicira.com>

Thanks.

I realized when looking at this that I didn't put any rationale into the
commit message.  I improved it:

    ovn-nb: Change how router ports work.
    
    This is for two reasons.  First, a router port is not really much of a
    special case from a logical switch's point of view.  For switching
    purposes, it works exactly the same as any other port.  Having a special
    column for it just adds artificial special cases.
    
    Second, the previous form of router ports specified that all of them use
    the logical port name "ROUTER".  This seemed to make sense at the time but
    now it is just adding more special cases.  Instead just giving them names
    like any other port makes life easier.
    
    Signed-off-by: Ben Pfaff <blp@nicira.com>
    Acked-by: Justin Pettit <jpettit@nicira.com>
diff mbox

Patch

diff --git a/ovn/TODO b/ovn/TODO
index 240804c..8ea0d17 100644
--- a/ovn/TODO
+++ b/ovn/TODO
@@ -12,20 +12,6 @@  one router to another, this doesn't seem to matter (just put more than
 one connection between them), but for connections between a router and
 a switch it might matter because a switch has only one router port.
 
-*** Logical router port names in ACLs
-
-Currently the ACL table documents that the logical router port is
-always named "ROUTER".  This can't work directly using logical patch
-ports to connect a logical switch to its logical router, because every
-row in the Logical_Port table must have a unique name.  This probably
-means that we should change the convention for the ACL table so that
-the logical router port name is unique; for example, we could change
-the Logical_Router_Port table to require the 'name' column to be
-unique, and then use that name in the ACL table.
-
-Another alternative would be to add a way to have aliases for logical
-ports, but I'm not sure that's a rathole we really want to go down.
-
 ** OVN_SB schema
 
 *** Allow output to ingress port
diff --git a/ovn/ovn-nb.ovsschema b/ovn/ovn-nb.ovsschema
index 50930b7..9d254e8 100644
--- a/ovn/ovn-nb.ovsschema
+++ b/ovn/ovn-nb.ovsschema
@@ -1,7 +1,7 @@ 
 {
     "name": "OVN_Northbound",
-    "version": "1.0.0",
-    "cksum": "1432579799 4805",
+    "version": "2.0.0",
+    "cksum": "1378979036 4524",
     "tables": {
         "Logical_Switch": {
             "columns": {
@@ -16,10 +16,6 @@ 
                                           "refType": "strong"},
                                   "min": 0,
                                   "max": "unlimited"}},
-                "router_port": {"type": {"key": {"type": "uuid",
-                                                 "refTable": "Logical_Router_Port",
-                                                 "refType": "weak"},
-                                         "min": 0, "max": 1}},
                 "external_ids": {
                     "type": {"key": "string", "value": "string",
                              "min": 0, "max": "unlimited"}}},
diff --git a/ovn/ovn-nb.xml b/ovn/ovn-nb.xml
index 37556cf..89c3e7d 100644
--- a/ovn/ovn-nb.xml
+++ b/ovn/ovn-nb.xml
@@ -55,21 +55,6 @@ 
       </p>
     </column>
 
-    <column name="router_port">
-      <p>
-        The router port to which this logical switch is connected, or empty if
-        this logical switch is not connected to any router.  A switch may be
-        connected to at most one logical router, but this is not a significant
-        restriction because logical routers may be connected into arbitrary
-        topologies.
-      </p>
-
-      <p>
-        It is an error for multiple logical switches to refer to the same
-        router port.
-      </p>
-    </column>
-
     <column name="acls">
       Access control rules that apply to packets within the logical switch.
     </column>
@@ -122,6 +107,11 @@ 
             A VM (or VIF) interface.
           </dd>
 
+          <dt><code>router</code></dt>
+          <dd>
+            A connection to a logical router.
+          </dd>
+
           <dt><code>localnet</code></dt>
           <dd>
             A connection to a locally accessible network from each
@@ -146,6 +136,23 @@ 
         individually below.
       </column>
 
+      <group title="Options for router ports">
+        <p>
+          These options apply when <ref column="type"/> is <code>router</code>.
+        </p>
+
+        <p>
+          A given logical switch may have at most one logical port of type
+          <code>router</code>.  (This is not a significant restriction because
+          logical routers may be connected into arbitrary topologies.)
+        </p>
+
+        <column name="options" key="router-port" type='{"type": "uuid"}'>
+          Required.  The UUID of the <ref table="Logical_Router_Port"/> to
+          which this logical switch port is connected.
+        </column>
+      </group>
+
       <group title="Options for localnet ports">
         <p>
           These options apply when <ref column="type"/> is
@@ -374,11 +381,6 @@ 
         restrictive policy, it is important to remember to allow flows
         such as ARP and IPv6 neighbor discovery packets.
       </p>
-
-      <p>
-        In logical switches connected to logical routers, the special
-        port name <code>ROUTER</code> refers to the logical router port.
-      </p>
     </column>
 
     <column name="action">
@@ -491,10 +493,9 @@ 
       <ul>
         <li>
           To attach a logical switch to a logical router.  A logical router
-          port of this type is referenced by exactly the <ref
-          column="router_port" table="Logical_Switch"/> column in exactly one
-          <ref table="Logical_Switch"/> row.  The <ref column="peer"/> column
-          is empty.
+          port of this type is referenced by exactly one <ref
+          table="Logical_Port"/> of type <code>router</code>.  The <ref
+          column="peer"/> column is empty.
         </li>
 
         <li>