[ovs-dev] [PATCH] ofproto: Update time of super-rule to match sub-rule

Ben Pfaff blp at nicira.com
Sat Nov 14 10:39:28 PST 2009


Justin Pettit <jpettit at nicira.com> writes:

> On Nov 13, 2009, at 8:28 PM, Ben Pfaff wrote:
>
>> Justin Pettit <jpettit at nicira.com> writes:
>> 
>>> @@ -2733,6 +2733,9 @@ update_time(struct ofproto *ofproto, struct rule *rule,
>>>     long long int used = msec_from_nsec(stats->used_sec, stats->used_nsec);
>>>     if (used > rule->used) {
>>>         rule->used = used;
>>> +        if (rule->super) {
>>> +            rule->super->used = used;
>>> +        }
>>>         netflow_flow_update_time(ofproto->netflow, &rule->nf_flow, used);
>>>     }
>>> }
>> 
>> Do you have reason to believe that whenever used > rule->used is
>> true, then used > rule->super->used is also true?  Without
>> inspecting code, it seems likely to me that it is not always
>> true, so that the added "if" statement should also verify that
>> used > rule->super->used.
>
> Whoops!  Does the following seem reasonable instead?
>
>         if (rule->super && used > rule->super->used) {
>             rule->super->used = used;
>         }

Yes, that looks good.




More information about the dev mailing list