]> git.proxmox.com Git - mirror_ovs.git/commit
OF support and translation of generic encap and decap
authorJan Scheurich <jan.scheurich@ericsson.com>
Wed, 2 Aug 2017 08:04:12 +0000 (16:04 +0800)
committerBen Pfaff <blp@ovn.org>
Wed, 2 Aug 2017 18:17:22 +0000 (11:17 -0700)
commitf839892a206abd7adbc0845f772b9f3c58945af5
tree73a81773461a93e1c0495952eb54bed21fddd4e4
parent46a54ce7114f2caf9367dbc142d37c813adf9db6
OF support and translation of generic encap and decap

This commit adds support for the OpenFlow actions generic encap
and decap (as specified in ONF EXT-382) to the OVS control plane.

CLI syntax for encap action with properties:
  encap(<header>)
  encap(<header>(<prop>=<value>,<tlv>(<class>,<type>,<value>),...))

For example:
  encap(ethernet)
  encap(nsh(md_type=1))
  encap(nsh(md_type=2,tlv(0x1000,10,0x12345678),tlv(0x2000,20,0xfedcba9876543210)))

CLI syntax for decap action:
  decap()
  decap(packet_type(ns=<pt_ns>,type=<pt_type>))

For example:
  decap()
  decap(packet_type(ns=0,type=0xfffe))
  decap(packet_type(ns=1,type=0x894f))

The first header supported for encap and decap is "ethernet" to convert
packets between packet_type (1,Ethertype) and (0,0).

This commit also implements a skeleton for the translation of generic
encap and decap actions in ofproto-dpif and adds support to encap and
decap an Ethernet header.

In general translation of encap commits pending actions and then rewrites
struct flow in accordance with the new packet type and header. In the
case of encap(ethernet) it suffices to change the packet type from
(1, Ethertype) to (0,0) and set the dl_type accordingly. A new
pending_encap flag in xlate ctx is set to mark that an corresponding
datapath encap action must be triggered at the next commit. In the
case of encap(ethernet) ofproto generetas a push_eth action.

The general case for translation of decap() is to emit a datapath action
to decap the current outermost header and then recirculate the packet
to reparse the inner headers. In the special case of an Ethernet packet,
decap() just changes the packet type from (0,0) to (1, dl_type) without
a need to recirculate. The emission of the pop_eth action for the
datapath is postponed to the next commit.

Hence encap(ethernet) and decap() on an Ethernet packet are OF octions
that only incur a cost in the dataplane when a modifed packet is
actually committed, e.g. because it is sent out. They can freely be
used for normalizing the packet type in the OF pipeline without
degrading performance.

Signed-off-by: Jan Scheurich <jan.scheurich@ericsson.com>
Signed-off-by: Yi Yang <yi.y.yang@intel.com>
Signed-off-by: Zoltan Balogh <zoltan.balogh@ericsson.com>
Co-authored-by: Zoltan Balogh <zoltan.balogh@ericsson.com>
Signed-off-by: Ben Pfaff <blp@ovn.org>
14 files changed:
NEWS
include/openflow/openflow-common.h
include/openvswitch/automake.mk
include/openvswitch/ofp-actions.h
include/openvswitch/ofp-ed-props.h [new file with mode: 0644]
include/openvswitch/ofp-errors.h
lib/automake.mk
lib/odp-util.c
lib/odp-util.h
lib/ofp-actions.c
lib/ofp-ed-props.c [new file with mode: 0644]
lib/packets.h
ofproto/ofproto-dpif-xlate.c
utilities/ovs-ofctl.8.in