tunnel: Geneve TLV handling support for OpenFlow.
authorJesse Gross <jesse@nicira.com>
Fri, 1 May 2015 01:09:57 +0000 (18:09 -0700)
committerJesse Gross <jesse@nicira.com>
Thu, 25 Jun 2015 18:08:58 +0000 (11:08 -0700)
commit9558d2a548e18fc520c282399ff403639887173d
tree3716cf08e4b20f05a9b9dd2fa6be9d0564caf6f0
parentec1f6f327e379723f5af4eefa46da49f92753976
tunnel: Geneve TLV handling support for OpenFlow.

The current support for Geneve in OVS is exactly equivalent to VXLAN:
it is possible to set and match on the VNI but not on any options
contained in the header. This patch enables the use of options.

The goal for Geneve support is not to add support for any particular option
but to allow end users or controllers to specify what they would like to
match. That is, the full range of Geneve's capabilities should be exposed
without modifying the code (the one exception being options that require
per-packet computation in the fast path).

The main issue with supporting Geneve options is how to integrate the
fields into the existing OpenFlow pipeline. All existing operations
are referred to by their NXM/OXM field name - matches, action generation,
arithmetic operations (i.e. tranfer to a register). However, the Geneve
option space is exactly the same as the OXM space, so a direct mapping
is not feasible. Instead, we create a pool of 64 NXMs that are then
dynamically mapped on Geneve option TLVs using OpenFlow. Once mapped,
these fields become first-class citizens in the OpenFlow pipeline.

An example of how to use Geneve options:
ovs-ofctl add-geneve-map br0 {class=0xffff,type=0,len=4}->tun_metadata0
ovs-ofctl add-flow br0 in_port=LOCAL,actions=set_field:0xffffffff->tun_metadata0,1

This will add a 4 bytes option (filled will all 1's) to all packets
coming from the LOCAL port and then send then out to port 1.

A limitation of this patch is that although the option table is specified
for a particular switch over OpenFlow, it is currently global to all
switches. This will be addressed in a future patch.

Based on work originally done by Madhu Challa. Ben Pfaff also significantly
improved the comments.

Signed-off-by: Madhu Challa <challa@noironetworks.com>
Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
25 files changed:
NEWS
build-aux/extract-ofp-fields
lib/automake.mk
lib/flow.c
lib/flow.h
lib/match.c
lib/match.h
lib/meta-flow.c
lib/meta-flow.h
lib/nx-match.c
lib/nx-match.h
lib/odp-util.c
lib/odp-util.h
lib/ofp-util.c
lib/packets.h
lib/tun-metadata.c [new file with mode: 0644]
lib/tun-metadata.h
ofproto/ofproto-dpif-rid.h
ofproto/ofproto-dpif-xlate.c
ofproto/ofproto.c
tests/ofproto.at
tests/ovs-ofctl.at
tests/tunnel.at
utilities/ovs-ofctl.8.in
vswitchd/vswitch.xml