2
0
mirror of https://github.com/openvswitch/ovs synced 2025-08-31 06:15:47 +00:00

ofproto-dpif: Make it easier to credit statistics for resubmits.

Until now, crediting statistics to OpenFlow rules due to "resubmit" actions
has required setting up a "resubmit hook" with a callback function and
auxiliary data.  This commit makes it easier to do, by adding a member to
struct action_xlate_ctx that specifies statistics to credit to each
resubmitted rule.

This commit includes one small behavioral change as an optimization.
Previously, rule_execute() translated the rule twice: once to get the ODP
actions, then a second time after executing the ODP actions to credit
statistics to the rules.  After this commit, rule_execute() translates the
rule only once, crediting statistics as a side effect.  The difference only
becomes visible when executing the actions fails: previously the statistics
would not be incremented, after this commit they will be.  It is very
unusual for executing actions to fail (generally this indicates a bug) so
I'm not concerned about it.

Signed-off-by: Ben Pfaff <blp@nicira.com>
This commit is contained in:
Ben Pfaff
2012-04-13 14:09:10 -07:00
parent c23740be66
commit 112bc5f46f
2 changed files with 59 additions and 61 deletions

View File

@@ -674,8 +674,7 @@ dpif_port_poll_wait(const struct dpif *dpif)
}
/* Extracts the flow stats for a packet. The 'flow' and 'packet'
* arguments must have been initialized through a call to flow_extract().
*/
* arguments must have been initialized through a call to flow_extract(). */
void
dpif_flow_stats_extract(const struct flow *flow, const struct ofpbuf *packet,
struct dpif_flow_stats *stats)