Reg load support for nicira experimenter fields 17/71917/14
authorJaime Caamaño Ruiz <jcaamano@suse.com>
Thu, 10 May 2018 17:12:30 +0000 (19:12 +0200)
committerJaime Caamaño Ruiz <jcaamano@suse.com>
Thu, 12 Jul 2018 13:24:20 +0000 (15:24 +0200)
commit340e77f9636212259bdf8dcfd53a49ebe2681aed
tree0845ef937639f28a6b570da92aa9a37a1ce841e0
parent496dd34b82706e3db59c66a906daf3058bd259b6
Reg load support for nicira experimenter fields

Adds reg load support for nicira experimenter fields such as the nsh
fields introduced since OVS 2.8. This is achieved through the
NXAST_REG_LOAD2 openflow action, as the previously used NXAST_REG_LOAD
action does not support experimenter fields.

From [1], the structure of NXAST_REG_LOAD2 action is "struct
ext_action_header", followed by an NXM/OXM header, value, optionally
a mask and the required 8 byte padding:

struct ext_action_header {
    ovs_be16 type;                  /* OFPAT_VENDOR. */
    ovs_be16 len;                   /* At least 16. */
    ovs_be32 vendor;                /* NX_VENDOR_ID or ONF_VENDOR_ID. */
    ovs_be16 subtype;               /* See enum ofp_raw_action_type. */
};

The action type is experimenter (0xFFFF), vendor is NX_VENDOR_ID
(0x00002320) and subtype is 33.

To retain backward compatibility towards applications, only a new
openflowjava actions is introduced, but no new openflowplugin action.
The existing openflowplugin reg-load action will still be used, but
converted to openflowjava reg-load2 in case of experimenter fields.

Some items worth mentioning:

* There is a conversion between the mandatory bit range of the
  reg-load to the optional mask of the oxm field carried by the
  reg-load2 action. Because of that, even though the fields might not be
  match maskable, it is not only possible but required to have a mask
  for them to properly support this conversion between reg-load and
  reg-load2.
* reg-load represents a functional subset of reg-load2 as multiple bit
  ranges may be specified in a single mask. Nevertheless, multiple
  reg-load actions can achieve the same as what would be possible with
  a single reg-load2.

[1] https://github.com/openvswitch/ovs/blob/master/lib/ofp-actions.c

Change-Id: Idbf648d7288046c543d5f2d1da339ddf953b469d
JIRA: OPNFLWPLUG-1017
Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
18 files changed:
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/NiciraExtensionCodecRegistratorImpl.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/NiciraExtensionsRegistrator.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/AbstractActionCodec.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/ActionDeserializer.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/NiciraActionCodecs.java
extension/openflowjava-extension-nicira/src/main/java/org/opendaylight/openflowjava/nx/codec/action/RegLoad2Codec.java [new file with mode: 0644]
extension/openflowjava-extension-nicira/src/main/yang/nicira-action.yang
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/NiciraExtensionCodecRegistratorImplTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/NiciraExtensionsRegistratorTest.java
extension/openflowjava-extension-nicira/src/test/java/org/opendaylight/openflowjava/nx/codec/action/RegLoad2CodecTest.java [new file with mode: 0644]
extension/openflowplugin-extension-nicira/pom.xml
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/NiciraExtensionProvider.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/RegLoad2Convertor.java [new file with mode: 0644]
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/RegLoadConvertor.java
extension/openflowplugin-extension-nicira/src/main/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/RegLoadConvertorProxy.java [new file with mode: 0644]
extension/openflowplugin-extension-nicira/src/main/yang/openflowplugin-extension-nicira-action.yang
extension/openflowplugin-extension-nicira/src/test/java/org/opendaylight/openflowplugin/extension/vendor/nicira/convertor/action/RegLoad2ConvertorTest.java [new file with mode: 0644]
parent/pom.xml