On 13 July 2012 12:02, Ben Pfaff <b...@nicira.com> wrote: > First, ofpacts_pull_openflow11_instructions() ignores > OFPIT_WRITE_METADATA if OFPIT_APPLY_ACTIONS is specified. OF1.1 says, > in contrast, that anything in OFPIT_APPLY_ACTIONS should be processed > first, and then OFPIT_WRITE_METADATA. Both, in other words, not one > or the other.
Ok, fixed the simple issue. > Suppose you fix that; it should not be hard (just remove an "else" > keyword, I think). Then, second, the semantics implemented here will > surprise users, because if ofpacts are translated to OF1.0 then each > OFPIT_WRITE_METADATA will be executed one at a time at the point where > it appears in the actions, but if they are translated to OF1.1 then only > a single OFPIT_WRITE_METADATA will be processed, after all other > actions. I'd rather avoid that. One idea: report an error if > "write_metadata" is specified more than once or if it is not specified > as the last action. Do we want to just limit a maximum of one ofpact_metadata per ofpacts? So, with the above patch:- When OFPIT_WRITE_METADATA is converted to ofpacts, an error is thrown if there is more than one. The conversion is done last, so we don't care where the OFPIT_WRITE_METADATA is placed within the message; it is parsed last, and added to the end of ofpacts. When the ofpacts are converted back to OF1.1, we ignore the NXAST translation case and always write OFPIT_WRITE_METADATA last. If we only have a maximum of one ofpact_metadata in our ofpacts, then this is all fine. The trouble is with NXAST_WRITE_METADATA; Parsing to ofpacts may currently cause multiple metadata_ofpacts to appear internally, but we don't want this. If we can restrict this to one entry, then the reverse process (ofpacts->NX), just needs to ensure that the NXAST_WRITE_METADATA action is the last to appear in the actions list. Is this the preferred approach? Are there other examples which may cause multiple instances of the ofpact_metadata to be stored in ofpacts? _______________________________________________ dev mailing list dev@openvswitch.org http://openvswitch.org/mailman/listinfo/dev