[ovs-dev] [PATCH 15/22] ofp-parse: Parse (draft) OpenFlow 1.5 bucket ids
Simon Horman
simon.horman at netronome.com
Mon Nov 10 04:48:02 UTC 2014
This is part of support for (draft) OpenFlow 1.5 flow mod messages.
This adds support for specifying the bucket_id of buckets of groups in
ovs-ofctl and documents that accordingly.
EXT-350
Signed-off-by: Simon Horman <simon.horman at netronome.com>
---
lib/ofp-parse.c | 11 +++++++++--
utilities/ovs-ofctl.8.in | 7 +++++++
2 files changed, 16 insertions(+), 2 deletions(-)
diff --git a/lib/ofp-parse.c b/lib/ofp-parse.c
index 55e4625..0167c41 100644
--- a/lib/ofp-parse.c
+++ b/lib/ofp-parse.c
@@ -1116,6 +1116,13 @@ parse_bucket_str(struct ofputil_bucket *bucket, char *str_,
error = xasprintf("invalid watch_group id %"PRIu32,
bucket->watch_group);
}
+ } else if (!strcasecmp(key, "bucket_id")) {
+ error = str_to_u32(value, &bucket->bucket_id);
+ if (!error && bucket->bucket_id > OFPG15_BUCKET_MAX) {
+ error = xasprintf("invalid bucket_id id %"PRIu32,
+ bucket->bucket_id);
+ }
+ *usable_protocols &= OFPUTIL_P_OF15_UP;
} else if (!strcasecmp(key, "action") || !strcasecmp(key, "actions")) {
ds_put_format(&actions, "%s,", value);
} else {
@@ -1194,7 +1201,7 @@ parse_ofp_group_mod_str__(struct ofputil_group_mod *gm, uint16_t command,
*usable_protocols = OFPUTIL_P_OF11_UP;
if (fields & F_BUCKETS) {
- char *bkt_str = strstr(string, "bucket");
+ char *bkt_str = strstr(string, "bucket=");
if (bkt_str) {
*bkt_str = '\0';
@@ -1210,7 +1217,7 @@ parse_ofp_group_mod_str__(struct ofputil_group_mod *gm, uint16_t command,
}
bkt_str++;
- next_bkt_str = strstr(bkt_str, "bucket");
+ next_bkt_str = strstr(bkt_str, "bucket=");
if (next_bkt_str) {
*next_bkt_str = '\0';
}
diff --git a/utilities/ovs-ofctl.8.in b/utilities/ovs-ofctl.8.in
index b8d41fb..89ee480 100644
--- a/utilities/ovs-ofctl.8.in
+++ b/utilities/ovs-ofctl.8.in
@@ -1957,6 +1957,13 @@ comma-separated list of actions.
The fields for \fIbucket_parameters\fR are:
.
.RS
+.IP \fBbucket_id=\fIid\fR
+The integer group id of the bucket.
+.
+This field was added in Open vSwtich 2.3 to conform with the
+OpenFlow 1.5 (draft) specification. It is not supported when
+earlier versions of OpenFlow are used. Internally Open vSwitch
+will allocate bucket ids if they are not specified using this field.
.IP \fBactions=\fR[\fIaction\fR][\fB,\fIaction\fR...]\fR
The syntax of actions are identical to the \fBactions=\fR field described in
\fBFlow Syntax\fR above. Specyfing \fBactions=\fR is optional, any unknown
--
2.1.1
More information about the dev
mailing list