2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 14:25:26 +00:00

ovs-ofctl: Add bundle support and unit testing.

All existing ovs-ofctl flow mod commands now take an optional
'--bundle' argument, which executes the flow mods as a single
transaction.  OpenFlow 1.4+ is implicitly assumed when '--bundle' is
specified.

ovs-ofctl 'add-flow' and 'add-flows' commands now accept flow
specifications that start with an optional 'add', 'modify', 'delete',
'modify_strict', or 'delete_strict' keyword, so that arbitrary flow
table modifications may be specified.  For backwards compatibility, a
missing keyword is treated as an 'add'.  With the new '--bundle'
option all the modifications are executed as a single transaction
using an OpenFlow 1.4 bundle.

OpenFlow 1.4 requires bundles to support at least flow and port mods.
This implementation does not yet support port mods in bundles.

Another restriction is that the atomic transactions are not yet
supported.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Jarno Rajahalme
2015-06-05 14:03:12 -07:00
parent 4fcb208348
commit db5076eee4
14 changed files with 812 additions and 54 deletions

View File

@@ -8695,6 +8695,36 @@ ofputil_decode_bundle_ctrl(const struct ofp_header *oh,
return 0;
}
struct ofpbuf *
ofputil_encode_bundle_ctrl_request(enum ofp_version ofp_version,
struct ofputil_bundle_ctrl_msg *bc)
{
struct ofpbuf *request;
struct ofp14_bundle_ctrl_msg *m;
switch (ofp_version) {
case OFP10_VERSION:
case OFP11_VERSION:
case OFP12_VERSION:
case OFP13_VERSION:
ovs_fatal(0, "bundles need OpenFlow 1.4 or later "
"(\'-O OpenFlow14\')");
case OFP14_VERSION:
case OFP15_VERSION:
request = ofpraw_alloc(OFPRAW_OFPT14_BUNDLE_CONTROL, ofp_version, 0);
m = ofpbuf_put_zeros(request, sizeof *m);
m->bundle_id = htonl(bc->bundle_id);
m->type = htons(bc->type);
m->flags = htons(bc->flags);
break;
default:
OVS_NOT_REACHED();
}
return request;
}
struct ofpbuf *
ofputil_encode_bundle_ctrl_reply(const struct ofp_header *oh,
struct ofputil_bundle_ctrl_msg *msg)