diff options
author | Ben Pfaff <blp@ovn.org> | 2016-07-14 08:27:21 -0700 |
---|---|---|
committer | Ben Pfaff <blp@ovn.org> | 2016-07-14 08:27:24 -0700 |
commit | 88c8ca263509dc3faaaed76ebf3ccdc95650cec8 (patch) | |
tree | fcb11634a77927dffca0883d958ef6eda209b563 | |
parent | b833ea65bb75a210ae83aa9f496791b845582c10 (diff) | |
download | openvswitch-88c8ca263509dc3faaaed76ebf3ccdc95650cec8.tar.gz |
ofp-actions: Add extension to support "group" action in OF1.0.
From time to time it confuses users that "group" actions disappear when
using OpenFlow 1.0.
Signed-off-by: Ben Pfaff <blp@ovn.org>
Acked-by: Jarno Rajahalme <jarno@ovn.org>
-rw-r--r-- | NEWS | 1 | ||||
-rw-r--r-- | lib/ofp-actions.c | 12 | ||||
-rw-r--r-- | tests/ofp-actions.at | 3 | ||||
-rw-r--r-- | utilities/ovs-ofctl.8.in | 6 |
4 files changed, 12 insertions, 10 deletions
@@ -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 997cc15b4..0aafe0a06 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 ca4d1ba3a..23d320219 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 0d91e5f8b..6114f0fc0 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 2.6 and later 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 |