Adrián Moreno <amore...@redhat.com> writes:

> On Wed, Jul 30, 2025 at 10:47:19AM -0400, Aaron Conole wrote:
>> When adjusting bond parameters, any adjustment is considered sufficient
>> for triggering a rebalance.  This is a very simplistic config update
>> scheme that triggers complete rebalancing even if the time adjustment
>> would move the next expiration out beyond the last calculated expiration.
>>
>> For the interval parameter only, we can simply recalculate the expiry
>> deadline and let the next bond_run() event do the rebalance if needed.
>> Even if the recalculation would cause the deadline to have occurred in
>> the past, it should execute on the next bond_run() anyway.  This is
>> still okay, as the rebalance interval timeout may not result in a
>> full rebalance anyway.
>>
>> Reported-at: 
>> https://www.mail-archive.com/ovs-discuss@openvswitch.org/msg10409.html
>> Signed-off-by: Aaron Conole <acon...@redhat.com>
>
> Nit on the patch title:
> s/rebalance/revalidation/

Okay, I'll fix that up.

> Otherwise:
> Reviewed-by: Adrian Moreno <amore...@redhat.com>

I'll drop your tag when I submit the next version since I need to update
some of the logic.

>> ---
>>  ofproto/bond.c | 8 +++++++-
>>  1 file changed, 7 insertions(+), 1 deletion(-)
>>
>> diff --git a/ofproto/bond.c b/ofproto/bond.c
>> index 3859ddca08..86e21607e5 100644
>> --- a/ofproto/bond.c
>> +++ b/ofproto/bond.c
>> @@ -459,8 +459,14 @@ bond_reconfigure(struct bond *bond, const struct 
>> bond_settings *s)
>>      }
>>
>>      if (bond->rebalance_interval != s->rebalance_interval) {
>> +        /* Recompute the next rebalance interval by moving the 
>> next_rebalance
>> +         * to be offset by the new interval.  Then let the rebalance code
>> +         * trigger a rebalance based on the new details.  In this case, if
>> +         * all that was updated is the rebalance interval, we can skip
>> +         * triggering the rest of the port reconfigure mechanism. */
>> +        int old_start_time = bond->next_rebalance - 
>> bond->rebalance_interval;
>>          bond->rebalance_interval = s->rebalance_interval;
>> -        revalidate = true;
>> +        bond->next_rebalance = old_start_time + bond->rebalance_interval;
>>      }
>>
>>      if (bond->balance != s->balance) {
>> --
>> 2.49.0
>>

_______________________________________________
dev mailing list
d...@openvswitch.org
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to