Skip to content

Commit

Permalink
openflow: Use *_array_len names in struct ofp15_bucket and ofp15_grou…
Browse files Browse the repository at this point in the history
…p_mod

The spec has been clarified to use _list_len in palce of _list_len
terminology to make it clearer that the data is not an ordered list
(it is a set). The code present in Open vSwitch already avoided
the _list_len terminology. This change brings the code into
line with the updated spec.

ONF-JIRA: EXT-350
Signed-off-by: Simon Horman <simon.horman@netronome.com>
Signed-off-by: Ben Pfaff <blp@nicira.com>
  • Loading branch information
shorman-netronome authored and blp committed Nov 25, 2014
1 parent b3248fa commit 7987096
Show file tree
Hide file tree
Showing 2 changed files with 8 additions and 8 deletions.
8 changes: 4 additions & 4 deletions include/openflow/openflow-1.5.h
Expand Up @@ -85,11 +85,11 @@ struct ofp15_bucket {
ovs_be16 len; /* Length the bucket in bytes, including
this header and any padding to make it
64-bit aligned. */
ovs_be16 actions_len; /* Length of all actions in bytes. */
ovs_be16 action_array_len; /* Length of all actions in bytes. */
ovs_be32 bucket_id; /* Bucket Id used to identify bucket*/
/* Followed by exactly len - 8 bytes of group bucket properties. */
/* Followed by:
* - Exactly 'actions_len' bytes containing an array of
* - Exactly 'action_array_len' bytes containing an array of
* struct ofp_action_*.
* - Zero or more bytes of group bucket properties to fill out the
* overall length in header.length. */
Expand Down Expand Up @@ -123,14 +123,14 @@ struct ofp15_group_mod {
uint8_t type; /* One of OFPGT11_*. */
uint8_t pad; /* Pad to 64 bits. */
ovs_be32 group_id; /* Group identifier. */
ovs_be16 bucket_list_len; /* Length of action buckets data. */
ovs_be16 bucket_array_len; /* Length of action buckets data. */
uint8_t pad1[2]; /* Pad to 64 bits. */
ovs_be32 command_bucket_id; /* Bucket Id used as part of
* OFPGC15_INSERT_BUCKET and
* OFPGC15_REMOVE_BUCKET commands
* execution.*/
/* Followed by:
* - Exactly 'bucket_list_len' bytes containing an array of
* - Exactly 'bucket_array_len' bytes containing an array of
* struct ofp15_bucket.
* - Zero or more bytes of group properties to fill out the overall
* length in header.length. */
Expand Down
8 changes: 4 additions & 4 deletions lib/ofp-util.c
Expand Up @@ -7402,7 +7402,7 @@ ofputil_put_ofp15_bucket(const struct ofputil_bucket *bucket,

ob = ofpbuf_at_assert(openflow, start, sizeof *ob);
ob->len = htons(ofpbuf_size(openflow) - start);
ob->actions_len = htons(actions_len);
ob->action_array_len = htons(actions_len);
ob->bucket_id = htonl(bucket_id);
}

Expand Down Expand Up @@ -7611,7 +7611,7 @@ ofputil_pull_ofp15_buckets(struct ofpbuf *msg, size_t buckets_length,
}

ob_len = ntohs(ob->len);
actions_len = ntohs(ob->actions_len);
actions_len = ntohs(ob->action_array_len);

if (ob_len < sizeof *ob) {
VLOG_WARN_RL(&bad_ofmsg_rl, "OpenFlow message bucket length "
Expand Down Expand Up @@ -7900,7 +7900,7 @@ ofputil_encode_ofp15_group_mod(enum ofp_version ofp_version,
ogm->type = gm->type;
ogm->group_id = htonl(gm->group_id);
ogm->command_bucket_id = htonl(gm->command_bucket_id);
ogm->bucket_list_len = htons(ofpbuf_size(b) - start_ogm - sizeof *ogm);
ogm->bucket_array_len = htons(ofpbuf_size(b) - start_ogm - sizeof *ogm);

id_pool_destroy(bucket_ids);
return b;
Expand Down Expand Up @@ -8047,7 +8047,7 @@ ofputil_pull_ofp15_group_mod(struct ofpbuf *msg, enum ofp_version ofp_version,
return OFPERR_OFPGMFC_BAD_BUCKET;
}

bucket_list_len = ntohs(ogm->bucket_list_len);
bucket_list_len = ntohs(ogm->bucket_array_len);
if (bucket_list_len < ofpbuf_size(msg)) {
VLOG_WARN_RL(&bad_ofmsg_rl, "group has %u trailing bytes",
ofpbuf_size(msg) - bucket_list_len);
Expand Down

0 comments on commit 7987096

Please sign in to comment.