ofproto-dpif: Reduce number of get_ofp_port() calls during flow xlate.
Until now the flow translation code has done one get_ofp_port() call
initially to check for special processing, then one for each level of
action processing. Only one call is actually necessary, though, because
the in_port of a flow doesn't change in ordinary circumstances, and so this
commit eliminates the unnecessary calls.
The one case where the in_port can change is when a packet passes through
a patch port. The implementation here was buggy anyway: when the patch
port's peer had forwarding disabled by STP, then the code would drop all
ODP actions, even those that were executed before the packet crossed the
patch port. This commit fixes that case.
With a complicated flow table involving multiple levels of resubmit, this
increases flow setup performance by 2-3%.
Signed-off-by: Ben Pfaff <blp@nicira.com>
Acked-by: Ethan Jackson <ethan@nicira.com>