diff mbox

[ovs-dev] 答复: ovn-nbctl: Not Specify the type of Logical switch port.

Message ID OFD26348A3.7F1033A0-ON48258092.002BA1CE-48258092.002B9753@zte.com.cn
State Not Applicable
Headers show

Commit Message

zhou.huijing@zte.com.cn Dec. 23, 2016, 7:56 a.m. UTC
From 812f44a9cb6862f3b487e23154a9e114040c40a2 Mon Dec 12 10:42:00 2016
From: zhaojingjing <zhao.jingjing1@zte.com.cn> 
Date:   Mon Dec 12 10:48:33 2016 +0800 
Subject: [PATCH] datapath:ovn/utilities/ovn-nbctl.8.xml 
b/ovn/utilities/ovn-nbctl.8.xml,
                          ovn/utilities/ovn-nbctl.c 
b/ovn/utilities/ovn-nbctl.c :
                          Specify the type of Logical switch port 
Signed-off-by: zhaojingjing <zhao.jingjing1@zte.com.cn>

 }

Comments

Ben Pfaff Dec. 23, 2016, 5:10 p.m. UTC | #1
Thanks for the patch.  I don't think that this patch adds much value,
and it would increase the maintenance burden as OVN adds support for new
types of ports.  I don't think that we should apply it.

In addition, this patch is word-wrapped.  In the future, please use "git
send-email" to avoid sending corrupted patches.
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);