From patchwork Mon Dec 12 03:00:38 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: zhou.huijing@zte.com.cn X-Patchwork-Id: 704903 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from mail.linuxfoundation.org (mail.linuxfoundation.org [140.211.169.12]) (using TLSv1.2 with cipher ECDHE-RSA-AES256-GCM-SHA384 (256/256 bits)) (No client certificate requested) by ozlabs.org (Postfix) with ESMTPS id 3tcSKV6ZhWz9sdn for ; Mon, 12 Dec 2016 14:01:34 +1100 (AEDT) Received: from mail.linux-foundation.org (localhost [127.0.0.1]) by mail.linuxfoundation.org (Postfix) with ESMTP id 00B88910; Mon, 12 Dec 2016 03:01:30 +0000 (UTC) X-Original-To: dev@openvswitch.org Delivered-To: ovs-dev@mail.linuxfoundation.org Received: from smtp1.linuxfoundation.org (smtp1.linux-foundation.org [172.17.192.35]) by mail.linuxfoundation.org (Postfix) with ESMTPS id 0F0B3259 for ; Mon, 12 Dec 2016 03:01:29 +0000 (UTC) X-Greylist: domain auto-whitelisted by SQLgrey-1.7.6 Received: from out1.zte.com.cn (out1.zte.com.cn [202.103.147.172]) by smtp1.linuxfoundation.org (Postfix) with ESMTP id 1B6F9AB for ; Mon, 12 Dec 2016 03:01:26 +0000 (UTC) X-MAILFROM: X-RCPTTO: X-FROMIP: 10.30.3.20 X-SEG-Scaned: 1 X-Received: unknown,10.30.3.20,20161212105729 Received: from unknown (HELO mse01.zte.com.cn) (10.30.3.20) by localhost with (AES256-SHA encrypted) SMTP; 12 Dec 2016 02:57:29 -0000 Received: from notes_smtp.zte.com.cn ([10.30.1.239]) by mse01.zte.com.cn with ESMTP id uBC30Fs3093399 for ; Mon, 12 Dec 2016 11:00:23 +0800 (GMT-8) (envelope-from zhou.huijing@zte.com.cn) To: dev@openvswitch.org MIME-Version: 1.0 X-KeepSent: B044FA33:1A5145AC-48258087:0010665D; type=4; name=$KeepSent X-Mailer: Lotus Notes Release 8.5.3 September 15, 2011 Message-ID: From: zhou.huijing@zte.com.cn Date: Mon, 12 Dec 2016 11:00:38 +0800 X-MIMETrack: Serialize by Router on notes_smtp/zte_ltd(Release 8.5.3FP6|November 21, 2013) at 2016-12-12 11:00:11, Serialize complete at 2016-12-12 11:00:11 X-MAIL: mse01.zte.com.cn uBC30Fs3093399 X-HQIP: 127.0.0.1 X-Spam-Status: No, score=-4.9 required=5.0 tests=BAYES_00,HTML_MESSAGE, RP_MATCHES_RCVD autolearn=ham version=3.3.1 X-Spam-Checker-Version: SpamAssassin 3.3.1 (2010-03-16) on smtp1.linux-foundation.org X-Content-Filtered-By: Mailman/MimeDel 2.1.12 Cc: zhao.jingjing1@zte.com.cn Subject: [ovs-dev] [ovs-ovn] ovn:When configuring Logical switch port type by" lsp-set-type"command, Not Specify the type of Logical switch port. X-BeenThere: ovs-dev@openvswitch.org X-Mailman-Version: 2.1.12 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , Sender: ovs-dev-bounces@openvswitch.org Errors-To: ovs-dev-bounces@openvswitch.org commit 812f44a9cb6862f3b487e23154a9e114040c40a2 Author: zhaojingjing Date: Mon Dec 12 10:48:33 2016 +0800 Specify the type of Logical switch port } 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 @@
lsp-set-type port type
- Set the type for the logical port. No special types have been implemented yet +

+ 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: +

+
+
(empty string)
+
+ A VM (or VIF) interface. +
+ +
router
+
+ A connection to a logical router. +
+ +
localnet
+
+ A connection to a locally accessible network from each + ovn-controller instance. A logical switch can only + have a single localnet port attached. This is used + to model direct connectivity to an existing network. +
+ +
l2gateway
+
+ A connection to a physical network. +
+ +
vtep
+
+ A port to a logical switch on a VTEP gateway. +
+
lsp-get-type port
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);