On 7/30/25 4:47 PM, Aaron Conole via dev 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> > --- > 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.
This sentence doesn't seem necessary. > In this case, if > + * all that was updated is the rebalance interval, we can skip > + * triggering the rest of the port reconfigure mechanism. */ s/reconfigure mechanism/reconfiguration/ > + 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; > } We should likely still revalidate when the value goes to or from zero, because that impacts if the bond considered balanced or not. Even if that doesn't cause any problems today, it will inevitably be forgotten in the future. Also, the subtraction may technically overflow if the next_rebalance is not initialized. E.g. if it is not initialized yet when the bond is going from active-backup to balance-tcp. Which may be fine, given those are signed integers, but still doesn't feel right. And this patch needs a Fixes tag. Best regards, Ilya Maximets. _______________________________________________ dev mailing list d...@openvswitch.org https://mail.openvswitch.org/mailman/listinfo/ovs-dev