[ovs-dev] [PATCH 1/2] ofproto: Distinguish stats from before and after action changes.

Ben Pfaff blp at nicira.com
Fri Nov 13 17:50:33 UTC 2009


Jesse Gross <jesse at nicira.com> writes:

> When a rule is revalidated and the actions change don't lump all
> the stats together.  This will clear the stats in the datapath
> and send a NetFlow expiration message.  This could already happen
> before in certain circumstances so this change makes it more
> consistent.

Great.  Some comments inline:

> @@ -1649,14 +1649,25 @@ rule_reinstall(struct ofproto *ofproto, struct rule *rule)
>  static void
>  rule_update_actions(struct ofproto *ofproto, struct rule *rule)
>  {
> -    bool actions_changed = rule_make_actions(ofproto, rule, NULL);
> +    bool actions_changed;
> +    uint16_t new_out_iface, old_out_iface = rule->nf_flow.output_iface;    

I really don't like that declaration style.  Can you break that
into two lines, or just break the initializer into a statement?

> +                /* Temporarily set the old output iface so that NetFlow
> +                 * messages have the correct output interface for the old
> +                 * stats. */
> +                new_out_iface = rule->nf_flow.output_iface;
> +                rule->nf_flow.output_iface = old_out_iface;
> +                rule_post_uninstall(ofproto, rule);
> +                rule->nf_flow.output_iface = new_out_iface;

This is a little trickier than I like, but I don't see a really
good solution.




More information about the dev mailing list