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://www.mail-archive.com/[email protected]/msg10409.html
Signed-off-by: Aaron Conole <[email protected]>
---
 ofproto/bond.c | 17 ++++++++++++++++-
 1 file changed, 16 insertions(+), 1 deletion(-)

diff --git a/ofproto/bond.c b/ofproto/bond.c
index 3859ddca08..00f5dc754c 100644
--- a/ofproto/bond.c
+++ b/ofproto/bond.c
@@ -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) {
-- 
2.49.0

_______________________________________________
dev mailing list
[email protected]
https://mail.openvswitch.org/mailman/listinfo/ovs-dev

Reply via email to