mirror of
https://github.com/openvswitch/ovs
synced 2025-08-31 06:15:47 +00:00
ofp-actions: Support experimenter OXMs in Nicira extensions.
Some of the Nicira extension actions include fixed-size 32-bit members that designate NXM fields. These actions can't accommodate 64-bit experimenter OXMs, so we need to figure out some kind of solution. This commit does that, in different ways for different actions. For some actions, I did not think it was worthwhile to worry about experimenter OXM, so I just disabled use of them. This is what I did for bundle, learn, and multipath actions. Other actions could be gracefully reinterpreted to support experimenter OXM. This is true of reg_move, which use NXM headers only at the end of the action and such that using an experimenter OXM would make the action longer (which unambigously signals to older OVS that the action is an error, which is desired behavior since older OVS cannot interpret this action). The stack push and pop actions are also in this category. reg_load was the most frustrating case. In OpenFlow 1.5 we had already eliminated this action in favor of OF1.5+ set_field. In other OpenFlow versions, though, reg_load is more powerful than set_field because it can modify partial fields. This commit therefore adds a new variant of reg_load, called reg_load2, which is simply OF1.5+ set_field with a Nicira extension header on it. Signed-off-by: Ben Pfaff <blp@nicira.com> Acked-by: Jarno Rajahalme <jrajahalme@nicira.com>
This commit is contained in:
@@ -221,6 +221,10 @@ learn_parse_load_immediate(const char *s, struct ofpact_learn_spec *spec)
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
if (!mf_nxm_header(dst.field->id)) {
|
||||
return xasprintf("%s: experimenter OXM field '%s' not supported",
|
||||
full_s, s);
|
||||
}
|
||||
|
||||
if (!bitwise_is_all_zeros(&imm, sizeof imm, dst.n_bits,
|
||||
(8 * sizeof imm) - dst.n_bits)) {
|
||||
@@ -269,6 +273,10 @@ learn_parse_spec(const char *orig, char *name, char *value,
|
||||
if (error) {
|
||||
return error;
|
||||
}
|
||||
if (!mf_nxm_header(spec->dst.field->id)) {
|
||||
return xasprintf("%s: experimenter OXM field '%s' not supported",
|
||||
orig, name);
|
||||
}
|
||||
|
||||
/* Parse source and check prerequisites. */
|
||||
if (value[0] != '\0') {
|
||||
|
Reference in New Issue
Block a user