[ovs-dev] [PATCH] ofproto: Update time of super-rule to match sub-rule
Justin Pettit
jpettit at nicira.com
Sat Nov 14 14:23:49 PST 2009
On Nov 14, 2009, at 10:39 AM, Ben Pfaff wrote:
> 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.
Thanks for catching that. I went ahead and pushed with that fix.
--Justin
More information about the dev
mailing list