ofp-util: Convert flow_metadata to match structure.
authorJesse Gross <jesse@nicira.com>
Sat, 16 May 2015 00:03:17 +0000 (17:03 -0700)
committerJesse Gross <jesse@nicira.com>
Mon, 8 Jun 2015 17:17:58 +0000 (10:17 -0700)
commit50dcbd8ed473210e6d2aa44f28843fb417416397
tree35b3ee2c862ce58687720c295d5d371c81571085
parentd183efc22b2b0b84c341500a73f567f98f4d00f4
ofp-util: Convert flow_metadata to match structure.

We have a special flow_metadata structure to represent the parts
of a packet that aren't carried in the payload itself. This is
used in the case where we need to send the packet as a Packet In
to an OpenFlow controller. This is a subset of the more general
struct flow.

In practice, almost all operations we do on this structure involve
converting it to or from a match or have code that is the same as
a match. Serialization to NXM and back is done as a match. There
is special flow_metadata formatting code that is almost identical
to match formatting.

The uses for struct flow_metadata aren't performance critical
when it comes to memory, so we can save quite a bit of code by
just using a match structure directly instead. In addition, as
metadata increases and becomes more complex (Geneve options require
some special handling beyond just additional fields), using the
match structure means we only have to do this work in one place.

Signed-off-by: Jesse Gross <jesse@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
13 files changed:
lib/flow.c
lib/flow.h
lib/learning-switch.c
lib/ofp-print.c
lib/ofp-util.c
lib/ofp-util.h
ofproto/connmgr.c
ofproto/fail-open.c
ofproto/ofproto-dpif-upcall.c
ofproto/ofproto-dpif-xlate.c
tests/ofp-print.at
tests/ofproto-dpif.at
tests/ofproto.at