From patchwork Tue Sep 8 22:23:38 2015 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 515619 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (unknown [IPv6:2600:3c00::f03c:91ff:fe6e:bdf7]) by ozlabs.org (Postfix) with ESMTP id B8C0914031D for ; Wed, 9 Sep 2015 08:23:42 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id 6EC8410653; Tue, 8 Sep 2015 15:23:36 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx1e4.cudamail.com (mx1.cudamail.com [69.90.118.67]) by archives.nicira.com (Postfix) with ESMTPS id 96A2D10200 for ; Tue, 8 Sep 2015 15:23:35 -0700 (PDT) Received: from bar2.cudamail.com (unknown [192.168.21.12]) by mx1e4.cudamail.com (Postfix) with ESMTPS id 1343C1E04A0 for ; Tue, 8 Sep 2015 16:23:35 -0600 (MDT) X-ASG-Debug-ID: 1441751014-03dc531a9ff79c0001-byXFYA Received: from mx1-pf2.cudamail.com ([192.168.24.2]) by bar2.cudamail.com with ESMTP id msNKfxhIbqkYFAXV (version=TLSv1 cipher=DHE-RSA-AES256-SHA bits=256 verify=NO) for ; Tue, 08 Sep 2015 16:23:34 -0600 (MDT) X-Barracuda-Envelope-From: blp@nicira.com X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.2 Received: from unknown (HELO mail-pa0-f46.google.com) (209.85.220.46) by mx1-pf2.cudamail.com with ESMTPS (RC4-SHA encrypted); 8 Sep 2015 22:23:34 -0000 Received-SPF: unknown (mx1-pf2.cudamail.com: Multiple SPF records returned) X-Barracuda-Apparent-Source-IP: 209.85.220.46 X-Barracuda-RBL-IP: 209.85.220.46 Received: by padhy16 with SMTP id hy16so133590005pad.1 for ; Tue, 08 Sep 2015 15:23:33 -0700 (PDT) X-Google-DKIM-Signature: v=1; a=rsa-sha256; c=relaxed/relaxed; d=1e100.net; s=20130820; h=x-gm-message-state:from:to:cc:subject:date:message-id:in-reply-to :references; bh=wcA4dmO6PqKhghstb4TOgwTpWIvJlOB9QQUVMqZoF9A=; b=WYcbU2xlCMGjYrgCbCiqbiDnKKpTe35kPAZ1x7ScRzA9qqQnoyoF03TaNOxxCbglc7 Zr8GJNYdzv4Y7OZDaeARN1/FtbEZJVyK6b+iftblznGYdvHJnBKVVa1r2iQt2H5bHbgi WxxbiWIkjqZ+5EuDCRx8hcQ/O5zkB5i8+X1j492aVEzC5ZY86vFHN+n8HGZjBg9Vww9u NyufF9rFd5NYQF5gqAO2fMYRMH+c9nWPsdYsIMNa7OJB3MaOb2XeEV7+8akKRe4vBLsV 3scArjbE+Prj9FjuoCGZNbeamcf1PPdpHeYDWcMVPDIY907BfHOJbrRjHzbol+BO6zKZ 9MIw== X-Gm-Message-State: ALoCoQnP2AW0oBjEGAsCm31EmNVnn1l+jc5eqz6f9Q5vequ/VcD4dd0k6/QYttF66lLIpPW7II3+ X-Received: by 10.68.143.70 with SMTP id sc6mr62211851pbb.87.1441751013246; Tue, 08 Sep 2015 15:23:33 -0700 (PDT) Received: from sigabrt.benpfaff.org (173-228-112-165.dsl.dynamic.fusionbroadband.com. [173.228.112.165]) by smtp.gmail.com with ESMTPSA id j4sm4622527pdk.9.2015.09.08.15.23.31 (version=TLSv1.2 cipher=ECDHE-RSA-AES128-SHA bits=128/128); Tue, 08 Sep 2015 15:23:32 -0700 (PDT) X-CudaMail-Envelope-Sender: blp@nicira.com From: Ben Pfaff To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E2-907098480 X-CudaMail-DTE: 090815 X-CudaMail-Originating-IP: 209.85.220.46 Date: Tue, 8 Sep 2015 15:23:38 -0700 X-ASG-Orig-Subj: [##CM-E2-907098480##][PATCH 2/3] ovs-ofctl: Add "out_group" keyword for OF1.1+ matching on output group. Message-Id: <1441751019-8625-2-git-send-email-blp@nicira.com> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1441751019-8625-1-git-send-email-blp@nicira.com> References: <1441751019-8625-1-git-send-email-blp@nicira.com> X-Barracuda-Connect: UNKNOWN[192.168.24.2] X-Barracuda-Start-Time: 1441751014 X-Barracuda-Encrypted: DHE-RSA-AES256-SHA X-Barracuda-URL: https://web.cudamail.com:443/cgi-mod/mark.cgi X-ASG-Whitelist: Header =?UTF-8?B?eFwtY3VkYW1haWxcLXdoaXRlbGlzdFwtdG8=?= X-Virus-Scanned: by bsmtpd at cudamail.com X-Barracuda-BRTS-Status: 1 Cc: Ben Pfaff Subject: [ovs-dev] [PATCH 2/3] ovs-ofctl: Add "out_group" keyword for OF1.1+ matching on output group. X-BeenThere: dev@openvswitch.org X-Mailman-Version: 2.1.16 Precedence: list List-Id: List-Unsubscribe: , List-Archive: List-Post: List-Help: List-Subscribe: , MIME-Version: 1.0 Errors-To: dev-bounces@openvswitch.org Sender: "dev" It seems that OVS has never supported this OpenFlow feature in ovs-ofctl, which makes it hard to test. This commit adds support. (Open vSwitch has supported this in OpenFlow for a long time; it's only ovs-ofctl that didn't.) Signed-off-by: Ben Pfaff --- NEWS | 2 ++ lib/ofp-parse.c | 6 ++++++ utilities/ovs-ofctl.8.in | 9 ++++++++- 3 files changed, 16 insertions(+), 1 deletion(-) diff --git a/NEWS b/NEWS index ca22c8e..45f05c7 100644 --- a/NEWS +++ b/NEWS @@ -9,6 +9,8 @@ Post-v2.4.0 * OpenFlow 1.4+ "importance" is now considered for flow eviction. * OpenFlow 1.4+ OFPTC_EVICTION is now implemented. * OpenFlow 1.4+ OFPMP_TABLE_DESC is now implemented. + - ovs-ofctl: + * New "out_group" keyword for OpenFlow 1.1+ matching on output group. - Support for matching/generating options as well as the OAM bit with Geneve tunnels. - Support Multicast Listener Discovery (MLDv1 and MLDv2). diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c index eaaa8ba..b797853 100644 --- a/lib/ofp-parse.c +++ b/lib/ofp-parse.c @@ -398,6 +398,12 @@ parse_ofp_str__(struct ofputil_flow_mod *fm, int command, char *string, error = xasprintf("%s is not a valid OpenFlow port", value); } + } else if (fields & F_OUT_PORT && !strcmp(name, "out_group")) { + *usable_protocols &= OFPUTIL_P_OF11_UP; + if (!ofputil_group_from_string(value, &fm->out_group)) { + error = xasprintf("%s is not a valid OpenFlow group", + value); + } } else if (fields & F_PRIORITY && !strcmp(name, "priority")) { uint16_t priority = 0; diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in index 8bb3715..16f4a30 100644 --- a/utilities/ovs-ofctl.8.in +++ b/utilities/ovs-ofctl.8.in @@ -2275,13 +2275,20 @@ check is expensive so it is best to avoid it.) . .PP The \fBdump\-flows\fR, \fBdump\-aggregate\fR, \fBdel\-flow\fR -and \fBdel\-flows\fR commands support one additional optional field: +and \fBdel\-flows\fR commands support these additional optional fields: . .TP \fBout_port=\fIport\fR If set, a matching flow must include an output action to \fIport\fR, which must be an OpenFlow port number or name (e.g. \fBlocal\fR). . +.TP +\fBout_group=\fIport\fR +If set, a matching flow must include an \fBgroup\fR action naming +\fIgroup\fR, which must be an OpenFlow group number. This field +is supported in Open vSwitch 2.5 and later and requires OpenFlow 1.1 +or later. +. .SS "Table Entry Output" . The \fBdump\-tables\fR and \fBdump\-aggregate\fR commands print information