diff mbox

[ovs-dev,ovs-ovn] ovn:When configuring Logical switch port type by" lsp-set-type"command, Not Specify the type of Logical switch port.

Message ID OFB044FA33.1A5145AC-ON48258087.0010665D-48258087.001083A7@zte.com.cn
State Changes Requested
Headers show

Commit Message

zhou.huijing@zte.com.cn Dec. 12, 2016, 3 a.m. UTC
commit 812f44a9cb6862f3b487e23154a9e114040c40a2 
Author: zhaojingjing <zhao.jingjing1@zte.com.cn> 
Date:   Mon Dec 12 10:48:33 2016 +0800 

    Specify the type of Logical switch port 

 }

Comments

Ben Pfaff Dec. 21, 2016, 11:44 p.m. UTC | #1
On Mon, Dec 12, 2016 at 11:00:38AM +0800, zhou.huijing@zte.com.cn wrote:
> commit 812f44a9cb6862f3b487e23154a9e114040c40a2 
> Author: zhaojingjing <zhao.jingjing1@zte.com.cn> 
> Date:   Mon Dec 12 10:48:33 2016 +0800 
> 
>     Specify the type of Logical switch port 
> 

This seems to have limited value, and it will be difficult to maintain
as we continue to add more kinds of ports over time, so I'd prefer not
to merge it.

The patch is badly formatted and I doubt I could apply it.  Please try
to use git-send-email in the future.
diff mbox

Patch

diff --git a/ovn/utilities/ovn-nbctl.8.xml b/ovn/utilities/ovn-nbctl.8.xml 

index 3904685..255f922 100644 
--- a/ovn/utilities/ovn-nbctl.8.xml 
+++ b/ovn/utilities/ovn-nbctl.8.xml 
@@ -254,7 +254,40 @@  

       <dt><code>lsp-set-type</code> <var>port</var> <var>type</var></dt> 
       <dd> 
-        Set the type for the logical port.  No special types have been 
implemented yet 
+           <p> 
+          Set the type for the logical port.  Logical ports can be used 
to 
+          model other types of connectivity into an OVN logical switch. 
The 
+          following types are defined: 
+        </p> 
+                       <dl> 
+          <dt>(empty string)</dt> 
+          <dd> 
+            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 
+            <code>ovn-controller</code> instance.  A logical switch can 
only 
+            have a single <code>localnet</code> port attached.  This is 
used 
+            to model direct connectivity to an existing network. 
+          </dd> 
+ 
+          <dt><code>l2gateway</code></dt> 
+          <dd> 
+            A connection to a physical network. 
+          </dd> 
+ 
+          <dt><code>vtep</code></dt> 
+          <dd> 
+            A port to a logical switch on a VTEP gateway. 
+          </dd> 
+        </dl> 
       </dd> 

       <dt><code>lsp-get-type</code> <var>port</var></dt> 
diff --git a/ovn/utilities/ovn-nbctl.c b/ovn/utilities/ovn-nbctl.c 
index 0cc0c1f..cc4e342 100644 
--- a/ovn/utilities/ovn-nbctl.c 
+++ b/ovn/utilities/ovn-nbctl.c 
@@ -1098,6 +1098,11 @@  nbctl_lsp_set_type(struct ctl_context *ctx) 
     const struct nbrec_logical_switch_port *lsp; 

     lsp = lsp_by_name_or_uuid(ctx, id, true); 
+    if (strcmp(type, "") && strcmp(type, "router") && strcmp(type, 
"localnet") 
+               && strcmp(type, "l2gateway") && strcmp(type, "vtep")) 
+    { 
+        ctl_fatal("%s: Invalid type. See ovn-nbctl.8.xml.", 
ctx->argv[1]); 
+    } 
     nbrec_logical_switch_port_set_type(lsp, type);