From patchwork Thu Jul 14 00:06:04 2016 Content-Type: text/plain; charset="utf-8" MIME-Version: 1.0 Content-Transfer-Encoding: 7bit X-Patchwork-Submitter: Ben Pfaff X-Patchwork-Id: 648132 Return-Path: X-Original-To: incoming@patchwork.ozlabs.org Delivered-To: patchwork-incoming@bilbo.ozlabs.org Received: from archives.nicira.com (archives.nicira.com [96.126.127.54]) by ozlabs.org (Postfix) with ESMTP id 3rqbb916y7z9s9W for ; Thu, 14 Jul 2016 10:06:29 +1000 (AEST) Received: from archives.nicira.com (localhost [127.0.0.1]) by archives.nicira.com (Postfix) with ESMTP id C817910B1E; Wed, 13 Jul 2016 17:06:23 -0700 (PDT) X-Original-To: dev@openvswitch.org Delivered-To: dev@openvswitch.org Received: from mx3v3.cudamail.com (mx3.cudamail.com [64.34.241.5]) by archives.nicira.com (Postfix) with ESMTPS id 73B3310AAC for ; Wed, 13 Jul 2016 17:06:22 -0700 (PDT) Received: from bar6.cudamail.com (localhost [127.0.0.1]) by mx3v3.cudamail.com (Postfix) with ESMTPS id 0BD7E1625D5 for ; Wed, 13 Jul 2016 18:06:22 -0600 (MDT) X-ASG-Debug-ID: 1468454780-0b32373de50fa70001-byXFYA Received: from mx1-pf1.cudamail.com ([192.168.24.1]) by bar6.cudamail.com with ESMTP id LjBFx9CNr6E1BpEX (version=TLSv1.2 cipher=ECDHE-RSA-AES256-GCM-SHA384 bits=256 verify=NO) for ; Wed, 13 Jul 2016 18:06:20 -0600 (MDT) X-Barracuda-Envelope-From: blp@ovn.org X-Barracuda-RBL-Trusted-Forwarder: 192.168.24.1 Received: from unknown (HELO relay6-d.mail.gandi.net) (217.70.183.198) by mx1-pf1.cudamail.com with ESMTPS (DHE-RSA-AES256-SHA encrypted); 14 Jul 2016 00:06:19 -0000 Received-SPF: pass (mx1-pf1.cudamail.com: SPF record at ovn.org designates 217.70.183.198 as permitted sender) X-Barracuda-Apparent-Source-IP: 217.70.183.198 X-Barracuda-RBL-IP: 217.70.183.198 Received: from mfilter20-d.gandi.net (mfilter20-d.gandi.net [217.70.178.148]) by relay6-d.mail.gandi.net (Postfix) with ESMTP id B8DF7FB8A0; Thu, 14 Jul 2016 02:06:18 +0200 (CEST) X-Virus-Scanned: Debian amavisd-new at mfilter20-d.gandi.net Received: from relay6-d.mail.gandi.net ([IPv6:::ffff:217.70.183.198]) by mfilter20-d.gandi.net (mfilter20-d.gandi.net [::ffff:10.0.15.180]) (amavisd-new, port 10024) with ESMTP id EI40zHD3_6Wy; Thu, 14 Jul 2016 02:06:17 +0200 (CEST) X-Originating-IP: 208.91.2.3 Received: from sigabrt.benpfaff.org (unknown [208.91.2.3]) (Authenticated sender: blp@ovn.org) by relay6-d.mail.gandi.net (Postfix) with ESMTPSA id 6B68CFB887; Thu, 14 Jul 2016 02:06:16 +0200 (CEST) X-CudaMail-Envelope-Sender: blp@ovn.org From: Ben Pfaff To: dev@openvswitch.org X-CudaMail-Whitelist-To: dev@openvswitch.org X-CudaMail-MID: CM-E1-712082209 X-CudaMail-DTE: 071316 X-CudaMail-Originating-IP: 217.70.183.198 Date: Wed, 13 Jul 2016 17:06:04 -0700 X-ASG-Orig-Subj: [##CM-E1-712082209##][PATCH 1/5] ofp-actions: Add extension to support "group" action in OF1.0. Message-Id: <1468454768-10085-2-git-send-email-blp@ovn.org> X-Mailer: git-send-email 2.1.3 In-Reply-To: <1468454768-10085-1-git-send-email-blp@ovn.org> References: <1468454768-10085-1-git-send-email-blp@ovn.org> X-Barracuda-Connect: UNKNOWN[192.168.24.1] X-Barracuda-Start-Time: 1468454780 X-Barracuda-Encrypted: ECDHE-RSA-AES256-GCM-SHA384 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 1/5] ofp-actions: Add extension to support "group" action in OF1.0. 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" From time to time it confuses users that "group" actions disappear when using OpenFlow 1.0. Signed-off-by: Ben Pfaff Acked-by: Jarno Rajahalme --- NEWS | 1 + lib/ofp-actions.c | 12 ++++-------- tests/ofp-actions.at | 3 +++ utilities/ovs-ofctl.8.in | 6 ++++-- 4 files changed, 12 insertions(+), 10 deletions(-) diff --git a/NEWS b/NEWS index 188e23f..b376420 100644 --- a/NEWS +++ b/NEWS @@ -19,6 +19,7 @@ Post-v2.5.0 packet to size M bytes when outputting to port N. * New command OFPGC_ADD_OR_MOD for OFPT_GROUP_MOD message that adds a new group or modifies an existing groups + * New OpenFlow extension to support the "group" action in OpenFlow 1.0. - ovs-ofctl: * queue-get-config command now allows a queue ID to be specified. * '--bundle' option can now be used with OpenFlow 1.3. diff --git a/lib/ofp-actions.c b/lib/ofp-actions.c index 997cc15..0aafe0a 100644 --- a/lib/ofp-actions.c +++ b/lib/ofp-actions.c @@ -196,8 +196,8 @@ enum ofp_raw_action_type { /* NX1.0(4), OF1.1+(21): uint32_t. */ OFPAT_RAW_SET_QUEUE, - /* OF1.1+(22): uint32_t. */ - OFPAT_RAW11_GROUP, + /* NX1.0(40), OF1.1+(22): uint32_t. */ + OFPAT_RAW_GROUP, /* OF1.1+(23): uint8_t. */ OFPAT_RAW11_SET_NW_TTL, @@ -619,7 +619,7 @@ format_OUTPUT(const struct ofpact_output *a, struct ds *s) /* Group actions. */ static enum ofperr -decode_OFPAT_RAW11_GROUP(uint32_t group_id, +decode_OFPAT_RAW_GROUP(uint32_t group_id, enum ofp_version ofp_version OVS_UNUSED, struct ofpbuf *out) { @@ -631,11 +631,7 @@ static void encode_GROUP(const struct ofpact_group *group, enum ofp_version ofp_version, struct ofpbuf *out) { - if (ofp_version == OFP10_VERSION) { - /* XXX */ - } else { - put_OFPAT11_GROUP(out, group->group_id); - } + put_OFPAT_GROUP(out, ofp_version, group->group_id); } static char * OVS_WARN_UNUSED_RESULT diff --git a/tests/ofp-actions.at b/tests/ofp-actions.at index ca4d1ba..23d3202 100644 --- a/tests/ofp-actions.at +++ b/tests/ofp-actions.at @@ -244,6 +244,9 @@ fe800000 00000000 020c 29ff fe88 a18b dnl # actions=output(port=1,max_len=100) ffff 0010 00002320 0027 0001 00000064 +# actions=group:5 +ffff 0010 00002320 0028 0000 00000005 + # bad OpenFlow10 actions: NXBRC_MUST_BE_ZERO ffff 0018 00002320 0025 0000 0005 0000 1122334455 000005 diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in index 0d91e5f..8413f18 100644 --- a/utilities/ovs-ofctl.8.in +++ b/utilities/ovs-ofctl.8.in @@ -1534,8 +1534,10 @@ Packets larger than \fInbytes\fR will be trimmed to \fInbytes\fR while packets smaller than \fInbytes\fR remains the original size. . .IP \fBgroup:\fIgroup_id\fR -Outputs the packet to the OpenFlow group \fIgroup_id\fR. Group tables -are only supported in OpenFlow 1.1+. See Group Syntax for more details. +Outputs the packet to the OpenFlow group \fIgroup_id\fR. OpenFlow 1.1 +introduced support for groups; Open vSwitch also supports output to +groups as an extension to OpenFlow 1.0. See \fBGroup Syntax\fR for +more details. . .IP \fBnormal\fR Subjects the packet to the device's normal L2/L3 processing. (This