]> git.feebdaed.xyz Git - 0xmirror/ovs.git/commitdiff
bond: Do not flag a revalidation when adjusting time.
authorAaron Conole <aconole@redhat.com>
Wed, 13 Aug 2025 18:05:56 +0000 (14:05 -0400)
committerAaron Conole <aconole@redhat.com>
Thu, 4 Sep 2025 13:29:04 +0000 (09:29 -0400)
When adjusting bond parameters, any adjustment is considered sufficient
for triggering a rebalance.  This is a very simplistic config update
scheme that triggers a complete rebalance 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://mail.openvswitch.org/pipermail/ovs-discuss/2025-April/053588.html
Acked-by: Ilya Maximets <i.maximets@ovn.org>
Signed-off-by: Aaron Conole <aconole@redhat.com>
ofproto/bond.c

index 3859ddca08cfdd361688f0f20a4a29b74b782367..00f5dc754ce86bde5bd2a5bc73f817b1289ddbc9 100644 (file)
@@ -459,8 +459,23 @@ bond_reconfigure(struct bond *bond, const struct bond_settings *s)
     }
 
     if (bond->rebalance_interval != s->rebalance_interval) {
+        if (s->rebalance_interval && bond->rebalance_interval) {
+            /* Recompute the next rebalance interval by moving the
+             * next_rebalance to be offset by the new interval.  In this
+             * case, if all that was updated is the rebalance interval,
+             * we can skip triggering the rest of the port reconfiguration. */
+            if (bond->next_rebalance) {
+                long long int old_start_time =
+                    bond->next_rebalance - s->rebalance_interval;
+                bond->next_rebalance =
+                    old_start_time + bond->rebalance_interval;
+            }
+        } else {
+            /* When the bond is doing a disable/enable of the rebalance
+             * interval, trigger the revalidation. */
+            revalidate = true;
+        }
         bond->rebalance_interval = s->rebalance_interval;
-        revalidate = true;
     }
 
     if (bond->balance != s->balance) {