Add support for encap/decap nicira actions
Encap action is used to encapsulate the packet with a new packet header,
while decap action is used to decapsulate the outer packet header. Both
actions are particularly useful for application using nsh encapsulation.
From [1], the structure of encap action is:
struct nx_action_encap {
ovs_be16 type; // OFPAT_VENDOR = EXPERIMENTER = 0xFFFF
ovs_be16 len;
ovs_be32 vendor; // NX_VENDOR_ID = NXOXM_ET = 0x00002320
ovs_be16 subtype; // NXAST_ENCAP = 46
ovs_be16 hdr_size; // Header size in bytes, 0 = 'not specified'
ovs_be32 new_pkt_type; // Header type to add
struct ofp_ed_prop_header props[]; // Encap TLV properties
};
Properties are specific to the new packet type, such as the md type or
type 2 metadata in case of nsh. This patch does not include support for
properties. In case of nsh, when no properties are present,
md type defaults to 1.
From [1], the structure of decap action is:
struct nx_action_encap {
ovs_be16 type; // OFPAT_VENDOR = EXPERIMENTER = 0xFFFF
ovs_be16 len;
ovs_be32 vendor; // NX_VENDOR_ID = NXOXM_ET = 0x00002320
ovs_be16 subtype; // NXAST_ENCAP = 47
uint8_t pad[2]; // 2 bytes padding
ovs_be32 new_pkt_type; // new packet type, 0xFFFE = USE NEXT PROTO
};
new_pkt_type is the desired packet type required after decapsulation.
The special value 0xFFFE sets the packet type automatically based on the
outermost header type of the remaining packet.
See [1] and [2] for reference.
[1] https://github.com/openvswitch/ovs/blob/master/lib/ofp-actions.c
[2] http://www.openvswitch.org/support/dist-docs/ovs-ofctl.8.txt
Change-Id: Ia313c68ac17618f89c5e64c9351a0033facf9066
JIRA: OPNFLWPLUG-1017
Signed-off-by: Jaime Caamaño Ruiz <jcaamano@suse.com>
14 files changed: