lib/ofp-actions: use mf_subvalue in struct ofpact_reg_load.

Use a uninion mf_subvalue instead of a uint64_t for
the value member of struct ofpact_reg_load.

set_field action needs to hold values wider than 64 bits.
This is preparation for set_field action.

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>

---

v5 [Simon Horman]
* Rename format_subvalue() -> mf_format_subvalue() and
  move from lib/learn.c to meta-flow.[ch]
* Use mf_format_subvalue() in nxm_format_reg_load() to
  print all bits used in the subvalue. This improves
  on v4 by handling the case of > 64bits, which may
  occur in the future.

v4 [Simon Horman]
* Use union mf_subfield instead of union mf_value
  as suggested by Ben Pfaff

v3
* No change

v2 [Isaku Yamahata]
* First post

fix
lib/ofp-actions: helper functions for of12 set-field action

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>

---

v5 [Simon Horman]
* Do not add mf_check_dst_oxm(), just use mf_check_dst().

v4 [Simon Horman]
* Remove utilities/ovs-ofctl.c hunk, introduced in v3,
  which belongs in a different patch
* Make use of new oxm_writable field in struct mf_subfield
  to implement mf_check_dst_oxm(). This provides more
  strict checking than the previous implementation.
* Do not call pre-requisites explicitly in mf_are_prereqs_ok()
  - It will segfault as flow is NULL
  - It would be called by mf_is_value_valid() if
    flow was not NULL
* Correct byte-order issues in nxm_reg_load_from_openflow12_set_field()
* Add set_field_format() and use it in nxm_format_reg_load()
* Update to use mf_subfield

v3 [Simon Horman]
* Add (now) missing cases to nxm_reg_load_check()

v2 [Isaku Yamahata]
* First post
ofp-actions: plumb of12 actions support

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>

---

v5 [Simon Horman]
* No change

v4 [Simon Horman]
* Update call to ofpacts_pull_openflow11_instructions()
  in ofctl_parse_ofp11_instructions() to include new ofp_version argument
* Add a special case for OFPAT12_SET_FIELD to decode_openflow12_action()
  as it is a variable-width feild while all other fields are
  fixed-width.

v3 [Simon Horman]
* Manual Rebase
* Make use of enum ofp_version

v2 [Isaku Yamahata]
* First post
ofp-actions: encode OF12 output/set-field actions

Signed-off-by: Isaku Yamahata <yamahata@valinux.co.jp>
Signed-off-by: Simon Horman <horms@verge.net.au>

---

v5 [Simon Horman]
* No change

v4 [Simon Horman]
* Manual Rebase
* Add a limited number of tests

v3 [Simon Horman]
* Manual Rebase
  - Add ofpacts_put_openflow12_instructions() and
    ofpacts_put_openflow11_actions(), this seems to be in keeping
    with the intention of the previous version of this patch.
[RFC] ofp-actions: Check pre-requisists of set-field actions

By passing a flow to the action parser the pre-requisites
of set-feild actions will be checked. If the flow is NULL,
for instance in test code such as ofctl_parse_ofp11_instructions(),
then the check is skiped, as it always was before this change.

Unfortunately I don't think that this check is correct as
it does not take into account other actions actions that may
be applied before the load action, e.g. vlan push/pop, which may
affect the pre-requisites.

I believe that in its current form there is scope for both false positives
(not so bad, perhaps) and false negatives (pretty bad). I would welcome
some input on if these concerns are valid and if so how they may be
overcome.

Signed-off-by: Simon Horman <horms@verge.net.au>

---

v5
* Initial post