ofproto: Add struct ofproto_flow_mod.
authorJarno Rajahalme <jrajahalme@nicira.com>
Mon, 6 Jul 2015 18:45:54 +0000 (11:45 -0700)
committerJarno Rajahalme <jrajahalme@nicira.com>
Mon, 6 Jul 2015 18:45:54 +0000 (11:45 -0700)
commit8be0036745ecda6325e27e87cdb1d23e3e3d5d34
treed2ffe1a6de89a39b9f4707b491476c11fd49aa4a
parent2494ccd78fa0d5cfb3d855abd6bf351acf27e401
ofproto: Add struct ofproto_flow_mod.

It is cleaner to not use ofp_bundle_entry for non-bundle flow mods.
To address this, the new struct ofproto_flow_mod combines an
ofputil_flow_mod and the necessary execution context for executing the
start, revert, and finish phases of the flow mod, which all were
previously members of struct ofp_bundle_entry.

This also simplifies many of the function prototypes introduced with
the OF 1.4 bundles code.  However, in case of learn action execution
this approach requires a new copy of the ofputil_flow_mod.  This could
be avoided by making struct ofproto_flow_mod more complex, but it
seems not worth the complication.

As part of carving out the execution context from ofp_bundle_entry to
ofproto_flow_mod, the 'version' member is now also in
ofproto_flow_mod, as it makes sense for flow mods, but not for port
mods.  Now that the functions operate on the version also get the full
execution context, they use 'version' instead of
'ofproto->tables_version'. This allows ofproto->tables_version to be
changed only when a new version is committed.

Signed-off-by: Jarno Rajahalme <jrajahalme@nicira.com>
Acked-by: Ben Pfaff <blp@nicira.com>
ofproto/bundles.c
ofproto/bundles.h
ofproto/ofproto-dpif.c
ofproto/ofproto-dpif.h
ofproto/ofproto-provider.h
ofproto/ofproto.c