ofp-parse: Parse (draft) OpenFlow 1.5 bucket ids.
authorSimon Horman <simon.horman@netronome.com>
Tue, 11 Nov 2014 03:39:22 +0000 (12:39 +0900)
committerBen Pfaff <blp@nicira.com>
Tue, 11 Nov 2014 17:11:31 +0000 (09:11 -0800)
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.

ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
[blp@nicira.com tweaked the documentation]
Signed-off-by: Ben Pfaff <blp@nicira.com>
lib/ofp-parse.c
utilities/ovs-ofctl.8.in

index 9d14077..1652b14 100644 (file)
@@ -1120,6 +1120,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 {
@@ -1198,7 +1205,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';
@@ -1214,7 +1221,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';
             }
index 0fe2bd4..b358ec8 100644 (file)
@@ -1965,6 +1965,14 @@ comma-separated list of actions.
 The fields for \fIbucket_parameters\fR are:
 .
 .RS
+.IP \fBbucket_id=\fIid\fR
+The 32-bit integer group id of the bucket.  Values greater than
+0xffffff00 are reserved.
+.
+This field was added in Open vSwitch 2.4 to conform with the OpenFlow
+1.5 (draft) specification. It is not supported when earlier versions
+of OpenFlow are used.  Open vSwitch will automatically allocate bucket
+ids when they are not specified.
 .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